Skip to content

Commit 7cfbbc8

Browse files
committed
Use ansible.utils.ipaddr instad of ipaddr. Some other minor changes
1 parent f625330 commit 7cfbbc8

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

tasks/init_cluster.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
- set_fact:
1212
kubernetes_ip_address: "{{ item }}"
13-
when: "item | ipaddr( kubernetes_subnet )"
13+
when: "item | ansible.utils.ipaddr( kubernetes_subnet )"
1414
with_items: "{{ ansible_all_ipv4_addresses | difference([kubernetes_vip_ip]) }}"
1515

1616
- set_fact:
@@ -22,7 +22,7 @@
2222
kubernetes_iface: "{{ hostvars[inventory_hostname]['ansible_' + item ]['device'] }}"
2323
when:
2424
- hostvars[inventory_hostname]['ansible_' + item ].ipv4 is defined
25-
- hostvars[inventory_hostname]['ansible_' + item ]['ipv4']['address'] | ipaddr( kubernetes_subnet )
25+
- hostvars[inventory_hostname]['ansible_' + item ]['ipv4']['address'] | ansible.utils.ipaddr( kubernetes_subnet )
2626
with_items: "{{ ansible_interfaces }}"
2727

2828
- set_fact:
@@ -63,4 +63,5 @@
6363
- inventory_hostname in groups['kubemaster']
6464
- kubernetes_init
6565
- cluster_exist.rc == 1
66+
any_errors_fatal: true
6667
ignore_errors: "{{ ansible_check_mode }}"

tasks/join_cluster.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
- set_fact:
99
kubernetes_ip_address: "{{ item }}"
10-
when: "item | ipaddr( kubernetes_subnet )"
10+
when: "item | ansible.utils.ipaddr( kubernetes_subnet )"
1111
with_items: "{{ ansible_all_ipv4_addresses | difference([kubernetes_vip_ip]) }}"
1212

1313
- set_fact:

tasks/preflight.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
- name: check iptables version
8686
ansible.builtin.shell: iptables --version
8787
register: iptables_version
88-
ignore_errors: yes
88+
ignore_errors: true
8989

9090
- block:
9191
- community.general.alternatives:

tasks/setup_vip.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
kubernetes_iface: "{{ hostvars[inventory_hostname]['ansible_' + item ]['device'] }}"
55
when:
66
- hostvars[inventory_hostname]['ansible_' + item ].ipv4 is defined
7-
- hostvars[inventory_hostname]['ansible_' + item ]['ipv4']['address'] | ipaddr( kubernetes_subnet )
7+
- hostvars[inventory_hostname]['ansible_' + item ]['ipv4']['address'] | ansible.utils.ipaddr( kubernetes_subnet )
88
with_items: "{{ ansible_interfaces }}"
99

1010
- name: Create /etc/kubernetes/manifests/ directory

0 commit comments

Comments
 (0)