diff --git a/bootstrapvz/plugins/ansible/manifest-schema.yml b/bootstrapvz/plugins/ansible/manifest-schema.yml index 1ff99ce..d6cc9c4 100644 --- a/bootstrapvz/plugins/ansible/manifest-schema.yml +++ b/bootstrapvz/plugins/ansible/manifest-schema.yml @@ -22,7 +22,7 @@ properties: type: array flag: {type: string} minItems: 1 - hosts: + groups: type: array host: {type: string} minItems: 1 diff --git a/bootstrapvz/plugins/ansible/tasks.py b/bootstrapvz/plugins/ansible/tasks.py index 8509fa1..979488c 100644 --- a/bootstrapvz/plugins/ansible/tasks.py +++ b/bootstrapvz/plugins/ansible/tasks.py @@ -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