And I am invoking this script using the following command: ansible-playbook -vvv --ask-sudo-pas local_play.yml --extra-vars 'hosts=localhost app_user=joe'
I get the following error:
ERROR: provided hosts list is empty
What am I doing wrong..
Thanks
Brian Coca
unread,
Mar 12, 2015, 1:59:50 PM3/12/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
try using a variable named 'target', hosts is a keyword and can lead
to confusion, in general do not use variables that overlap with
keywords.
--
Brian Coca
Guru Devanla
unread,
Mar 12, 2015, 2:27:43 PM3/12/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
Thanks Brian.
I tried target but go the same error. I also tried to get rid of variable entirely with the following statement
- hosts: 'localhost' tasks: - name: test ping ping:
and I still see the same error. Looks like there is some other config file that is causing some issue. Note, that this is specific to a machine and I am not getting this error on another machine. So, am I missing some setting in /etc/ansible/hosts file?
Brian Coca
unread,
Mar 12, 2015, 2:29:59 PM3/12/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
newer ansible versions should 'just work' with localhost, any other
host you want to use should appear in inventory (default is
/etc/ansible/hosts) but you can even define in command line '-i
"hostname,"' < comma is important as it tells ansible it is a list.