diff --git a/README.md b/README.md index 0c2c846..df89965 100644 --- a/README.md +++ b/README.md @@ -238,6 +238,11 @@ ipv6_address: "aaaa:bbbb:cccc:dddd:dead:beef::1/64" ipv6_gateway: "aaaa:bbbb:cccc:dddd::1" ``` +9) You can also do IPv6 DHCP configuration on Ethernet on Debian only +``` +ipv6_bootproto: dhcp +``` + Create a playbook which applies this role to all hosts as shown below, and run the playbook. All the servers should have their network interfaces configured and routed updated. @@ -249,7 +254,7 @@ and routed updated. - role: network ``` -9) This role can also optionally add network interfaces to firewalld zones. The +10) This role can also optionally add network interfaces to firewalld zones. The core firewalld module (http://docs.ansible.com/ansible/latest/firewalld_module.html) can perform the same function, so if you make use of both modules then your playbooks may not be idempotent. Consider this case, where only the firewalld diff --git a/templates/ethernet_Debian.j2 b/templates/ethernet_Debian.j2 index 474486b..12a4abf 100644 --- a/templates/ethernet_Debian.j2 +++ b/templates/ethernet_Debian.j2 @@ -1,5 +1,6 @@ auto {{ item.device }} +{% if item.ipv6_address is not defined and item.ipv6_bootproto is not defined %} iface {{ item.device }} inet {% if item.bootproto is defined %}{{ item.bootproto }}{% elif item.cidr is defined or item.address is defined %}static{% else %}dhcp{% endif %} {% include 'Debian_ipv4_config.j2' %} @@ -13,9 +14,11 @@ iface {{ item.device }} inet {% if item.bootproto is defined %}{{ item.bootproto {{ option }} {% endfor %} {% endif %} +{% endif %} + +{% if item.ipv6_address is defined or item.ipv6_bootproto is defined %} +iface {{ item.device }} inet6 {% if item.ipv6_bootproto is defined %}{{ item.ipv6_bootproto }}{% elif item.ipv6_address is defined %}static{% endif %} -{% if item.ipv6_address is defined %} -iface {{ item.device }} inet6 static {% include 'Debian_ipv6_config.j2' %} {% if item.ipv6_options is defined %} {% for option in item.ipv6_options %}