/usr/local/bin/cache-prep-commands.sh failing to write to /etc/resolv.conf when resolvconf used on Xenial
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack-Ansible |
Fix Released
|
Critical
|
Jesse Pretorius |
Bug Description
OS: Ubuntu 16.04.4
OpenStack-Ansible: 16.0.10 and 16.0.12 [not tried others]
As part of setup-hosts.yml, /usr/local/
TASK [lxc_hosts : Ensure that the LXC cache has been prepared] *****************
Wednesday 02 May 2018 15:10:40 +0000 (0:00:00.347) 0:01:07.539 *********
fatal: [controller-01]: FAILED! => {“ansible_job_id”: “429901853940.
This leads to this log:
cat /var/log/
+ mkdir -p /etc/ansible/
+ '[' -a /etc/resolv.conf ']'
+ echo 'nameserver 10.0.3.1'
The problem appears to be caused by resolvconf's symlink from /etc/resolv.conf to the relative symlink target of ../run/
chroot /var/lib/
Outside of the chroot, /etc/resolv.conf correctly points to /run/resolvconf
However, inside the chroot, the run/ dir is empty... This has the effect of the fact that the bash test for the file existing is true, because it finds the file [really the actual symlink], so this then satisfies that test. However, when it comes to echoing the nameserver, that echo wants to follow the result of the symlink... so /etc/resolv.conf -> ../run/
Changed in openstack-ansible: | |
importance: | Undecided → Critical |
status: | New → Fix Committed |
Changed in openstack-ansible: | |
assignee: | nobody → Jesse Pretorius (jesse-pretorius) |
Changed in openstack-ansible: | |
status: | Fix Committed → Fix Released |
Same for me with 16.0.12. I don't remember this happened in older releases.