Running a "puppet parser validate" against the .pp file is usually a
good idea too, as syntax errors will get ignored by the parser.
In your case, I'm wondering if you hit a bug that's fixed for the next
RC - are you using Puppet 3? If so, it's likely a bug in the proxy that
ignores one of the modules (i.e. your only module):
http://theforeman.org/issues/2085
There's a one line patch you can add to the proxy to work around it:
http://people.redhat.com/~dcleal/2085_puppet3_temp_fix.patch
···
On 23/01/13 19:06, Erno Aapa wrote:
> Hi,
> I have strange problem with importing classes.
>
> I use foreman-installer to install it with puppet and everything is
> running ok.
>
> I tested to
> get http://puppet:8443/puppet/environments/production/classes but the
> result is:
> [ ]
>
> If I get http://puppet:8443/puppet/environments/production result is:
> {
>
> *
> paths:
> [
> o
> "/etc/puppet/modules/production",
> o
> "/etc/puppet/modules/common"
> ],
> *
> name: "production"
>
> }
>
> If I set foreman-proxy to debug more I only see in log info and no errors:
> I, [2013-01-23T14:06:18.263744 #8395] INFO -- : Reading environments
> from Puppet config file: /etc/puppet/puppet.conf
>
>
> And my puppet configuration doesn't look any special:
> [main]
> # The Puppet log directory.
> # The default value is '$vardir/log'.
> logdir = /var/log/puppet
>
> # Where Puppet PID files are kept.
> # The default value is '$vardir/run'.
> rundir = /var/run/puppet
>
> # Where SSL certificates are kept.
> # The default value is '$confdir/ssl'.
> ssldir = $vardir/ssl
>
> [agent]
> # The file in which puppetd stores a list of the classes
> # associated with the retrieved configuratiion. Can be loaded in
> # the separate ``puppet`` executable using the ``--loadclasses``
> # option.
> # The default value is '$confdir/classes.txt'.
> classfile = $vardir/classes.txt
>
> # Where puppetd caches the local configuration. An
> # extension indicating the cache format is added automatically.
> # The default value is '$confdir/localconfig'.
> localconfig = $vardir/localconfig
> report = true
> pluginsync = true
> masterport = 8140
> environment = production
> certname = puppet
> server = puppet
>
> [master]
> autosign = $confdir/autosign.conf { mode = 664 }
> reports = foreman
> external_nodes = /etc/puppet/node.rb
> node_terminus = exec
> ca = true
> [development]
> modulepath =
> /etc/puppet/modules/development:/etc/puppet/modules/common
> [production]
> modulepath =
> /etc/puppet/modules/production:/etc/puppet/modules/common
>
>
> I have simple module in
> /etc/puppet/modules/production/test-module/manifests/init.pp:
> class test-module (){
> file {"/tmp/testmodule":
> content => "foo",
> }
> }
>
> And I tested to cat that file as foreman-proxy -user and I have access
> to it.
>
> Any ideas how to debug next?
–
Dominic Cleal
Red Hat Engineering
Aren't hyphens forbidden in class names? The proxy will silently
discard any classes which don't validate, so that might be why you're
seeing nothing…
···
On 23 January 2013 22:11, Dominic Cleal wrote:
> On 23/01/13 19:06, Erno Aapa wrote:
>> Hi,
>> I have strange problem with importing classes.
>>
>> I use foreman-installer to install it with puppet and everything is
>> running ok.
>>
>> I tested to
>> get http://puppet:8443/puppet/environments/production/classes but the
>> result is:
>> [ ]
>>
>> If I get http://puppet:8443/puppet/environments/production result is:
>> {
>>
>> *
>> paths:
>> [
>> o
>> "/etc/puppet/modules/production",
>> o
>> "/etc/puppet/modules/common"
>> ],
>> *
>> name: "production"
>>
>> }
>>
>> If I set foreman-proxy to debug more I only see in log info and no errors:
>> I, [2013-01-23T14:06:18.263744 #8395] INFO -- : Reading environments
>> from Puppet config file: /etc/puppet/puppet.conf
>>
>>
>> And my puppet configuration doesn't look any special:
>> [main]
>> # The Puppet log directory.
>> # The default value is '$vardir/log'.
>> logdir = /var/log/puppet
>>
>> # Where Puppet PID files are kept.
>> # The default value is '$vardir/run'.
>> rundir = /var/run/puppet
>>
>> # Where SSL certificates are kept.
>> # The default value is '$confdir/ssl'.
>> ssldir = $vardir/ssl
>>
>> [agent]
>> # The file in which puppetd stores a list of the classes
>> # associated with the retrieved configuratiion. Can be loaded in
>> # the separate ``puppet`` executable using the ``--loadclasses``
>> # option.
>> # The default value is '$confdir/classes.txt'.
>> classfile = $vardir/classes.txt
>>
>> # Where puppetd caches the local configuration. An
>> # extension indicating the cache format is added automatically.
>> # The default value is '$confdir/localconfig'.
>> localconfig = $vardir/localconfig
>> report = true
>> pluginsync = true
>> masterport = 8140
>> environment = production
>> certname = puppet
>> server = puppet
>>
>> [master]
>> autosign = $confdir/autosign.conf { mode = 664 }
>> reports = foreman
>> external_nodes = /etc/puppet/node.rb
>> node_terminus = exec
>> ca = true
>> [development]
>> modulepath =
>> /etc/puppet/modules/development:/etc/puppet/modules/common
>> [production]
>> modulepath =
>> /etc/puppet/modules/production:/etc/puppet/modules/common
>>
>>
>> I have simple module in
>> /etc/puppet/modules/production/test-module/manifests/init.pp:
>> class test-module (){
>> file {"/tmp/testmodule":
>> content => "foo",
>> }
>> }
>>
>> And I tested to cat that file as foreman-proxy -user and I have access
>> to it.
>>
>> Any ideas how to debug next?
>
> Running a "puppet parser validate" against the .pp file is usually a
> good idea too, as syntax errors will get ignored by the parser.
>
> In your case, I'm wondering if you hit a bug that's fixed for the next
> RC - are you using Puppet 3? If so, it's likely a bug in the proxy that
> ignores one of the modules (i.e. your only module):
> http://theforeman.org/issues/2085
>
> There's a one line patch you can add to the proxy to work around it:
> http://people.redhat.com/~dcleal/2085_puppet3_temp_fix.patch
>
> --
> Dominic Cleal
> Red Hat Engineering
>
> --
> You received this message because you are subscribed to the Google Groups "Foreman users" group.
> To post to this group, send email to foreman-users@googlegroups.com.
> To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.
>
Technically they aren't forbidden. They currently have undocumented
support, and are highly frowned upon for new code, and any examples of
classes and modules with hyphens in their names have been expunged from
official Puppetlabs documentation, but are still supported for legacy code
bases, from the time when this was supported in PL documentation.
I can also say with certainty that we are using a whole bunch of classes
with hyphens in their names, and Foreman handles them fine. (we
are running Puppet 2.6.x, so I don't know if that is the difference.)
-Brian
···
On Wed, Jan 23, 2013 at 8:36 PM, Greg Sutcliffe wrote:
Aren’t hyphens forbidden in class names? The proxy will silently
discard any classes which don’t validate, so that might be why you’re
seeing nothing…
On 23 January 2013 22:11, Dominic Cleal dcleal@redhat.com wrote:
On 23/01/13 19:06, Erno Aapa wrote:
Hi,
I have strange problem with importing classes.
I use foreman-installer to install it with puppet and everything is
running ok.
I tested to
get http://puppet:8443/puppet/environments/production/classes but the
result is:
[ ]
If I get http://puppet:8443/puppet/environments/production result is:
{
- paths:
[
o
"/etc/puppet/modules/production",
o
"/etc/puppet/modules/common"
],
- name: “production”
}
If I set foreman-proxy to debug more I only see in log info and no
errors:
I, [2013-01-23T14:06:18.263744 #8395] INFO – : Reading environments
from Puppet config file: /etc/puppet/puppet.conf
And my puppet configuration doesn’t look any special:
[main]
# The Puppet log directory.
# The default value is ‘$vardir/log’.
logdir = /var/log/puppet
# Where Puppet PID files are kept.
# The default value is '$vardir/run'.
rundir = /var/run/puppet
# Where SSL certificates are kept.
# The default value is '$confdir/ssl'.
ssldir = $vardir/ssl
[agent]
# The file in which puppetd stores a list of the classes
# associated with the retrieved configuratiion. Can be loaded in
# the separate puppet
executable using the --loadclasses
# option.
# The default value is ‘$confdir/classes.txt’.
classfile = $vardir/classes.txt
# Where puppetd caches the local configuration. An
# extension indicating the cache format is added automatically.
# The default value is '$confdir/localconfig'.
localconfig = $vardir/localconfig
report = true
pluginsync = true
masterport = 8140
environment = production
certname = puppet
server = puppet
[master]
autosign = $confdir/autosign.conf { mode = 664 }
reports = foreman
external_nodes = /etc/puppet/node.rb
node_terminus = exec
ca = true
[development]
modulepath =
/etc/puppet/modules/development:/etc/puppet/modules/common
[production]
modulepath =
/etc/puppet/modules/production:/etc/puppet/modules/common
I have simple module in
/etc/puppet/modules/production/test-module/manifests/init.pp:
class test-module (){
file {"/tmp/testmodule":
content => “foo”,
}
}
And I tested to cat that file as foreman-proxy -user and I have access
to it.
Any ideas how to debug next?
Running a “puppet parser validate” against the .pp file is usually a
good idea too, as syntax errors will get ignored by the parser.
In your case, I’m wondering if you hit a bug that’s fixed for the next
RC - are you using Puppet 3? If so, it’s likely a bug in the proxy that
ignores one of the modules (i.e. your only module):
Bug #2085: Classes import fails on first module with Puppet 3: Could not find value for $confdir - Smart Proxy - Foreman
There’s a one line patch you can add to the proxy to work around it:
http://people.redhat.com/~dcleal/2085_puppet3_temp_fix.patch
–
Dominic Cleal
Red Hat Engineering
–
You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.
–
You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.