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
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
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,
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
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
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
-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: {{