This commit is contained in:
2026-04-26 10:38:46 +03:00
parent 1d19a10f00
commit 09a0cb677d
2 changed files with 13 additions and 7 deletions

View File

@@ -47,10 +47,11 @@
nb_ip_err: "{{ _fail_line }}" nb_ip_err: "{{ _fail_line }}"
changed_when: false changed_when: false
- name: "Wrapper | Abort if nb_ip not available" - name: "Wrapper | Continue with inventory IP if nb_ip not available"
fail: debug:
msg: "Wrapper preflight did not produce nb_ip. FAIL line: {{ nb_ip_err | default('') }}" msg: "Wrapper preflight did not produce nb_ip, keeping current inventory ansible_host. FAIL line: {{ nb_ip_err | default('') }}"
when: not nb_ip_ok when: not nb_ip_ok
changed_when: false
- name: "Wrapper | Debug before ansible_host override" - name: "Wrapper | Debug before ansible_host override"
debug: debug:
@@ -64,6 +65,7 @@
- name: "Wrapper | Update ansible_host to nb_ip" - name: "Wrapper | Update ansible_host to nb_ip"
set_fact: set_fact:
ansible_host: "{{ nb_ip }}" ansible_host: "{{ nb_ip }}"
when: nb_ip_ok
changed_when: false changed_when: false
- name: "Wrapper | Debug after ansible_host override" - name: "Wrapper | Debug after ansible_host override"
@@ -76,6 +78,7 @@
- name: "Wrapper | Reset connection after ansible_host change" - name: "Wrapper | Reset connection after ansible_host change"
meta: reset_connection meta: reset_connection
when: nb_ip_ok
- name: "Wrapper | Debug after reset_connection" - name: "Wrapper | Debug after reset_connection"
debug: debug:

View File

@@ -48,10 +48,11 @@
nb_ip_err: "{{ _fail_line }}" nb_ip_err: "{{ _fail_line }}"
changed_when: false changed_when: false
- name: "Wrapper | Abort if nb_ip not available" - name: "Wrapper | Continue with inventory IP if nb_ip not available"
fail: debug:
msg: "Wrapper preflight did not produce nb_ip. FAIL line: {{ nb_ip_err | default('') }}" msg: "Wrapper preflight did not produce nb_ip, keeping current inventory ansible_host. FAIL line: {{ nb_ip_err | default('') }}"
when: not nb_ip_ok when: not nb_ip_ok
changed_when: false
- name: "Wrapper | Debug before ansible_host override" - name: "Wrapper | Debug before ansible_host override"
debug: debug:
@@ -65,6 +66,7 @@
- name: "Wrapper | Update ansible_host to nb_ip" - name: "Wrapper | Update ansible_host to nb_ip"
set_fact: set_fact:
ansible_host: "{{ nb_ip }}" ansible_host: "{{ nb_ip }}"
when: nb_ip_ok
changed_when: false changed_when: false
- name: "Wrapper | Debug after ansible_host override" - name: "Wrapper | Debug after ansible_host override"
@@ -77,7 +79,8 @@
- name: "Wrapper | Reset connection after ansible_host change" - name: "Wrapper | Reset connection after ansible_host change"
meta: reset_connection meta: reset_connection
when: nb_ip_ok
- name: "Wrapper | Debug after reset_connection" - name: "Wrapper | Debug after reset_connection"
debug: debug:
msg: msg: