Set become method to su
infra/host-provisioner/pipeline/head This commit looks good
Details
infra/host-provisioner/pipeline/head This commit looks good
Details
Since the host-provisioner connects to remote machines as _root_, it normally doesn't use Ansible's "become" system at all. Some tasks, though, need to to use it to switch to a specific unprivileged user. For those, `doas` is not appropriate, since it doesn't permit root by default. Rather than adjust this configuration, let's switch to `su` which requires no configuration, and does allow root.master
parent
2500dc511d
commit
d860a25986
|
@ -63,7 +63,7 @@ def amqp_connect() -> pika.BlockingConnection:
|
|||
|
||||
|
||||
def apply_playbook(*args: str) -> None:
|
||||
cmd = ['ansible-playbook', '-u', 'root']
|
||||
cmd = ['ansible-playbook', '-u', 'root', '--become-method', 'su']
|
||||
cmd += args
|
||||
log.debug('Running command: %s', cmd)
|
||||
subprocess.run(cmd, check=True, stdin=subprocess.DEVNULL)
|
||||
|
|
Loading…
Reference in New Issue