Created
March 19, 2011 10:24
-
-
Save jooooooon/877380 to your computer and use it in GitHub Desktop.
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" slist => { "8.8.8.8", "8.8.4.4" }; | |
"searchlist" slist => { "normation.com" }; | |
files: | |
"$(sys.resolv)" | |
create => "true", | |
edit_line => doresolv("@(this.searchlist)","@(this.resolvers)"), | |
comment => "Configuring the searchlist and dns in the resolv.conf file "; | |
} | |
####################################################### | |
# Configure the resolv.conf file | |
# Setting the search and nameserver values | |
# Adding a header to tell the file is configured by Cfengine | |
####################################################### | |
bundle edit_line doresolv(search,resolvers) { | |
delete_lines: | |
"search.*"; | |
"nameserver.*"; | |
insert_lines: | |
"############################################################# | |
### This file is configured by Cfengine. | |
### Manually editing the file might lead Cfengine | |
### to change back its content | |
#############################################################" | |
location => start, | |
insert_type => "preserve_block"; | |
"search $(search)"; | |
"nameserver $(resolvers)"; | |
} | |
# This body comes from the cfengine_stdlib.cf | |
body location start { | |
before_after => "before"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment