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 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

View file

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