I am probably confused on some of the cfengine vs puppet terminology.
Please excuse any bastardization of puppet terms and please correct me
if I am wrong.
I have cfengine working on different sets of machines and I am looking
at puppet at becoming a cfengine replacement.
In configuring & testing puppet, I have made it as far as enforcing
permissions on 1 file (/etc/sudoers) and copying down 1 file (/files/
etc/ntp.conf to /etc/ntp.conf).
I would now like to explore the ability to copy down files based on
the node's facts, specifically the 'operatingsystem',
'operatingsystemrelease', and 'domain' facts
For example, in our cfagent.conf file, we make user-defined classes of
machines by boolean AND/OR them together
------
RHEL4_DMZ = ( redhat_ws_4&192_168_142 )
RHEL5_THATORG = ( redhat_ws_5&subdomain_example_com )
------
Based on their membership in the classes, the clients copy down trees
of files from the cfengine master to the clientnode.
-----
copy:
${master_cfinput} server=${policyhost}
dest=${cfdir}/inputs recurse=inf
mode=700 type=binary trustkey=true encrypt=true
# Global files for RHEL4_DMZ
RHEL4_ACF::
/var/cfengine/masterfiles/redhat_ws_4-DMZ/ server=${policyhost}
dest=/
exclude=*~ recurse=inf encrypt=true trustkey=true
backup=true
# Global files for RHEL5_THATORG
RHEL4_THISORG::
/var/cfengine/masterfiles/redhat_ws_5-THATORG/ server=$
{policyhost} dest=/
exclude=*~ recurse=inf encrypt=true trustkey=true backup=true
-----
I can't quite wrap my mind around how this is done in puppet? Do I
have to add my own user-created fact to facter?
Or is this done with if-statements and boolean operators?
-----
if ( $operatingsystem == "RedHat" ) and ( $operatingsystemrelease ==
"5" ) and ( $domain == "subdomain.example.com" ) {
include copydown
}
OR
if ( $operatingsystem == "RedHat" ) and ( $operatingsystemrelease ==
"4" ) and ( $network_eth0 == "192.168.142.0" ) {
include copydown
}
-----
If those 'if-statements' are correct, then how would the file copy-
down portion be written?
Thanks in advance,
Jr Sock Puppet
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---