Set become method via variable
infra/host-provisioner/pipeline/head This commit looks good Details

It seems like setting the `ansible_become_method` variable as a group
variable overrides the `--become-method` CLI argument.  If we set the
variable on the command line, that _should_ take precedence.
Dustin 2025-07-08 20:42:56 -05:00
parent d860a25986
commit d1692f0d52
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ def amqp_connect() -> pika.BlockingConnection:
def apply_playbook(*args: str) -> None:
cmd = ['ansible-playbook', '-u', 'root', '--become-method', 'su']
cmd = ['ansible-playbook', '-u', 'root', '-e', 'ansible_become_method', 'su']
cmd += args
log.debug('Running command: %s', cmd)
subprocess.run(cmd, check=True, stdin=subprocess.DEVNULL)