I am new to Ansible, so I assume I am making a silly mistake, however when I try to run a playbook with roles for a group of hosts, Ansible doesn't see any hosts in some groups. In particular
Inventory has among others the following group:
[master]
clm01
It seems to be working OK with Ad-hoc commands:
:~/ansible/splunk# ansible master -i hosts -m ping -u USERNAME
clm01 | SUCCESS => {
"changed": false,
"ping": "pong"
}
However, when I try to run the following, Ansible can't see any hosts:
- name: initialize master
hosts: master
remote_user: USERNAME
become: yes
roles:
- cluster_master
[...]
ansible-playbook site.yml --ask-sudo-pass --list-hosts
[...]
play #2 (master): initialize master TAGS: []
pattern: [u'master']
hosts (0):
[...]
Some of the groups in the inventory are working with other plays defined in the same file, so I would assume there is a syntax error on my side. I have also tried changing group name, hoping I am using a reserved name etc.