diff --git a/files/ansible-playbooks/ptsd-migrate.yml b/files/ansible-playbooks/ptsd-migrate.yml index d22b7b7..797f475 100644 --- a/files/ansible-playbooks/ptsd-migrate.yml +++ b/files/ansible-playbooks/ptsd-migrate.yml @@ -635,6 +635,35 @@ changed_when: false failed_when: false + - name: "PHASE 0 (LAST) | Detect mixed state: ppp0 present AND eth0.4000 present (should not happen)" + delegate_to: localhost + ansible.builtin.set_fact: + dev2_ppp_present: "{{ (dev2_ppp0_has_ipv4.stdout | default('') | trim) == 'YES' }}" + dev2_eth04000_present: "{{ (dev2_eth04000_exists.stdout | default('') | trim) == 'YES' }}" + dev2_mixed_state: >- + {{ + ((dev2_ppp0_has_ipv4.stdout | default('') | trim) == 'YES') + and + ((dev2_eth04000_exists.stdout | default('') | trim) == 'YES') + }} + changed_when: false + + - name: "PHASE 0 (LAST) | Graceful stop: DEV2 has BOTH ppp0 and eth0.4000 (mixed/partial migration)" + when: dev2_mixed_state | bool + delegate_to: localhost + ansible.builtin.debug: + msg: + - "We shall not continue: DEV2 is in mixed state (ppp0 present AND eth0.4000 present)." + - "This suggests partial/failed migration or unexpected config; manual inspection required." + - "ppp0_has_ipv4={{ dev2_ppp_present }}" + - "eth0.4000_exists={{ dev2_eth04000_present }}" + - "dev2_conn_final={{ dev2_conn_final }}" + changed_when: false + + - name: "PHASE 0 (LAST) | End host: mixed/partial migration state" + when: dev2_mixed_state | bool + ansible.builtin.meta: end_host + - name: "PHASE 0 (LAST) | Summarize DEV2 pre-migration eligibility" delegate_to: localhost ansible.builtin.set_fact: