Skip to content

Instantly share code, notes, and snippets.

@jooooooon
Created March 19, 2011 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jooooooon/877378 to your computer and use it in GitHub Desktop.
Save jooooooon/877378 to your computer and use it in GitHub Desktop.
resolv_conf_example_template
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