[ansible-project] play_hosts variable in a plugin

2017-01-19 Thread Micoo
Hi Is there a way to get to the play_hosts variable in *v2_playbook_on_start * and *v2_playbook_on_play_start *callback? I went through various play's attributes and methods and can't seem to find it. Cheers, Michal -- You received this message because you are subscribed to the Google Groups

Re: [ansible-project] play_hosts - only when current_host == localhost

2014-07-07 Thread sturban
What should current_host be replaced with so that the below only runs for the host localhost? --- - hosts: all sudo: yes tasks: - name:play_hosts debug: var=play_hosts when: current_host == localhost -- Xtratherm Limited is a limited company registered in Ireland. Registered

Re: [ansible-project] play_hosts - only when current_host == localhost

2014-07-07 Thread Brian Coca
when: inventory_hostname == 'localhost'​ -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group,

Re: [ansible-project] play_hosts

2014-07-07 Thread Michael DeHaan
with_items: groups['all'] I wouldn't. I'd use the host loop since it's already there. - hosts: all tasks: - local_action: ... On Sun, Jul 6, 2014 at 11:03 AM, Brian Coca brianc...@gmail.com wrote: you already have a play_hosts variable with the 'current active hosts' in the

[ansible-project] play_hosts

2014-07-06 Thread sturban
Hi, I am a n00b and I am trying to create a CA playbook that first locally creates certs, keys etc (using easy-rsa's pkitool) and then deploys these to the different play_hosts. -I might be going about this the wrong way, but is there a way to register the play_hosts in a list that can then be

Re: [ansible-project] play_hosts

2014-07-06 Thread Brian Coca
you already have a play_hosts variable with the 'current active hosts' in the play​, but it will be reset every play. In this case I would just rewrite the play to use: with_items: groups['all'] -- You received this message because you are subscribed to the Google Groups Ansible Project

Re: [ansible-project] play_hosts

2014-07-06 Thread sturban
​-The problem with 'with_items: groups['all']' is that it takes that directly from /etc/ansible/hosts rather than using whatever hosts-pattern that was supplied on the command-line - i.e. '--limit ​somehosts' # somehosts.yml --- - hosts: all sudo: yes vars: allhosts: {{