Skip to content

Allow both only IPv6 (no IPv4) and IPv6 DHCP #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions templates/ethernet_Debian.j2
Original file line number Diff line number Diff line change
@@ -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' %}
Expand All @@ -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 %}
Expand Down