I''m trying to run puppet on a node I''m cloning from CD. No IP, no DNS, puppet with a standalone manifest and --use-nodes. I get dnsdomainname errors and a "Network is unreachable" error. I''m using 0.20, but I checked for new options in 0.23 and didn''t see one to turn off networking. Is this an option? Thanks. ------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3
On Dec 20, 2007, at 2:38 AM, Russell Adams wrote:> I''m trying to run puppet on a node I''m cloning from CD. No IP, no DNS, > puppet with a standalone manifest and --use-nodes. > > I get dnsdomainname errors and a "Network is unreachable" error. I''m > using 0.20, but I checked for new options in 0.23 and didn''t see one > to turn off networking. > > Is this an option?No, but... Nothing should be using the network unless you tell it to, and certainly nothing in ''puppet'' should be doing so. Are you sure it''s puppet, or might it be facter? -- That was just a drill of the emergency y2k system. Had this been a real emergency, we would''ve also dumped a bucket of spiders on you and yelled out "civilization is collapsing!" --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
You''ve got a point. Its likely to be facter trying to determine the hostname. How could I work around this? Thanks. On Thu, Dec 20, 2007 at 10:58:20AM -0600, Luke Kanies wrote:> On Dec 20, 2007, at 2:38 AM, Russell Adams wrote: > > > I''m trying to run puppet on a node I''m cloning from CD. No IP, no DNS, > > puppet with a standalone manifest and --use-nodes. > > > > I get dnsdomainname errors and a "Network is unreachable" error. I''m > > using 0.20, but I checked for new options in 0.23 and didn''t see one > > to turn off networking. > > > > Is this an option? > > No, but... Nothing should be using the network unless you tell it to, > and certainly nothing in ''puppet'' should be doing so. > > Are you sure it''s puppet, or might it be facter? > > -- > That was just a drill of the emergency y2k system. Had this been a > real emergency, we would''ve also dumped a bucket of spiders on you and > yelled out "civilization is collapsing!" > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3
I''m working on a vmware::vm define, which I''d like to take the following values for ensure : present - the vm exists on the machine registered - vm registered with the server, which implies present running - vm powered on, which implies registered stopped - vm powered off, which implies registered suspended - vm suspended, which implies running (it should run then suspend if it''s stopped) unregistered - vm removed from the server, implies present At first I had a nice case statement and callouts for defined functions for create, register, and change state... lots of duplicate code, but not terrible. Then I realized that the defines don''t necessarily run in order, and why would they... Anyhow, I can either rework the whole thing as a big messy wad of execs, keep my nice calls, but have them depend on execs in other depends (probably worse) How can this be done? I''ve tried to make a simple example below: class vmwerver::vm { case $ensure { present: { create_vm { "$name": } } registered: { create_vm { "$name": } register_vm { "$name": } } running: { create_vm { "$name": } register_vm { "$name": } start_vm { "$name": } } } }
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 20 December 2007, Eugene Ventimiglia wrote:> How can this be done? I''ve tried to make a simple example below: > > class vmwerver::vm { > case $ensure { > present: { > create_vm { "$name": } > } > registered: { > create_vm { "$name": } > register_vm { "$name": } > } > running: { > create_vm { "$name": } > register_vm { "$name": } > start_vm { "$name": } > } > } > }What about: class vmwerver::vm { case $ensure { present: { create_vm { "$name": } } registered: { create_vm { "$name": } register_vm { "$name": require => Create_vm[$name] } } running: { create_vm { "$name": } register_vm { "$name": require => Create_vm[$name] } start_vm { "$name": require => Register_vm[$name] } } } } ? But be wary of bug #446, which was only fixed in the recently released 0.24 Regards, David - -- The primary freedom of open source is not the freedom from cost, but the free- dom to shape software to do what you want. This freedom is /never/ exercised without cost, but is available /at all/ only by accepting the very different costs associated with open source, costs not in money, but in time and effort. - -- http://www.schierer.org/~luke/log/20070710-1129/on-forks-and-forking -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHaquq/Pp1N6Uzh0URAqRNAJwK59ETYIqGPiBHFVuR3KZ0ZXjUBwCfcXG0 H3bG6yk7fwuIUUDlbzouunY=zOQz -----END PGP SIGNATURE-----
I actually tried that, but got the following: notice: Ignoring cache warning: Not using cache on failed catalog warning: Configuration could not be instantiated: Could not find dependency Vmserver::create_vm[10.100.6.172 - rhel5 Ruby Test - eventi] Is this supposed to work? I tried it in hopes that it would --e -----Original Message----- From: puppet-users-bounces@madstop.com [mailto:puppet-users-bounces@madstop.com] On Behalf Of David Schmitt Sent: Thursday, December 20, 2007 12:52 PM To: Puppet User Discussion Subject: Re: [Puppet-users] Complicated dependencies problem -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 20 December 2007, Eugene Ventimiglia wrote:> How can this be done? I''ve tried to make a simple example below: > > class vmwerver::vm { > case $ensure { > present: { > create_vm { "$name": } > } > registered: { > create_vm { "$name": } > register_vm { "$name": } > } > running: { > create_vm { "$name": } > register_vm { "$name": } > start_vm { "$name": } > } > } > }What about: class vmwerver::vm { case $ensure { present: { create_vm { "$name": } } registered: { create_vm { "$name": } register_vm { "$name": require => Create_vm[$name] } } running: { create_vm { "$name": } register_vm { "$name": require => Create_vm[$name] } start_vm { "$name": require => Register_vm[$name] } } } } ? But be wary of bug #446, which was only fixed in the recently released 0.24 Regards, David - -- The primary freedom of open source is not the freedom from cost, but the free- dom to shape software to do what you want. This freedom is /never/ exercised without cost, but is available /at all/ only by accepting the very different costs associated with open source, costs not in money, but in time and effort. - -- http://www.schierer.org/~luke/log/20070710-1129/on-forks-and-forking -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHaquq/Pp1N6Uzh0URAqRNAJwK59ETYIqGPiBHFVuR3KZ0ZXjUBwCfcXG0 H3bG6yk7fwuIUUDlbzouunY=zOQz -----END PGP SIGNATURE----- _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Eugene Ventimiglia
2007-Dec-20 19:42 UTC
Fall through case statement (was: Complicated dependencies problem )
Open mouth - insert foot - echo globally But it does bring me to my next question: Can you have fall through conditions in a case statement, like: case $ensure { present: registered: running: { create_vm { "${name}": } } } -----Original Message----- From: puppet-users-bounces@madstop.com [mailto:puppet-users-bounces@madstop.com] On Behalf Of Eugene Ventimiglia Sent: Thursday, December 20, 2007 2:36 PM To: Puppet User Discussion Subject: Re: [Puppet-users] Complicated dependencies problem I actually tried that, but got the following: notice: Ignoring cache warning: Not using cache on failed catalog warning: Configuration could not be instantiated: Could not find dependency Vmserver::create_vm[10.100.6.172 - rhel5 Ruby Test - eventi] Is this supposed to work? I tried it in hopes that it would --e -----Original Message----- From: puppet-users-bounces@madstop.com [mailto:puppet-users-bounces@madstop.com] On Behalf Of David Schmitt Sent: Thursday, December 20, 2007 12:52 PM To: Puppet User Discussion Subject: Re: [Puppet-users] Complicated dependencies problem -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 20 December 2007, Eugene Ventimiglia wrote:> How can this be done? I''ve tried to make a simple example below: > > class vmwerver::vm { > case $ensure { > present: { > create_vm { "$name": } > } > registered: { > create_vm { "$name": } > register_vm { "$name": } > } > running: { > create_vm { "$name": } > register_vm { "$name": } > start_vm { "$name": } > } > } > }What about: class vmwerver::vm { case $ensure { present: { create_vm { "$name": } } registered: { create_vm { "$name": } register_vm { "$name": require => Create_vm[$name] } } running: { create_vm { "$name": } register_vm { "$name": require => Create_vm[$name] } start_vm { "$name": require => Register_vm[$name] } } } } ? But be wary of bug #446, which was only fixed in the recently released 0.24 Regards, David - -- The primary freedom of open source is not the freedom from cost, but the free- dom to shape software to do what you want. This freedom is /never/ exercised without cost, but is available /at all/ only by accepting the very different costs associated with open source, costs not in money, but in time and effort. - -- http://www.schierer.org/~luke/log/20070710-1129/on-forks-and-forking -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHaquq/Pp1N6Uzh0URAqRNAJwK59ETYIqGPiBHFVuR3KZ0ZXjUBwCfcXG0 H3bG6yk7fwuIUUDlbzouunY=zOQz -----END PGP SIGNATURE----- _______________________________________________ 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
Luke Kanies
2007-Dec-20 22:59 UTC
Re: Fall through case statement (was: Complicated dependencies problem )
On Dec 20, 2007, at 1:42 PM, Eugene Ventimiglia wrote:> Open mouth - insert foot - echo globally > > But it does bring me to my next question: > > Can you have fall through conditions in a case statement, like: > > case $ensure { > present: > registered: > running: { > create_vm { "${name}": } > } > }Try this: case $ensure { present, registered: { ... } } -- It has recently been discovered that research causes cancer in labratory rats. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
It appears that facter is trying to reverse lookup a blank hostname, first in hosts, then the network which fails. If I force the hostname to localhost, it resolves through the hosts file and works normally. I''m trying to configure the hostname, IP, /etc/hosts, via puppet from install CD. Its a lovely chicken and egg issue that I have to have a resolvable hostname before I can configure the node. Thanks. On Thu, Dec 20, 2007 at 11:26:34AM -0600, Russell Adams wrote:> You''ve got a point. Its likely to be facter trying to determine the > hostname. > > How could I work around this? > > Thanks. > > On Thu, Dec 20, 2007 at 10:58:20AM -0600, Luke Kanies wrote: > > On Dec 20, 2007, at 2:38 AM, Russell Adams wrote: > > > > > I''m trying to run puppet on a node I''m cloning from CD. No IP, no DNS, > > > puppet with a standalone manifest and --use-nodes. > > > > > > I get dnsdomainname errors and a "Network is unreachable" error. I''m > > > using 0.20, but I checked for new options in 0.23 and didn''t see one > > > to turn off networking. > > > > > > Is this an option? > > > > No, but... Nothing should be using the network unless you tell it to, > > and certainly nothing in ''puppet'' should be doing so. > > > > Are you sure it''s puppet, or might it be facter? > > > > -- > > That was just a drill of the emergency y2k system. Had this been a > > real emergency, we would''ve also dumped a bucket of spiders on you and > > yelled out "civilization is collapsing!" > > --------------------------------------------------------------------- > > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > > > > _______________________________________________ > > Puppet-users mailing list > > Puppet-users@madstop.com > > https://mail.madstop.com/mailman/listinfo/puppet-users > > > ------------------------------------------------------------------ > Russell Adams RLAdams@AdamsInfoServ.com > > PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ > > Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3
On Dec 20, 2007, at 11:21 PM, Russell Adams wrote:> I''m trying to configure the hostname, IP, /etc/hosts, via puppet from > install CD. Its a lovely chicken and egg issue that I have to have a > resolvable hostname before I can configure the node.Are you getting actual failure, or just not the behaviour you want? You don''t actually have to key off hostname in Puppet; just don''t use nodes at all. It might also work to set an unconfigured hostname in an environment variable: FACTER_HOSTNAME=unconfigured facter It doesn''t override values that you retrieve normally, but it might get you a value that you otherwise wouldn''t. If you just can''t get it to work, though, file it as a bug, as I''d consider this a good use of Puppet and it should work. -- The leader of Jamestown was "John Smith" (not his real name), under whose direction the colony engaged in a number of activities, primarily related to starving. -- Dave Barry, "Dave Barry Slept Here" --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On Fri, Dec 21, 2007 at 10:19:29AM -0600, Luke Kanies wrote:> On Dec 20, 2007, at 11:21 PM, Russell Adams wrote: > > > I''m trying to configure the hostname, IP, /etc/hosts, via puppet from > > install CD. Its a lovely chicken and egg issue that I have to have a > > resolvable hostname before I can configure the node. > > Are you getting actual failure, or just not the behaviour you want? >Puppet dies when the hostname cannot be resolved. Its facter trying to isolate the hostname.> You don''t actually have to key off hostname in Puppet; just don''t use > nodes at all.I''m using the default nodename, but as I understood it I have to use --use-nodes if I refer to nodes at all, even the default.> It might also work to set an unconfigured hostname in an environment > variable: > > FACTER_HOSTNAME=unconfigured facterThis didn''t work in 0.20, I''ll have to try it in 0.23.2 shortly.> It doesn''t override values that you retrieve normally, but it might > get you a value that you otherwise wouldn''t. > > If you just can''t get it to work, though, file it as a bug, as I''d > consider this a good use of Puppet and it should work.Setting the hostname to localhost, which resolves to /etc/hosts, solves the problem. Originally there was no hostname when installing from CD, I''ll override that. Thanks. ------------------------------------------------------------------ Russell Adams RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3
On Dec 21, 2007, at 11:12 AM, Russell Adams wrote:> Puppet dies when the hostname cannot be resolved. Its facter trying to > isolate the hostname.Do you know if it''s a Puppet exception or Facter?>> You don''t actually have to key off hostname in Puppet; just don''t use >> nodes at all. > > I''m using the default nodename, but as I understood it I have to use > --use-nodes if I refer to nodes at all, even the default.True until 0.24. The latest release uses nodes if they''re present but not otherwise.>> It might also work to set an unconfigured hostname in an environment >> variable: >> >> FACTER_HOSTNAME=unconfigured facter > > This didn''t work in 0.20, I''ll have to try it in 0.23.2 shortly.It''s actually a Facter feature, not Puppet.>> It doesn''t override values that you retrieve normally, but it might >> get you a value that you otherwise wouldn''t. >> >> If you just can''t get it to work, though, file it as a bug, as I''d >> consider this a good use of Puppet and it should work. > > Setting the hostname to localhost, which resolves to /etc/hosts, > solves the problem. Originally there was no hostname when installing > from CD, I''ll override that.Okay. -- Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. -- Susan Ertz --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com