Reputation: 8277
I am running ansible playbook with the limit flag.
ansible-playbook -i hosts --vault-password-file /etc/hostname playbooks/install.yml --tags "printa" --limit 'all:!vm'
but this causes localhost to be not found:
PLAY [Playing with Ansible and Git] *****************************************************************************
skipping: no hosts matched
PLAY [all] ******************************************************************************************************
.
.
This is my install.yml
---
- name: "Playing with Ansible and Git"
hosts: localhost
connection: local
tasks:
- name: "just execute a ls -lrt command"
shell: "ls -lrt"
register: "output"
- debug: var=output.stdout_lines
Upvotes: 3
Views: 1327
Reputation: 44615
Ansible implicit localhost is not part of the all
(nor any other...) group.
You either need to:
localhost
explicitly to your inventory. But it will then match the all
group in your playbooks too with all undesired possible effects--limit 'localhost:all:!vm'
Upvotes: 4