From ed20bbe28e7c1d54b91d2896d8a0b2bc222cc9c5 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 21 Sep 2019 11:55:32 +0800 Subject: basic: Add static IPv6 settings --- roles/basic/tasks/main.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'roles') diff --git a/roles/basic/tasks/main.yml b/roles/basic/tasks/main.yml index ca46831..bfe80fa 100644 --- a/roles/basic/tasks/main.yml +++ b/roles/basic/tasks/main.yml @@ -1,4 +1,34 @@ --- +- name: sysctl.conf - accept RA (router advertisements) + lineinfile: + path: /etc/sysctl.conf + regexp: '^#?net.inet6.ip6.accept_rtadv' + line: "net.inet6.ip6.accept_rtadv=1" + tags: ipv6 + +- name: sysctl.conf - disable IPv6 forwarding + lineinfile: + path: /etc/sysctl.conf + regexp: '^#?net.inet6.ip6.forwarding' + line: "net.inet6.ip6.forwarding=0" + tags: ipv6 + +- name: sysctl.conf - reload + service: + name: sysctl + state: reloaded + tags: ipv6 + +- name: rc.conf - set static ipv6 + blockinfile: + path: /etc/rc.conf + marker: "# {mark} ANSIBLE MANAGED - ipv6" + block: | + ipv6_enable="YES" + ipv6_ifconfig_vtnet0="2001:19f0:5:3166:5400:1ff:fe5d:df67 prefixlen 64" + rtsold_enable="YES" + tags: ipv6 + - name: rc.conf - tune basic services blockinfile: path: /etc/rc.conf -- cgit v1.2.2