mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
ansible hosts -> groups
This commit is contained in:
parent
18fb853b48
commit
84db19605a
2 changed files with 5 additions and 4 deletions
|
@ -22,7 +22,7 @@ properties:
|
||||||
type: array
|
type: array
|
||||||
flag: {type: string}
|
flag: {type: string}
|
||||||
minItems: 1
|
minItems: 1
|
||||||
hosts:
|
groups:
|
||||||
type: array
|
type: array
|
||||||
host: {type: string}
|
host: {type: string}
|
||||||
minItems: 1
|
minItems: 1
|
||||||
|
|
|
@ -14,6 +14,7 @@ class AddRequiredCommands(Task):
|
||||||
def run(cls, info):
|
def run(cls, info):
|
||||||
info.host_dependencies['ansible'] = 'ansible'
|
info.host_dependencies['ansible'] = 'ansible'
|
||||||
|
|
||||||
|
|
||||||
class CheckPlaybookPath(Task):
|
class CheckPlaybookPath(Task):
|
||||||
description = 'Checking whether the playbook path exist'
|
description = 'Checking whether the playbook path exist'
|
||||||
phase = phases.validation
|
phase = phases.validation
|
||||||
|
@ -56,9 +57,9 @@ class RunAnsiblePlaybook(Task):
|
||||||
conn = '{} ansible_connection=chroot'.format(info.root)
|
conn = '{} ansible_connection=chroot'.format(info.root)
|
||||||
content = ""
|
content = ""
|
||||||
|
|
||||||
if 'hosts' in info.manifest.plugins['ansible']['hosts']:
|
if 'groups' in info.manifest.plugins['ansible']:
|
||||||
for host in info.manifest.plugins['ansible']['hosts']:
|
for group in info.manifest.plugins['ansible']['groups']:
|
||||||
content += '[{}]\n{}\n'.format(host, conn)
|
content += '[{}]\n{}\n'.format(group, conn)
|
||||||
else:
|
else:
|
||||||
content = conn
|
content = conn
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue