extra_vars pour firstboot
This commit is contained in:
parent
60031d72cd
commit
dba429c1c6
1 changed files with 3 additions and 3 deletions
|
@ -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])
|
||||
|
|
Loading…
Reference in a new issue