aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2019-09-21 11:55:32 +0800
committerAaron LI <aly@aaronly.me>2019-09-21 11:55:32 +0800
commited20bbe28e7c1d54b91d2896d8a0b2bc222cc9c5 (patch)
tree0fb827ed19e7d3b07d695727166e0a3402ed36a7 /roles
parent271268ec982f8e3edc1eb616075f6aa247989fa6 (diff)
downloadansible-dfly-vps-ed20bbe28e7c1d54b91d2896d8a0b2bc222cc9c5.tar.bz2
basic: Add static IPv6 settings
Diffstat (limited to 'roles')
-rw-r--r--roles/basic/tasks/main.yml30
1 files changed, 30 insertions, 0 deletions
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