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
|
import json
|
||||||
|
|
||||||
def runAnsiblePlaybook(config, key):
|
def runAnsiblePlaybook(config, key):
|
||||||
if config['ansiblemenu'][key]['extra_vars'] is None:
|
if 'extra_vars' in config['ansiblemenu'][key]:
|
||||||
subprocess.check_call(['ansible-playbook', config['ansiblemenu'][key]['playbook']], cwd=config['base_path'])
|
|
||||||
else:
|
|
||||||
subprocess.check_call(['ansible-playbook', config['ansiblemenu'][key]['playbook'],
|
subprocess.check_call(['ansible-playbook', config['ansiblemenu'][key]['playbook'],
|
||||||
'--extra-vars', json.dumps(config['ansiblemenu'][key]['extra_vars']) ],
|
'--extra-vars', json.dumps(config['ansiblemenu'][key]['extra_vars']) ],
|
||||||
cwd=config['base_path'])
|
cwd=config['base_path'])
|
||||||
|
else:
|
||||||
|
subprocess.check_call(['ansible-playbook', config['ansiblemenu'][key]['playbook']], cwd=config['base_path'])
|
||||||
|
|
||||||
def pullAnsiblePlaybook(url, playbook):
|
def pullAnsiblePlaybook(url, playbook):
|
||||||
subprocess.check_call(['ansible-pull', '-U', url, playbook])
|
subprocess.check_call(['ansible-pull', '-U', url, playbook])
|
||||||
|
|
Loading…
Reference in a new issue