Hi,
Have a task that disables Ipv6. The task should run only if the ipv6
folder exists.
In order to implement the above, I have 2 tasks,
the first task checks if a folder exists and saves the output to a
register, the second task is to disable IPv6 and will run only if the
register from the last task = true.
If I will run the 2 tasks everything will work because the register will
reflect the status of the server. If I will run it on multi-server, my
*assumption
*is that the first task will run on all servers and will include the status
of the lastest te server and the second task will run according to the last
output.
How can I define a register per server? or maybe my assumption is wrong
- hosts:
- master
- gw
- kafka
become: true
gather_facts: False
tasks:
- name: verify if IPv6 folderexists
stat:
path: /proc/sys/net/ipv6/
register: ipv6
- name: diable IPv6 in conf
sysctl:
name: net.ipv6.conf.all.disable_ipv6
value: '1'
sysctl_set: yes
when: ipv6.stat.exists == True
- name: diable IPv6 in default
sysctl:
name: net.ipv6.conf.default.disable_ipv6
value: '1'
sysctl_set: yes
when: ipv6.stat.exists == True
- name: remove dracut-config-generic
shell: yum -y remove dracut-config-generic
register: a
when: "'master' in group_names" and ipv6.stat.exists == True
- name: Rebuild the initramfs
shell: dracut -v -f
register: b
when: "'master' in group_names" and ipv6.stat.exists == True
--
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/0584356a-0001-48ad-a9be-0c420cc7080d%40googlegroups.com.