Hi All, I asked on IRC but didn''t have everything organized and most people seemed busy. Hoping someone can see what I''m missing here. I''m trying to create a network module, used similar to the ''users'' configuration described in the Best Practices document. I have a users module which has that and it works with similar syntax to below. If I "unvirtualize" the network_interface for test1a-eth1 under the network_dmz_virt class, this works. Please help. Let me know if I need to provide more information. Node information is set up per the Best Practices, in nodes.pp and templates.pp respectively. The other manifests are in modules/network/manifests/(classes|definitions). test1a:~ $ sudo puppetd --server 10.1.0.70 --test notice: Ignoring cache err: Could not retrieve configuration: Failed to find virtual resources Network_interface[test1a-eth1] warning: Not using cache on failed configuration node test1a inherits test_server { realize Network_interface["test1a-eth1"] } node test_server inherits basenode { include network_dmz_virt } (all basenode classes are working) class network_dmz_virt { $domain = "mydomain.com" $broadcast = "10.1.0.255" $network = "10.1.0.0" $netmask = "255.255.255.0" $gateway = "10.1.0.1" @network_interface { "test1a-eth1": hostname => "test1a", iface => "eth1", ip => "10.1.0.5", domain => $domain, broadcast => $broadcast, network => $network, netmask => $netmask, gateway => $gateway, } } define network_interface ( $hostname, $iface, $ip, $domain, $broadcast, $network, $netmask, $gateway) { file { "/etc/sysconfig/network-scripts/ifcfg-$iface": owner => root, group => root, mode => 644, content => template("network/ifcfg.erb"), } file { "/etc/sysconfig/network": owner => root, group => root, mode => 644, content => template("network/network.erb"), } }
On Aug 22, 2007, at 6:44 PM, Joshua Timberman wrote:> est1a:~ > $ sudo puppetd --server 10.1.0.70 --test > notice: Ignoring cache > err: Could not retrieve configuration: Failed to find virtual > resources Network_interface[test1a-eth1] > warning: Not using cache on failed configurationYou sure you''re including the network_dmz_virt class? You''re example code only defines it, it doesn''t actually include it anywhere. -- The brain is a wonderful organ. It starts working the moment you get up in the morning and does not stop until you get into the office. --Robert Frost --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On 8/22/07, Luke Kanies <luke@madstop.com> wrote:> You sure you''re including the network_dmz_virt class? You''re example > code only defines it, it doesn''t actually include it anywhere.Yes: node test1a inherits test_server { realize Network_interface["test1a-eth1"] } node test_server inherits basenode { include network_dmz_virt } The host is test1a, so it gets "test_server" which includes "network_dmz_virt".
On Aug 22, 2007, at 7:22 PM, Joshua Timberman wrote:> > Yes: > > node test1a inherits test_server { > realize Network_interface["test1a-eth1"] > } > > node test_server inherits basenode { > include network_dmz_virt > } > > The host is test1a, so it gets "test_server" which includes > "network_dmz_virt".Sorry, I missed that somehow. I can''t reproduce your problem. Here''s my test code: define yay { notify { "Testing $name": } } class collection { @yay { funtest: } } node basenode { } node testnode inherits basenode { include collection } node phage inherits testnode And here''s how I ran it: test.pp --use-nodes On, of course, a machine named phage. Here''s the output: notice: Testing funtest So it''s not a general problem, which implies there''s something special about what you''re doing that is maybe not visible in the example code you sent. Otherwise, there''s something especially weird going on. If this is still a test implementation, see how small you can reduce the running configuration to (by not importing/including other classes or something) and still reproduce the error. Either way it sounds like Puppet should be more helpful about finding the problem. -- The death rate on Earth is: .... (computing) .... One per person. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On 8/22/07, Luke Kanies <luke@madstop.com> wrote:> So it''s not a general problem, which implies there''s something > special about what you''re doing that is maybe not visible in the > example code you sent.Its something in the users module. I comment those includes out from basenode and it runs normally. From basenode: include users_all_virt, users_noc From the users module: class users_noc inherits users_all_virt { realize ( Users_account["user1"], Users_account["user2"], Users_account["admin1"], Users_account["admin2"], Users_account["admin3"], ) } class users_all_virt { $homefs = "/home" file { $homefs: ensure => directory, owner => "root", group => "root", mode => 2755 } @users_account { "user1": ensure => "present", uid => "500", pgroup => "users", groups => ["users"], fullname => "User One", homefs => $homefs, shell => "/bin/bash", } } Repeat for the other users defined with differing uids. And the define for the users_account: define users_account ( $ensure, $uid, $pgroup, $groups, $fullname, $homefs, $shell ) { # This case component will allow us to avoid a dependency when/if we attempt # to disable the account by passing ensure => absent case $ensure { present: { $home_owner = $name $home_group = $pgroup } default: { $home_owner = "root" $home_group = "root" } } user { $name: ensure => $ensure, uid => $uid, gid => $pgroup, groups => $groups, comment => $fullname, home => "${homefs}/$name", shell => $shell, allowdupe => false, #require => Group[$pgroup] # seems to be broken for some reason. } file { "${homefs}/$name": ensure => directory, owner => $home_owner, group => $home_group, mode => 750, require => User[$name], } file { "${homefs}/$name/.ssh": ensure => directory, owner => $home_owner, group => $home_group, mode => 700, require => File["${homefs}/$name"], } file { "${homefs}/$name/.ssh/authorized_keys": ensure => present, owner => $home_owner, group => $home_group, mode => 600, require => File["${homefs}/$name/.ssh"], source => "puppet://10.1.0.70/users/authorized_keys_$name" } file { "${homefs}/$name/.ssh/authorized_keys2": ensure => "${homefs}/$name/.ssh/authorized_keys", owner => $home_owner, group => $home_group, require => File["${homefs}/$name/.ssh/authorized_keys"], } file { "${homefs}/$name/.bashrc": ensure => present, owner => $home_owner, group => $home_group, mode => 640, require => File["${homefs}/$name"], source => "puppet://10.1.0.70/users/bashrc_$name", } file { "${homefs}/$name/.bash_profile": ensure => "${homefs}/$name/.bashrc", owner => $home_owner, group => $home_group, require => File["${homefs}/$name/.bashrc"], } }> Either way it sounds like Puppet should be more helpful about finding > the problem.I concur. You might have missed the IRC chatter when I was having issue with getting the config off the server. Misplaced commas were causing the problem, but puppet was merely throwing a warning that the local cache would be used. Maybe gepetto knows the pastie?
On Aug 22, 2007, at 8:16 PM, Joshua Timberman wrote:> I concur. You might have missed the IRC chatter when I was having > issue with getting the config off the server. Misplaced commas were > causing the problem, but puppet was merely throwing a warning that the > local cache would be used. Maybe gepetto knows the pastie?Huh, I can''t see anything in there that''s even related to the network interface stuff, so I''m quite confused. I did see that the chatter was happening, but I was not able to read any of it, and I don''t have time right now to go through my backlog and read through it. There''s something we''re not seeing here, something that''s coupling the user and network interface stuff. Are you looking at the server- side errors? Maybe there''s something happening on the server that you''re not noticing. -- It is better to sleep on things beforehand than lie awake about them afterward. -- Baltasar Gracian --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On 8/22/07, Joshua Timberman <joshua.timberman@gmail.com> wrote:> Its something in the users module. I comment those includes out from > basenode and it runs normally. From basenode:Actually, it might be the realize function...? This works: include users_all_virt include network_dmz_virt realize ( Users_account["user1"], Users_account["user2"], Users_account["admin1"], Users_account["admin2"], Users_account["admin3"], Network_interface["test1a-eth1"] ) But this didn''t: include users_all_virt include network_dmz_virt realize ( Users_account["user1"], Users_account["user2"], Users_account["admin1"], Users_account["admin2"], Users_account["admin3"] ) realize ( Network_interface["test1a-eth1"] ) Can I not make two calls to realize? Is this a bug? Or am I doing something wrong? I''d share my manifests but I''ve already pasted most of it, and following the ''best practices'' means there''s a ton of files all over... I hope that I''m doing something wrong, because I''d really like to implement the network config for our environment with virtual resources, since we''ll have four different subnets...
On Aug 22, 2007, at 11:36 PM, Joshua Timberman wrote:> Actually, it might be the realize function...?I''m in the middle of development, so I don''t have a clean checkout with which to test nor the time to do so, but could you modify the test I posted yesterday to do multiple calls to ''realize'' and see if that works? -- Tobacco stocks have taken a big tumble," says Jay Leno. "Phillip Morris fell 6 points. They lost so much money they may have to lay off two senators." --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On 8/23/07, Luke Kanies <luke@madstop.com> wrote:> I''m in the middle of development, so I don''t have a clean checkout > with which to test nor the time to do so, but could you modify the > test I posted yesterday to do multiple calls to ''realize'' and see if > that works?Well, I did the test using my config. Here''s the manifest. Note that the ''users'' module has not changed and works successful, so I didn''t paste everything from it, just the import. This part does not work: http://pastie.caboo.se/90389 $ sudo puppetd --server 10.1.0.70 --test notice: Ignoring cache err: Could not retrieve configuration: Failed to find virtual resources Network_interface[test1a-eth1] warning: Not using cache on failed configuration But this does: http://pastie.caboo.se/90390 $ sudo puppetd --server 10.1.0.70 --test notice: Ignoring cache info: Caching configuration at /var/lib/puppet/localconfig.yaml notice: Starting configuration run notice: Finished configuration run in 1.40 seconds Likewise, using your test manifest, this doesn''t work: http://pastie.caboo.se/90393 But this does: http://pastie.caboo.se/90395
On Thu, Aug 23, 2007 at 10:41:25AM -0500, Luke Kanies wrote:> On Aug 22, 2007, at 11:36 PM, Joshua Timberman wrote: > > > Actually, it might be the realize function...? > > I''m in the middle of development, so I don''t have a clean checkout > with which to test/me looks pointedly at the git repo Surely you can branch at a known clean point and check that out, even if you''ve started work somewhere? (Not taking into account the time issue, of course) - Matt -- English is about as pure as a cribhouse whore. We don''t just borrow words; on occasion, English has pursued other languages down alleyways to beat them unconscious and rifle their pockets for new vocabulary." -- James D. Nicoll, resident of rec.arts.sf.written
On Aug 23, 2007, at 2:30 PM, Matthew Palmer wrote:> /me looks pointedly at the git repo > > Surely you can branch at a known clean point and check that out, > even if > you''ve started work somewhere?Once everything''s committed, it''s easy to switch branches, but otherwise you''re making another clone. And it''s more about the time/brain than the code. -- Zeilinger''s Fundamental Law: There is no Fundamental Law. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On 8/23/07, Joshua Timberman <joshua.timberman@gmail.com> wrote:> Likewise, using your test manifest, this doesn''t work:So bottom line - did I find a potential bug that should be reported? Or am I doing something wrong?
On Aug 23, 2007, at 4:37 PM, Joshua Timberman wrote:> So bottom line - did I find a potential bug that should be reported? > Or am I doing something wrong?At this point it looks like a bug, so please file it, and please attach the simple-case example code (i.e., the one derived from my example, since it''s stand-alone). -- It''s not that I''m afraid to die. I just don''t want to be there when it happens. -- Woody Allen --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com