Created
February 27, 2016 14:31
-
-
Save tekei/02a90624614fccdac32e 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
--- | |
- hosts: localhost | |
connection: local | |
become: yes | |
tasks: | |
- name: remove ipv6 hosts entry | |
shell: sed -i -e '/::/d' -e '/IPv6/d' /etc/hosts | |
- name: find ipv6 kernel parameter | |
shell: sysctl --all | egrep '^net.ipv6\..*disable' | awk '{print $1}' | |
register: ipv6_sysctl_list | |
changed_when: false | |
always_run: yes | |
- name: add ipv6 kernel parameter | |
sysctl: name={{ item }} value=1 | |
with_items: ipv6_sysctl_list.stdout_lines |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this worked for me (as an included sub-task):