How to get the --limit command line option

57 views
Skip to first unread message

Marco Buttu

unread,
Mar 9, 2017, 3:01:05 AM3/9/17
to Ansible Project
Hi all, I would like to read the --limit command line option. For instance, let's have the following:

$ ansible-playbook site.yml --limit foo

I would like the tasks to read {{ limit }}. Is it possibile or do I have to duplicate thinks like in the following?

$ ansible-playbook site.yml --limit foo --extra-vars "limit=foo"

Thanks, Marco

Brian Coca

unread,
Mar 12, 2017, 7:22:48 PM3/12/17
to Ansible Project
That is info is not available direclty in play, but you could check
ansible_play_hosts vs the hosts pattern to see what the difference is.

If you supply multiple options for --limit, only the last one is heeded.


----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages