Hi, I''m not using puppet in a standard way (ie. in a server/client configuration), just the standalone ''puppet --use-nodes'' command. I''m having problems with the directory structure of modules and using the import feature. My directory infrastructure looks like this: /srv/puppet/facter/... /srv/puppet/manifests/site.pp /srv/puppet/manifests/libs/file.pp /srv/puppet/manifests/libs/security.pp /srv/puppet/manifests/templates/.... /srv/puppet/manifests/classes/... /srv/puppet/manifests/packages/... within the site.pp I have a import "libs/file" and within the file.pp file I had import "security" but this doesn''t work, reporting error: Could not find file ./libs/security.pp in file ./libs/file.pp at line 1 Why does it search for ./libs/security.pp when it should be searching ./security.pp as security.pp is in the same directory as file.pp? Is this a bug (I''m using the debian testing package v0.20 I think) or does it work as intended? I''ve also read the documentation on module organistation and I like the idea of configuring puppet this way but I suspect because I''m not using the server/client configuration I won''t be able to do this. Is it possible? Could someone explain to me how the puppet standalone program searches for modules please as I''m confused. Regards, Andrew _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Mar 11, 2007, at 3:47 PM, Andrew Leach wrote:> Hi, > > I''m not using puppet in a standard way (ie. in a server/client > configuration), just the standalone ''puppet --use-nodes'' command. > > I''m having problems with the directory structure of modules and > using the import feature. > > My directory infrastructure looks like this: > > /srv/puppet/facter/... > /srv/puppet/manifests/site.pp > /srv/puppet/manifests/libs/file.pp > /srv/puppet/manifests/libs/security.pp > /srv/puppet/manifests/templates/.... > /srv/puppet/manifests/classes/... > /srv/puppet/manifests/packages/... > > within the site.pp I have a import "libs/file" and within the > file.pp file I had import "security" but this doesn''t work, > reporting error: > > Could not find file ./libs/security.pp in file ./libs/file.pp at > line 1 > > Why does it search for ./libs/security.pp when it should be > searching ./security.pp as security.pp is in the same directory as > file.pp? Is this a bug (I''m using the debian testing package v0.20 > I think) or does it work as intended?I do not get this behaviour, which makes me think that you''ve got an error in your file loading or something.> I''ve also read the documentation on module organistation and I like > the idea of configuring puppet this way but I suspect because I''m > not using the server/client configuration I won''t be able to do > this. Is it possible?Nope; it''s exactly the same code in both cases.> Could someone explain to me how the puppet standalone program > searches for modules please as I''m confused.The same way as the client/server code. -- You''ve achieved success in your field when you don''t know whether what you''re doing is work or play. -- Warren Beatty --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Thank for your response.> Why does it search for ./libs/security.pp when it should be > > searching ./security.pp as security.pp is in the same directory as > > file.pp? Is this a bug (I''m using the debian testing package v0.20 > > I think) or does it work as intended? > > I do not get this behaviour, which makes me think that you''ve got an > error in your file loading or something.Ok, so I''ve done a simple test. Directory structure: /srv/puppet/manifests/imptest.pp /srv/puppet/manifests/test.pp /srv/puppet/manifests/test2.pp imptest.pp: import "libs/test" libs/test.pp: import "test2" libs/test2: <nothing here> Execution run: server:~# puppet imptest.pp Could not find file ./libs/test2.pp in file ./libs/test.pp at line 1 Puppet version: server:~# puppet --version 0.20.1 Changing test.pp to: import "./test2" results in the following error: Could not find file ./libs/./test2.pp in file ./libs/test.pp at line 1 so where it''s picking up the ./libs from? I know, from test.pp prospective, that it''s in the ./libs directory but declaring ./ should override this. I''ve attached my puppet.conf file just in case there''s something misconfigured there (although it looks ok to me). I''ve check the logs and there aren''t any so I''m unable to check those (I''ll need to investigate why that is). Could someone give me some pointers as to where to start debugging this please as it strikes me as a little strange. Regards, Andrew _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Try getting rid of the "./" I think that the paths are relative to the importing file. So, if you have: modules/site.pp modules/libs/blah.pp Site.pp should ''import "libs/blah.pp"'' Hope it works for you. Trevor On 3/12/07, Andrew Leach <imamushroom@gmail.com> wrote:> > > Thank for your response. > > > Why does it search for ./libs/security.pp when it should be > > > searching ./security.pp as security.pp is in the same directory as > > > file.pp? Is this a bug (I''m using the debian testing package v0.20 > > > I think) or does it work as intended? > > > > I do not get this behaviour, which makes me think that you''ve got an > > error in your file loading or something. > > > Ok, so I''ve done a simple test. > > Directory structure: > /srv/puppet/manifests/imptest.pp > /srv/puppet/manifests/test.pp > /srv/puppet/manifests/test2.pp > > imptest.pp: > import "libs/test" > > libs/test.pp: > import "test2" > > libs/test2: > <nothing here> > > Execution run: > server:~# puppet imptest.pp > Could not find file ./libs/test2.pp in file ./libs/test.pp at line 1 > > Puppet version: > server:~# puppet --version > 0.20.1 > > Changing test.pp to: > import "./test2" > > results in the following error: > Could not find file ./libs/./test2.pp in file ./libs/test.pp at line 1 > > so where it''s picking up the ./libs from? I know, from test.ppprospective, that it''s in the ./libs directory but declaring ./ should > override this. > > I''ve attached my puppet.conf file just in case there''s something > misconfigured there (although it looks ok to me). I''ve check the logs and > there aren''t any so I''m unable to check those (I''ll need to investigate why > that is). Could someone give me some pointers as to where to start debugging > this please as it strikes me as a little strange. > > Regards, > Andrew > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users > > >_______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Hi Trevor, Thanks for you response. Try getting rid of the "./" I think that the paths are relative to the> importing file.I agree it does seem to be relative to the importing file but only to initial importing file which I find strange. In my example test I have site.pp importing "libs/test" which is fine but then in "libs/test.pp" I''m importing "test2" which is in the same directory as "libs/test.pp" so simply importing "test2" in file "lib/test.pp" should in effect import "./test2" but it seems to be relative to the initial manifest, "imptest.pp" which results in an import attempt of "libs/libs/test2". Is this clear (I''m not sure it is!)? Regards, Andrew _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Mar 12, 2007, at 3:02 AM, Andrew Leach wrote:> [...] > so where it''s picking up the ./libs from? I know, from test.pp > prospective, that it''s in the ./libs directory but declaring ./ > should override this. > > I''ve attached my puppet.conf file just in case there''s something > misconfigured there (although it looks ok to me). I''ve check the > logs and there aren''t any so I''m unable to check those (I''ll need > to investigate why that is). Could someone give me some pointers as > to where to start debugging this please as it strikes me as a > little strange.I don''t have any problems with this, under either 0.20.1 or svn trunk. This is my config: luke@phage(0) $ find manifests manifests manifests/imptest.pp manifests/libs manifests/libs/test.pp manifests/libs/test2.pp manifests/test.pp manifests/test2.pp luke@phage(0) $ cat manifests/imptest.pp import "libs/test" luke@phage(0) $ cat manifests/libs/test.pp import "test2" luke@phage(0) $ cat manifests/libs/test2.pp exec { "/bin/echo test2": } luke@phage(0) $ ~/puppet/bin/puppet manifests/imptest.pp notice: //Exec[/bin/echo test2]/returns: executed successfully luke@phage(0) $ cd manifests luke@phage(0) $ ~/puppet/bin/puppet imptest.pp notice: //Exec[/bin/echo test2]/returns: executed successfully luke@phage(0) $ It''s picking "libs" up because you''ve got an explicit "import ''libs/..." in your code, from what I can tell. Your example tree did not have any files in a ''libs'' directory; are you meaning to be using "libs", or did you just not include your whole tree? -- I went to a restaurant that serves "breakfast at anytime". So I ordered French Toast during the Renaissance. -- Stephen Wright --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com