Set become method to su
All checks were successful
infra/host-provisioner/pipeline/head This commit looks good
All checks were successful
infra/host-provisioner/pipeline/head This commit looks good
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user