ansible hosts -> groups

This commit is contained in:
Anders Ingemann 2017-07-14 19:46:35 +02:00
parent 18fb853b48
commit 84db19605a
No known key found for this signature in database
GPG key ID: 49C87973A14931A9
2 changed files with 5 additions and 4 deletions

View file

@ -22,7 +22,7 @@ properties:
type: array
flag: {type: string}
minItems: 1
hosts:
groups:
type: array
host: {type: string}
minItems: 1

View file

@ -14,6 +14,7 @@ class AddRequiredCommands(Task):
def run(cls, info):
info.host_dependencies['ansible'] = 'ansible'
class CheckPlaybookPath(Task):
description = 'Checking whether the playbook path exist'
phase = phases.validation
@ -56,9 +57,9 @@ class RunAnsiblePlaybook(Task):
conn = '{} ansible_connection=chroot'.format(info.root)
content = ""
if 'hosts' in info.manifest.plugins['ansible']['hosts']:
for host in info.manifest.plugins['ansible']['hosts']:
content += '[{}]\n{}\n'.format(host, conn)
if 'groups' in info.manifest.plugins['ansible']:
for group in info.manifest.plugins['ansible']['groups']:
content += '[{}]\n{}\n'.format(group, conn)
else:
content = conn