Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm learning puppet and am going over a module. To use the module I have to put these lines of code in my nodes.pp file:

node server1 {
    include network
    network::bond::static { "bond0":
              ipaddress    => "192.168.1.5",
              netmask      => "255.255.255.0",
              gateway      => "192.168.1.1",
              mtu          => "9000",
              bonding_opts => "mode=active-backup miimon=100",
              bond_slave0  => "eth0",
              ensure       => "up",
    }
}

While looking at the code for the module I see that everything in /etc/puppet/modules/network/manifests/init.pp is run every time this host has a puppet client run. What I don't understand is that they have a file called manifests/bond/static.pp, which is what is called every time you want to set up a bonded interface. I can see that in init.pp there is no call to manifests/bond/static.pp, so how is this file called? To me it looks like the static.pp file is called by the line "network::bond::static", which is declared in my nodes.pp, if that is the case what exactly is this type of call as I can't see a class by the name static in the manifests/bond/static.pp file? What does the line "network::bond::static" mean?

Thanks in advance Dan

share|improve this question
    
network/manifests/bond/static.pp = network::bond::static if you were to edit the static.pp file you'll see that it's a 'class' or 'define' requiring the arguments to tell puppet to create the bond0 interface. –  Danie Feb 7 '13 at 8:23
    
Great thanks. but how does the flow work, do init.pp and static.pp get run at the same time or does init.pp run first then it signals back it's finished and the puppet runs static.pp? –  Dan Feb 7 '13 at 10:43
    
When you include network, it means it can then inherit all the commands and definitions associated with the class network. You need to view the init.pp and see what it does. Normally init.pp is just used to define a new class type. Perhaps you should work through their tutorials as the learning curve is not that steep. You will on the other hand need to wrap your head around objects and inheritance. Once you worked through the basic puppet tutorial you will understand init.pp and how a module layout should look like in it's basic form. –  Danie Feb 7 '13 at 11:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.