I want to have a set of git repos with base application config playbooks in 
them such that all I need to do with any VM, regardless of its name or role 
or how long its been around, to get the base config installed is to run an 
ansible-pull command  against this repo and I get a ready to use instance. 
 The problem that I run into is that if I have a playbook local.yml that's 
set like so:

- hosts: localhost
  connection: local
  gather_facts: yes
  user: root

[...]


or like so:

- hosts: all
  connection: local
  gather_facts: yes
  user: root

 [...]


I keep getting the following error:

# ansible-pull -d /tmp/myrepo -U 'http://mygithost/myrepo' 
Starting ansible-pull at 2015-06-09 15:04:05
localhost | success >> {
    "after": "2e4d1c637170f95dfaa8d16ef56491b64a9f931b",
    "before": "d7520ea15baa8ec2c45742d0fd8e209c293c3487",
    "changed": true
}

*ERROR: Specified --limit does not match any hosts*


The only way I've been able to avoid the error is to create an explicit 
inventory file with an explicit groupname and explicit hostnames that is 
then referred to with the '-i' flag like so:

# cat /tmp/myrepo/myinventory
[mygroup]
myhost1
myhost2

# cat /tmp/myrepo/local.yml
- hosts: mygroup
  connection: local
  gather_facts: yes
  user: root
 [...]

# ansible-pull -d /tmp/myrepo -i myinventory -U 'http://mygithost/myrepo' 


But I don't want that, I want any host, no matter whether its name or role 
is known to be able to run an ansible-pull against the repo and run the 
playbook without having to explicitly configure the name of the host into 
the inventory.  How do I do that?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/38568b73-053d-4faf-bdbb-e6a08ac4e2a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to