extra_vars pour firstboot

This commit is contained in:
Navas 2024-10-19 15:43:10 +02:00
parent 60031d72cd
commit dba429c1c6

View file

@ -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])