Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.