Hi,
I'm new to Ansible, I've spent less than a week with it but already have it
set up to perform a number of tasks.
I'm finding it difficult to get around one issue.
Basically, I need to allow an IP address (or some cases more than one) in
tcpwrappers that is different for each network (a hide address).
I realize I can get the network address from {{
ansible_default_ipv4.network }}, I wanted to use this to determine the list
of hide addresses for this particular network and pass those on to my
hosts.allow.j2 template (or even just do that in my template if possible).
In group_vars/all, I have each networks hide address(es) as lists;
10_18_101_hide:
- 10.18.101.5
- 10.18.101.10
10_18_102_hide:
- 10.18.102.5
and so on.
I was thinking of using {{ ansible_default_ipv4.network }} and somehow
dropping the last period and the digits that follow, replacing '.' with '_'
and then somehow using the result to get the list defined in the vars above.
Can anyone please help me do this in the cleanest way possible? (or even
just find a solution for this problem, until I learn and discover the best
way). An example would illustrate it best to me.
Ansible Version: 1.4.3
--
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/8040e95a-e43b-4a30-9e3b-74d8174ea65f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.