Created
March 19, 2011 10:20
-
-
Save jooooooon/877378 to your computer and use it in GitHub Desktop.
resolv_conf_example_template
This file contains 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
body common control { | |
bundlesequence => { "set_dns_configuration" } ; | |
} | |
####################################################################### | |
# Configure DNS | |
# Use Google's DNS servers, and set the defaut domain to normation.com | |
####################################################################### | |
bundle agent set_dns_configuration { | |
vars: | |
"resolvers" string => "8.8.8.8"; | |
"searchlist" string => "normation.com"; | |
files: | |
"$(sys.resolv)" | |
create => "true", | |
edit_defaults => empty, | |
edit_line => expand_template("myTemplate.tml"), | |
comment => "Configuring the resolv.conf file"; | |
} | |
####################################################### | |
# Replace the content of a file by the content of the | |
# template, with the expanded variables | |
####################################################### | |
bundle edit_line expand_template(templatefile) { | |
insert_lines: | |
"$(templatefile)" | |
insert_type => "file", | |
expand_scalars => "true"; | |
} | |
# This body comes from the cfengine_stdlib.cf | |
body edit_defaults empty { | |
empty_file_before_editing => "true"; | |
edit_backup => "false"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment