mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Replace resolv.conf if nameserver is 127.0.0.1
Debian OpenStack images has resolv.conf with "nameserver 127.0.0.1". If not overwritten minion seeding will fail (after a long period of time - network timeout) as no name lookups can be made. Upon VM boot DHCP settings will overwrite resolv.conf again.
This commit is contained in:
parent
9cb6ac3be0
commit
ae1359eb14
@ -278,6 +278,8 @@ def _check_resolv(mpt):
|
||||
conts = fp_.read()
|
||||
if 'nameserver' not in conts:
|
||||
replace = True
|
||||
if 'nameserver 127.0.0.1' in conts:
|
||||
replace = True
|
||||
if replace:
|
||||
shutil.copy('/etc/resolv.conf', resolv)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user