From 0ba1be56c8709cdd75ff5ac48326fea49c6b3de0 Mon Sep 17 00:00:00 2001 From: Andrew Grimberg Date: Wed, 9 Sep 2015 14:38:06 -0700 Subject: [PATCH] Fix resolver for EL7 systems EL7 systems were having issues with the resolv.conf not being created properly. Dropping resolv.conf and setting imutable causes problems for Fedora and Ubuntu systems so we needed to find a more consistent and safe alternative. Change-Id: I7c2904021721102d96bd4153233ce5122f573bc0 Signed-off-by: Andrew Grimberg --- vagrant/lf-networking/confignetwork.pp | 29 +++++++++++++++++++++++++- vagrant/lf-networking/system_reseal.sh | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/vagrant/lf-networking/confignetwork.pp b/vagrant/lf-networking/confignetwork.pp index 6e295e8ec..b6cdd8aac 100644 --- a/vagrant/lf-networking/confignetwork.pp +++ b/vagrant/lf-networking/confignetwork.pp @@ -76,12 +76,39 @@ options timeout:2 ", } -# set routing +file { '/etc/cloud/cloud.cfg.d/00_lf_resolv.cfg': + content => "#cloud-config + +manage_resolv_conf: true + +resolv_conf: + nameservers: ['127.0.0.1', '${ns1}', '${ns2}'] + searchdomains: + - ${::subdomain} + options: + timeout: 2 +", +} + +file_line { 'add_resolver': + path => '/etc/cloud/cloud.cfg.d/10_rackspace.cfg', + line => ' - resolv_conf', + after => ' - update_etc_hosts', +} + +# OS specific configuration case $::operatingsystem { 'CentOS', 'Fedora', 'RedHat': { file { '/etc/sysconfig/network-scripts/route-eth0': content => "default via ${router} dev eth0", } + + # disable the DNS peerage so that our resolv.conf doesn't + # get destroyed + file_line { 'disable_peerdns': + path => '/etc/sysconfig/network', + line => 'PEERDNS=no', + } } 'Ubuntu': { file { '/etc/network/if-up.d/0000routing': diff --git a/vagrant/lf-networking/system_reseal.sh b/vagrant/lf-networking/system_reseal.sh index 07a053177..87d60c305 100644 --- a/vagrant/lf-networking/system_reseal.sh +++ b/vagrant/lf-networking/system_reseal.sh @@ -12,7 +12,7 @@ if [ -f /.autorelabel ]; then fi # clean-up from any prior cloud-init networking -rm -rf /etc/sysconfig/network-scripts/{ifcfg,route}-eth* +rm -rf /etc/sysconfig/network-scripts/ifcfg-eth* rm -rf /etc/Pegasus/*.cnf /etc/Pegasus/*.crt /etc/Pegasus/*.csr /etc/Pegasus/*.pem /etc/Pegasus/*.srl /root/anaconda-ks.cfg /root/anaconda-post.log /root/initial-setup-ks.cfg /root/install.log /root/install.log.syslog /var/cache/fontconfig/* /var/cache/gdm/* /var/cache/man/* /var/lib/AccountService/users/* /var/lib/fprint/* /var/lib/logrotate.status /var/log/*.log* /var/log/BackupPC/LOG /var/log/ConsoleKit/* /var/log/anaconda.syslog /var/log/anaconda/* /var/log/apache2/*_log /var/log/apache2/*_log-* /var/log/apt/* /var/log/aptitude* /var/log/audit/* /var/log/btmp* /var/log/ceph/*.log /var/log/chrony/*.log /var/log/cron* /var/log/cups/*_log /var/log/debug* /var/log/dmesg* /var/log/exim4/* /var/log/faillog* /var/log/gdm/* /var/log/glusterfs/*glusterd.vol.log /var/log/glusterfs/glusterfs.log /var/log/httpd/*log /var/log/installer/* /var/log/jetty/jetty-console.log /var/log/journal/* /var/log/lastlog* /var/log/libvirt/libvirtd.log /var/log/libvirt/lxc/*.log /var/log/libvirt/qemu/*.log /var/log/libvirt/uml/*.log /var/log/lightdm/* /var/log/mail/* /var/log/maillog* /var/log/messages* /var/log/ntp /var/log/ntpstats/* /var/log/ppp/connect-errors /var/log/rhsm/* /var/log/sa/* /var/log/secure* /var/log/setroubleshoot/*.log /var/log/spooler* /var/log/squid/*.log /var/log/syslog* /var/log/tallylog* /var/log/tuned/tuned.log /var/log/wtmp* /var/named/data/named.run -- 2.36.6