Add /etc/hosts and /etc/nsswitch.conf to the bubblewrap
This change adds dns resolution helpers to the bubblewrap so that hosts locally defined are resolvable in executor playbooks. Change-Id: I5efad8749ff25cdbe6a142f9616422d96b7bbf33
This commit is contained in:
parent
e391ec8df8
commit
a19e8c57c7
|
@ -150,6 +150,7 @@ class BubblewrapDriver(Driver, WrapperInterface):
|
|||
'--ro-bind', '/bin', '/bin',
|
||||
'--ro-bind', '/sbin', '/sbin',
|
||||
'--ro-bind', '/etc/resolv.conf', '/etc/resolv.conf',
|
||||
'--ro-bind', '/etc/hosts', '/etc/hosts',
|
||||
'--ro-bind', '{ssh_auth_sock}', '{ssh_auth_sock}',
|
||||
'--dir', '{work_dir}',
|
||||
'--bind', '{work_dir}', '{work_dir}',
|
||||
|
@ -166,6 +167,9 @@ class BubblewrapDriver(Driver, WrapperInterface):
|
|||
|
||||
if os.path.isdir('/lib64'):
|
||||
bwrap_command.extend(['--ro-bind', '/lib64', '/lib64'])
|
||||
if os.path.isfile('/etc/nsswitch.conf'):
|
||||
bwrap_command.extend(['--ro-bind', '/etc/nsswitch.conf',
|
||||
'/etc/nsswitch.conf'])
|
||||
|
||||
return bwrap_command
|
||||
|
||||
|
|
Loading…
Reference in New Issue