Chantal Rosmuller
2010-May-18 05:59 UTC
[Puppet Users] client specific configuration not working
Hi list, I have a puppet setup in which I use the file hierarchy from best practices: http://projects.puppetlabs.com/projects/puppet/wiki/Puppet_Best_Practice I am currently working on a bind9 configuration for debian clients, I use he modules directory for the bind configuration and it works fine. Puppet installs bind and distributes named.conf. Now I want to distribute a named.conf.local file for one specific host so I thought I put thyat in the clients directory. Unfortunately I cannot get it to work. This is my site.pp: import "modules" import "clients" import "nodes" this is my clients.pp: import "servername" in the clients directory there''s a directory "servername" with subdirectories manifests and files here''s my clients/servername/manifests/init.pp: class servername { file { "/etc/bind/named.conf.local": owner => root, group => bind, mode => 644, source => "puppet:///servername/named.conf.local", } } Now here''s the error I get on the client: err: Could not retrieve catalog: Could not parse for environment production: No file(s) found for import of ''servername'' at /etc/puppet/manifests/clients.pp:1 So what am I doing wrong here? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Silviu Paragina
2010-May-18 09:36 UTC
Re: [Puppet Users] client specific configuration not working
On 18.05.2010 08:59, Chantal Rosmuller wrote:> > in the clients directory there''s a directory "servername" with > subdirectories manifests and files > > here''s my clients/servername/manifests/init.pp:have you changed the puppet.conf so that it can use the modules from the new location? Puppet does not load the modules by default from there... It searches for them in /etc/puppet/modules (if i remember right, as I don''t use the default location)> > > err: Could not retrieve catalog: Could not parse for environment > production: No file(s) found for import of ''servername'' at > /etc/puppet/manifests/clients.pp:1 > > So what am I doing wrong here? > >Silviu -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Chantal Rosmuller
2010-May-18 09:58 UTC
Re: [Puppet Users] client specific configuration not working
Hi, I changed puppet.conf and added: modulepath=/etc/puppet/modules:/etc/puppet/clients and restarted puppet unfortunately the same error Op dinsdag 18 mei 2010 11:36:54 schreef Silviu Paragina:> On 18.05.2010 08:59, Chantal Rosmuller wrote: > > in the clients directory there''s a directory "servername" with > > subdirectories manifests and files > > > > here''s my clients/servername/manifests/init.pp: > > have you changed the puppet.conf so that it can use the modules from the > new location? Puppet does not load the modules by default from there... > It searches for them in /etc/puppet/modules (if i remember right, as I > don''t use the default location) > > > err: Could not retrieve catalog: Could not parse for environment > > production: No file(s) found for import of ''servername'' at > > /etc/puppet/manifests/clients.pp:1 > > > > So what am I doing wrong here? > > Silviu >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Silviu Paragina
2010-May-18 16:15 UTC
Re: [Puppet Users] client specific configuration not working
Odd, should of worked. Try this (at this point I''m guessing) Try removing the import "servername", it''s optional in the latest versions of puppet. And make sure you have something along the line in nodes.pp node basenode { include servername } Silviu On 18.05.2010 12:58, Chantal Rosmuller wrote:> Hi, > > I changed puppet.conf and added: > > modulepath=/etc/puppet/modules:/etc/puppet/clients > > and restarted puppet > > unfortunately the same error > > > Op dinsdag 18 mei 2010 11:36:54 schreef Silviu Paragina: > >> On 18.05.2010 08:59, Chantal Rosmuller wrote: >> >>> in the clients directory there''s a directory "servername" with >>> subdirectories manifests and files >>> >>> here''s my clients/servername/manifests/init.pp: >>> >> have you changed the puppet.conf so that it can use the modules from the >> new location? Puppet does not load the modules by default from there... >> It searches for them in /etc/puppet/modules (if i remember right, as I >> don''t use the default location) >> >> >>> err: Could not retrieve catalog: Could not parse for environment >>> production: No file(s) found for import of ''servername'' at >>> /etc/puppet/manifests/clients.pp:1 >>> >>> So what am I doing wrong here? >>> >> Silviu >> >> >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Yes I think your correct Silviu. You want ''include'' not ''import''. To explain: Import is more like the C #include directive - it effectively just pulls the contents of the external file into the current one. Because you didn''t have a file ''servername.pp'' you got an error (as one would expect :-). Include is a bit more magical. It does the import (behind the scenes) of the file <modulepath>/manifests/init.pp and then calls the class found inside it. I''m simplifying but I figure you get the idea :-). ken. On May 18, 5:15 pm, Silviu Paragina <sil...@paragina.ro> wrote:> Odd, should of worked. > Try this (at this point I''m guessing) > Try removing the import "servername", it''s optional in the latest > versions of puppet. > And make sure you have something along the line in nodes.pp > > node basenode { > include servername > > } > > Silviu > > On 18.05.2010 12:58, Chantal Rosmuller wrote: > > > > > > > Hi, > > > I changed puppet.conf and added: > > > modulepath=/etc/puppet/modules:/etc/puppet/clients > > > and restarted puppet > > > unfortunately the same error > > > Op dinsdag 18 mei 2010 11:36:54 schreef Silviu Paragina: > > >> On 18.05.2010 08:59, Chantal Rosmuller wrote: > > >>> in the clients directory there''s a directory "servername" with > >>> subdirectories manifests and files > > >>> here''s my clients/servername/manifests/init.pp: > > >> have you changed the puppet.conf so that it can use the modules from the > >> new location? Puppet does not load the modules by default from there... > >> It searches for them in /etc/puppet/modules (if i remember right, as I > >> don''t use the default location) > > >>> err: Could not retrieve catalog: Could not parse for environment > >>> production: No file(s) found for import of ''servername'' at > >>> /etc/puppet/manifests/clients.pp:1 > > >>> So what am I doing wrong here? > > >> Silviu > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/puppet-users?hl=en.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Silviu Paragina
2010-May-18 21:07 UTC
Re: [Puppet Users] Re: client specific configuration not working
On 18.05.2010 22:47, Ken wrote:> Yes I think your correct Silviu. You want ''include'' not ''import''. > > To explain: > > Import is more like the C #include directive - it effectively just > pulls the contents of the external file into the current one. Because > you didn''t have a file ''servername.pp'' you got an error (as one would > expect :-). > > Include is a bit more magical. It does the import (behind the scenes) > of the file<modulepath>/manifests/init.pp and then calls the class > found inside it. I''m simplifying but I figure you get the idea :-). >:-?? when I started using puppet, import was looking in the modules path also. I still have an import from that time and I don''t use the standard paths and it still works for me. Maybe something different in newer versions (I''m using 0.25.4) Silviu -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Patrick
2010-May-18 22:28 UTC
Re: [Puppet Users] Re: client specific configuration not working
On May 18, 2010, at 2:07 PM, Silviu Paragina wrote:> On 18.05.2010 22:47, Ken wrote: >> Yes I think your correct Silviu. You want ''include'' not ''import''. >> >> To explain: >> >> Import is more like the C #include directive - it effectively just >> pulls the contents of the external file into the current one. Because >> you didn''t have a file ''servername.pp'' you got an error (as one would >> expect :-). >> >> Include is a bit more magical. It does the import (behind the scenes) >> of the file<modulepath>/manifests/init.pp and then calls the class >> found inside it. I''m simplifying but I figure you get the idea :-). >> > :-?? when I started using puppet, import was looking in the modules path also. I still have an import from that time and I don''t use the standard paths and it still works for me. Maybe something different in newer versions (I''m using 0.25.4)import can use relative paths. Could the file you were talking about have been in a module''s directory? -Patrick -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Chantal Rosmuller
2010-May-19 08:25 UTC
Re: [Puppet Users] client specific configuration not working
Thanks I already tried including the servername in nodes.pp but forgot to mention it in my initial post, sorry. If I don''t include it in nodes.pp nothing happens. I guess I''ll can put the server specific modules in the module directory and call them s_servername or something. Not very tidy but at least it will work. Op dinsdag 18 mei 2010 18:15:17 schreef Silviu Paragina:> Odd, should of worked. > Try this (at this point I''m guessing) > Try removing the import "servername", it''s optional in the latest > versions of puppet. > And make sure you have something along the line in nodes.pp > > node basenode { > include servername > } > > Silviu > > On 18.05.2010 12:58, Chantal Rosmuller wrote: > > Hi, > > > > I changed puppet.conf and added: > > > > modulepath=/etc/puppet/modules:/etc/puppet/clients > > > > and restarted puppet > > > > unfortunately the same error > > > > Op dinsdag 18 mei 2010 11:36:54 schreef Silviu Paragina: > >> On 18.05.2010 08:59, Chantal Rosmuller wrote: > >>> in the clients directory there''s a directory "servername" with > >>> subdirectories manifests and files > >>> > >>> here''s my clients/servername/manifests/init.pp: > >> > >> have you changed the puppet.conf so that it can use the modules from the > >> new location? Puppet does not load the modules by default from there... > >> It searches for them in /etc/puppet/modules (if i remember right, as I > >> don''t use the default location) > >> > >>> err: Could not retrieve catalog: Could not parse for environment > >>> production: No file(s) found for import of ''servername'' at > >>> /etc/puppet/manifests/clients.pp:1 > >>> > >>> So what am I doing wrong here? > >> > >> Silviu >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.