Skip to content

Commit

Permalink
Added an IPv6 check
Browse files Browse the repository at this point in the history
Playbook fails with propper error msg if IPv6 is enabled but not
available.
  • Loading branch information
rbo committed Jul 27, 2021
1 parent 961b349 commit fda363e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ansible/roles/openshift-4-cluster/tasks/create-network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
# src: templates/network.xml.j2
# dest: network.xml

- name: Check IPv6
fail:
msg: "IPv6 is enabled via ip_families but your Host system do not have a public IPv6 subnet configured."
when:
- "'IPv6' in ip_families"
- hostvars['localhost']['ansible_default_ipv6'] | length == 0

- name: Build IPv6 subnet
set_fact:
vn_subnet_ipv6: "{{ hostvars['localhost']['ansible_default_ipv6']['address'].split(':')[:4] | join(':') | string}}:{{ '%x' % vn_subnet.split('.')[2] | int }}"
Expand Down

0 comments on commit fda363e

Please sign in to comment.