Override hosts: in any playbook via command-line argument

131 views
Skip to first unread message

Alex Leonhardt

unread,
Aug 3, 2015, 11:52:48 AM8/3/15
to Ansible Project
Hi,

How can I override the hosts: definition in any playbook ? I've got some playbooks that run against remote hosts, which I want to keep in the playbook, but need to be able to run /test it against "localhost" as well ... I guess adding localhost would be an option, but I dont want it to run against the other hosts in that case - I found in some forums to use a --extra-vars "target=host" and use - hosts: "{{ target }}" but that would mean I have to update all my playbooks and how I'd run them ... 

Any suggestions ? 

Thanks
Alex

Reply all
Reply to author
Forward
0 new messages