Hi Does anyone know if the following is supposed to work? ------------------------------------------------------ site.pp case $psi_rank { Devel: { import "Devel/psi_gfa/*" import "Devel/nodes" import "Devel/os/yum_update" } Prod: { import "Prod/psi_gfa/*" import "Prod/nodes" import "Prod/os/yum_update" } } Looks like its importing both ... err: Could not parse; using old configuration: edline is already defined at /etc/puppet/manifests/Devel/psi_gfa/psi_gfa_define.pp:16; cannot redefine at /etc/puppet/manifests/Prod/psi_gfa/psi_gfa_define.pp:16
Rene Kapeller schrieb:> Hi > > Does anyone know if the following is supposed to work? > ------------------------------------------------------ > > site.pp > > case $psi_rank { > Devel: { > import "Devel/psi_gfa/*" > import "Devel/nodes" > import "Devel/os/yum_update" > } > Prod: { > import "Prod/psi_gfa/*" > import "Prod/nodes" > import "Prod/os/yum_update" > } > } > > Looks like its importing both ... > > err: Could not parse; using old configuration: edline is already defined > at /etc/puppet/manifests/Devel/psi_gfa/psi_gfa_define.pp:16; cannot > redefine at /etc/puppet/manifests/Prod/psi_gfa/psi_gfa_define.pp:16Try import "${psi_rank}/..." instead. Be careful though if the value comes from a client, this might lead to security implications. You might want to add a validity check. Regards, DavidS
David Schmitt wrote:> Rene Kapeller schrieb: >> Hi >> >> Does anyone know if the following is supposed to work? >> ------------------------------------------------------ >> >> site.pp >> >> case $psi_rank { >> Devel: { >> import "Devel/psi_gfa/*" >> import "Devel/nodes" >> import "Devel/os/yum_update" >> } >> Prod: { >> import "Prod/psi_gfa/*" >> import "Prod/nodes" >> import "Prod/os/yum_update" >> } >> } >> >> Looks like its importing both ... >> >> err: Could not parse; using old configuration: edline is already defined >> at /etc/puppet/manifests/Devel/psi_gfa/psi_gfa_define.pp:16; cannot >> redefine at /etc/puppet/manifests/Prod/psi_gfa/psi_gfa_define.pp:16 > > Try > > import "${psi_rank}/..." > > > instead. Be careful though if the value comes from a client, this might > lead to security implications. You might want to add a validity check. > >Hi David No success: import "${psi_rank}/psi_gfa/*" import "${psi_rank}/nodes" import "${psi_rank}/os/yum_update" warning: The import of ${psi_rank}/psi_gfa/* contains a variable reference; variables are not interpolated for imports in file /etc/puppet/manifests/site.pp at line 31 Rene
On Nov 23, 2007, at 5:02 AM, Rene Kapeller wrote:> > Hi > > Does anyone know if the following is supposed to work? > ------------------------------------------------------ > > site.pp > > case $psi_rank { > Devel: { > import "Devel/psi_gfa/*" > import "Devel/nodes" > import "Devel/os/yum_update" > } > Prod: { > import "Prod/psi_gfa/*" > import "Prod/nodes" > import "Prod/os/yum_update" > } > } > > Looks like its importing both ... > > err: Could not parse; using old configuration: edline is already > defined > at /etc/puppet/manifests/Devel/psi_gfa/psi_gfa_define.pp:16; cannot > redefine at /etc/puppet/manifests/Prod/psi_gfa/psi_gfa_define.pp:16I expect you''re coming from Cfengine, where this was a typical usage, and that the files you''re importing do not wrap all of their code in classes. For each of those files you have, make sure all of the defined resources are in classes, and then import all of the files. Then, use your conditionals to selectively include classes, rather than selectively importing files. Make sense? -- If I want your opinion, I''ll read your entrails. --Doug Shewfelt --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Hi Luke Thanks for the help! I actually do selectively include classes, but to distinguish functionality of systems (web-server, sql-server, ..) However, in order to have some kind of development environment, I would like to have a copy of all classes and files in a separate development directory. I could then work on those without doing any harm to my productive system. I could then test them on any client, which has a specific facter variable set to ''Prod''. Does this sound weired? Rene Luke Kanies wrote:> On Nov 23, 2007, at 5:02 AM, Rene Kapeller wrote: > >> Hi >> >> Does anyone know if the following is supposed to work? >> ------------------------------------------------------ >> >> site.pp >> >> case $psi_rank { >> Devel: { >> import "Devel/psi_gfa/*" >> import "Devel/nodes" >> import "Devel/os/yum_update" >> } >> Prod: { >> import "Prod/psi_gfa/*" >> import "Prod/nodes" >> import "Prod/os/yum_update" >> } >> } >> >> Looks like its importing both ... >> >> err: Could not parse; using old configuration: edline is already >> defined >> at /etc/puppet/manifests/Devel/psi_gfa/psi_gfa_define.pp:16; cannot >> redefine at /etc/puppet/manifests/Prod/psi_gfa/psi_gfa_define.pp:16 > > I expect you''re coming from Cfengine, where this was a typical usage, > and that the files you''re importing do not wrap all of their code in > classes. > > For each of those files you have, make sure all of the defined > resources are in classes, and then import all of the files. Then, > use your conditionals to selectively include classes, rather than > selectively importing files. > > Make sense? > > -- > If I want your opinion, I''ll read your entrails. > --Doug Shewfelt > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Rene Kapeller wrote:> Hi Luke > Thanks for the help! > > I actually do selectively include classes, but to distinguish > functionality of systems (web-server, sql-server, ..) > > However, in order to have some kind of development environment, I would > like to have a copy of all classes and files in a separate development > directory. I could then work on those without doing any harm to my > productive system. I could then test them on any client, which has a > specific facter variable set to ''Prod''. > > Does this sound weired?I think this sounds like environments might help you out: http://reductivelabs.com/trac/puppet/wiki/UsingMultipleEnvironments Regards James Turnbull - -- James Turnbull <james@lovedthanlost.net> - --- Author of Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) Hardening Linux (http://www.amazon.com/gp/product/1590594444/) - --- PGP Key (http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x0C42DF40) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHSsMK9hTGvAxC30ARAgUCAKCJRUQcNaD1vizywulFY3pNhbwybwCfW90G Up0+RaUcXoxcRBGVEWW434g=8cZR -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1> I think this sounds like environments might help you out: > > http://reductivelabs.com/trac/puppet/wiki/UsingMultipleEnvironments >As DavidS rightly pointed out on IRC - I should have mentioned that multiple environments are only supported in the upcoming 0.24 release. Regards James Turnbull - -- James Turnbull <james@lovedthanlost.net> - --- Author of Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) Hardening Linux (http://www.amazon.com/gp/product/1590594444/) - --- PGP Key (http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x0C42DF40) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHStUD9hTGvAxC30ARAmH/AJ9NHzV1LSCrUpLFuF3tuB75mq21tgCeLxf5 iQkuxQe2oI0B7RghXt4fWNc=9HcK -----END PGP SIGNATURE-----
> >> I think this sounds like environments might help you out: >> >> http://reductivelabs.com/trac/puppet/wiki/UsingMultipleEnvironments >> > > As DavidS rightly pointed out on IRC - I should have mentioned that > multiple environments are only supported in the upcoming 0.24 release.I just noticed that. Any idea when that is going to happen? Regards, Rene> > Regards > > James Turnbull > > - -- > James Turnbull <james@lovedthanlost.net> > - --- > Author of Pro Nagios 2.0 > (http://www.amazon.com/gp/product/1590596099/) > > Hardening Linux > (http://www.amazon.com/gp/product/1590594444/) > - --- > PGP Key (http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x0C42DF40) > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.7 (Darwin) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFHStUD9hTGvAxC30ARAmH/AJ9NHzV1LSCrUpLFuF3tuB75mq21tgCeLxf5 > iQkuxQe2oI0B7RghXt4fWNc> =9HcK > -----END PGP SIGNATURE----- > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Rene Kapeller wrote:>>> I think this sounds like environments might help you out: >>> >>> http://reductivelabs.com/trac/puppet/wiki/UsingMultipleEnvironments >>> >> As DavidS rightly pointed out on IRC - I should have mentioned that >> multiple environments are only supported in the upcoming 0.24 release. > > I just noticed that. Any idea when that is going to happen? >No guarantees but all indications suggest sometime in the next couple/three weeks. Regards James Turnbull - -- James Turnbull <james@lovedthanlost.net> - --- Author of Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) Hardening Linux (http://www.amazon.com/gp/product/1590594444/) - --- PGP Key (http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x0C42DF40) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHStoH9hTGvAxC30ARAo0nAJ9+/AQO19Ad/qnO2j4LsTOGCxzl0wCgzR1v DB4SUuy6VOOzV1pNHfsmhvs=L4y5 -----END PGP SIGNATURE-----
On Nov 26, 2007, at 8:36 AM, James Turnbull wrote:>>>> >>>> >>> As DavidS rightly pointed out on IRC - I should have mentioned that >>> multiple environments are only supported in the upcoming 0.24 >>> release. >> >> I just noticed that. Any idea when that is going to happen? >> > > No guarantees but all indications suggest sometime in the next > couple/three weeks.Indeed. I hope to get HEAD to a release-candidate state this week, then give the community a week or so to stress-test it, and then put out the release. -- Sabbagh''s Second Law: The biggest problem with communication is the illusion that it has occurred. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com