Correct me if I am wrong, but it seems like you are trying manage other ec2 hosts with ansible-pull? ansible-pull is designed to only run plays against the current host and in fact limits the inventory to localhost/127.0.0.1. If your intent is to execute playbooks when a git repo changes or from a git repo, you will need to combine git and ansible-playbook into a custom script. #!/usr/bin/psuedo-code cd $checkout git pull --rebase ansible-playbook -i inventory site.yml You could also create a simple wrapper play … - hosts: localhost gather_facts: False tasks: - git: register: git_check - shell: ansible-playbook when: git_check.changed
I am running the plays against the host running ansible-pull. But I was expecting ansible to be able to evaluate the group membership of localhost and load the proper group_vars files.
I was generating /etc/ansible/hosts with localhost belonging to a specific group.
Then ansible-pull from a repository with the corresponding group_vars/group defined.
It used to work fine and broke last week.
I’m using the ansible package from ubuntu trusty.
I have switched to git clone + ansible-playbook in the meantime.