-
-
Save scicco/1cddf534132cfbf445f562c8273f6c53 to your computer and use it in GitHub Desktop.
ansible : (ubuntu) disable IPv6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Remove ipv6 hosts entry | |
replace: | |
dest: /etc/hosts | |
regexp: '^.*::\d\t.+|.*IPv6.*$' | |
#backup: yes | |
become: yes | |
# TODO FIND A WAY TO ELIMINATE EMPTY ROWS INSIDE /etc/hosts file | |
- name: Find ipv6 kernel parameter | |
shell: sysctl --all | egrep '^net.ipv6\..*disable' | awk '{print $1}' | |
register: ipv6_sysctl_list | |
changed_when: false | |
check_mode: no | |
become: yes | |
- debug: var=ipv6_sysctl_list | |
- debug: var=ipv6_sysctl_list.stdout_lines | |
- name: Add ipv6 kernel parameter | |
sysctl: name={{ item }} value=1 | |
with_items: "{{ ipv6_sysctl_list.stdout_lines }}" | |
become: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment