IBP: ubuntu: moved resolv.conf stuff to boothook

The issue is that cloudinit/cc_resolv_conf.py is not working at all.
For both centos and ubuntu resolv.conf editing was moved to
cloud-init boothook stage. cloud-init will recreate resolv.conf on
every boot.

Closes-Bug: 1416399
Change-Id: I3d6fdd15ea279928d39f5e6ce4136372db3172c5
This commit is contained in:
Vladimir Kozhukalov 2015-02-03 17:59:15 +03:00 committed by Alexander Gordeev
parent 2bd5e4468c
commit 662919e3af
4 changed files with 25 additions and 20 deletions

View File

@ -42,6 +42,14 @@ cloud-init-per instance udev_persistent_net5 service network start
# end of udev
#FIXME(agordeev): if operator updates dns settings on masternode after the node had been provisioned,
# cloud-init will start to generate resolv.conf with non-actual data
cloud-init-per always resolv_conf_remove rm -f /etc/resolv.conf
cloud-init-per always resolv_conf_header echo "# re-generated by cloud-init boothook on every boot;" | tee /etc/resolv.conf
cloud-init-per always resolv_conf_search echo "search {{ common.search_domain|replace('"','') }}" | tee -a /etc/resolv.conf
cloud-init-per always resolv_conf_domain echo "domain {{ common.search_domain|replace('"','') }}" | tee -a /etc/resolv.conf
cloud-init-per always resolv_conf_nameserver echo nameserver {{ common.master_ip|replace('"','') }} | tee -a /etc/resolv.conf
# configure black module lists
# virt-what should be installed
if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then

View File

@ -38,6 +38,23 @@ cloud-init-per instance udev_persistent_net5 /etc/init.d/networking start
# end of udev
#FIXME(agordeev): if operator updates dns settings on masternode after the node had been provisioned,
# cloud-init will start to generate resolv.conf with non-actual data
cloud-init-per always resolv_conf_mkdir mkdir -p /etc/resolvconf/resolv.conf.d
cloud-init-per always resolv_conf_remove rm -f /etc/resolv.conf
cloud-init-per always resolv_conf_head_remove rm -f /etc/resolvconf/resolv.conf.d/head
cloud-init-per always resolv_conf_header echo "# re-generated by cloud-init boothook on every boot;" | tee /etc/resolv.conf
cloud-init-per always resolv_conf_search echo "search {{ common.search_domain|replace('"','') }}" | tee -a /etc/resolv.conf
cloud-init-per always resolv_conf_domain echo "domain {{ common.search_domain|replace('"','') }}" | tee -a /etc/resolv.conf
cloud-init-per always resolv_conf_head_header echo "# re-generated by cloud-init boothook on every boot;" | tee /etc/resolvconf/resolv.conf.d/head
cloud-init-per always resolv_conf_head_search echo "search {{ common.search_domain|replace('"','') }}" | tee -a /etc/resolvconf/resolv.conf.d/head
cloud-init-per always resolv_conf_head_domain echo "domain {{ common.search_domain|replace('"','') }}" | tee -a /etc/resolvconf/resolv.conf.d/head
cloud-init-per always resolv_conf_tail_remove rm -f /etc/resovlconf/resolv.conf.d/tail
cloud-init-per always resolv_conf_original_remove rm -f /etc/resovlconf/resolv.conf.d/original
cloud-init-per always resolv_conf_nameserver echo nameserver {{ common.master_ip|replace('"','') }} | tee -a /etc/resolv.conf
cloud-init-per always resolv_conf_head_nameserver echo nameserver {{ common.master_ip|replace('"','') }} | tee -a /etc/resolvconf/resolv.conf.d/head
cloud-init-per always resolv_conf_cp_original cp /etc/resolv.conf /etc/resolvconf/resolv.conf.d/original
# configure black module lists
# virt-what should be installed
if [ ! -f /etc/modprobe.d/blacklist-i2c_piix4.conf ]; then

View File

@ -23,16 +23,6 @@ timezone: {{ common.timezone }}
hostname: {{ common.hostname }}
fqdn: {{ common.fqdn }}
# TODO(kozhukalov) name_servers is set as "1.2.3.4,1.2.3.5"
resolv_conf:
nameservers: [ {{ common.name_servers }} ]
searchdomains:
- {{ common.search_domain }}
# domain: {{ domain }}
# options:
# rotate: true
# timeout: 1
# add entries to rsyslog configuration
rsyslog:
- filename: 10-log2master.conf

View File

@ -22,16 +22,6 @@ timezone: {{ common.timezone }}
hostname: {{ common.hostname }}
fqdn: {{ common.fqdn }}
# TODO(kozhukalov) name_servers is set as "1.2.3.4,1.2.3.5"
resolv_conf:
nameservers: [ {{ common.name_servers }} ]
searchdomains:
- {{ common.search_domain }}
# domain: {{ domain }}
# options:
# rotate: true
# timeout: 1
# add entries to rsyslog configuration
rsyslog: