I have plays that look like, eg
- name: provision ec2 instance
...
- set_fact:
newly_created_ips: ...
- import_playbook: ../configure/nomad-server.yml
Inside nomad-server.yml it looks like
- name: Configure nomad-client
hosts: nomad_client
...
What I want is to "dynamically" limit the inventory in nomad-client.yml to
the set of hosts that actually just got created -- not the full set of
hosts that match nomad_client.
I could of course create a complicated hosts pattern or use a variable.
That makes using the nomad-server.yml playbook more complex in other
contexts.
What I really want to do is something akin to
- set_fact:
groups['nomad_client']: "{{ newly_created_ips }}"
Of course the above does not work, but it shows the intent.
Can I create a module that has access to the inventory plugin being used?
Or is there some way to "tell" the ec2 inventory plugin to change the set
of hosts in nomad_server for the remainder of the play (maybe having to run
-meta: refresh_inventory afterwords).
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/a5c1c8c4-ed76-4aac-9101-feb8a6360e5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.