Skip to content

Instantly share code, notes, and snippets.

@michaelkebe
Last active June 5, 2020 14:06
Show Gist options
  • Save michaelkebe/cd714b71dd3bb22d2122b162ea0973e7 to your computer and use it in GitHub Desktop.
Save michaelkebe/cd714b71dd3bb22d2122b162ea0973e7 to your computer and use it in GitHub Desktop.
ansible group position bug when inventory is yml
[my_group]
host-1
host-2
host-3
all:
children:
my_group:
hosts:
host-1:
host-2:
host-3:
---
- hosts: my_group
- hosts: my_group[0]
- hosts: my_group[1]
- hosts: my_group[2]
#!/bin/sh
ansible-inventory -i hosts.ini --graph all
ansible-playbook -i hosts.ini playbook.yml --list-hosts
#!/bin/sh
ansible-inventory -i hosts.yml --graph all
ansible-playbook -i hosts.yml playbook.yml --list-hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment