On 6/1/20 5:49 PM, Toni Mueller wrote: > > Hi, > > in a project to provision stuff, I would like to set a lot of variables > on a host, which I want to use in a playbook, but take the values for > that variable from the host I am delegating to. Ie, in my inventory, I > have > > > host2 delegate_to=host1 > host3 delegate_to=host1 > host4 delegate_to=host1 > host5 delegate_to=host1 > > > and in host1, I have a lot of things to do, and also a lot of variables > to use. Now, I would like to avoid configuring these variables in the > host_vars for hosts2..host5, but just in the host_vars for host1. > Opening a group is not really feasible, as the association between host1 > and the other hosts on top of it, can vary quickly, and there are no > fixed groups. > > > How would I best address this problem? >
The description of your problem is quite generic, but nothing stops you
from defining variables outside of host or group vars to consume in your tasks.
A common pattern is to read variables via include_vars from a number of files.
Regards
Racke
>
> Cheers,
> Ton1
>
--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/e19eaf2b-8d04-9837-3e2e-4baa59db326e%40linuxia.de.
signature.asc
Description: OpenPGP digital signature
