From dba429c1c6b4e6de5fd1620245603d15d69b2758 Mon Sep 17 00:00:00 2001 From: Olivier Date: Sat, 19 Oct 2024 15:43:10 +0200 Subject: [PATCH] extra_vars pour firstboot --- linuxinstaller/AnsibleActions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linuxinstaller/AnsibleActions.py b/linuxinstaller/AnsibleActions.py index 19485c2..b9d3f46 100644 --- a/linuxinstaller/AnsibleActions.py +++ b/linuxinstaller/AnsibleActions.py @@ -2,12 +2,12 @@ import subprocess import json def runAnsiblePlaybook(config, key): - if config['ansiblemenu'][key]['extra_vars'] is None: - subprocess.check_call(['ansible-playbook', config['ansiblemenu'][key]['playbook']], cwd=config['base_path']) - else: + if 'extra_vars' in config['ansiblemenu'][key]: subprocess.check_call(['ansible-playbook', config['ansiblemenu'][key]['playbook'], '--extra-vars', json.dumps(config['ansiblemenu'][key]['extra_vars']) ], cwd=config['base_path']) + else: + subprocess.check_call(['ansible-playbook', config['ansiblemenu'][key]['playbook']], cwd=config['base_path']) def pullAnsiblePlaybook(url, playbook): subprocess.check_call(['ansible-pull', '-U', url, playbook])