Created
April 23, 2012 14:59
-
-
Save zzamboni/2471468 to your computer and use it in GitHub Desktop.
Examples of methods: calls from http://blog.cf-learn.info/cfengine-tip-001-modularize-complex-policies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bundle agent configfiles | |
| { | |
| vars: | |
| # Files to edit | |
| "files[sysctlconf]" string => "/etc/sysctl.conf"; | |
| "files[sshdconfig]" string => "/etc/ssh/sshd_config"; | |
| "files[inittab]" string => "/etc/inittab"; | |
| # ... | |
| methods: | |
| # Pass the name of the array, not the array itself. | |
| "backup" usebundle => backup_files("configfiles.files"); | |
| "sysctl" usebundle => edit_sysctl; | |
| "sshd" usebundle => edit_sshd; | |
| "inittab" usebundle => edit_inittab; | |
| "users" usebundle => manage_users("configfiles.users"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bundle agent configfiles | |
| { | |
| vars: | |
| # Files to edit | |
| "files[sysctl]" string => "/etc/sysctl.conf"; | |
| "files[sshd]" string => "/etc/ssh/sshd_config"; | |
| "files[inittab]" string => "/etc/inittab"; | |
| # ... | |
| "file_id" slist => getindices("files"); | |
| "bundle_names" slist => maplist("edit_$(this)", "file_id"); | |
| methods: | |
| "backup" usebundle => backup_files("configfiles.files"); | |
| "$(bundle_names)" usebundle => $(bundle_names)("configfiles.files"); | |
| "users" usebundle => manage_users("configfiles.users"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment