diff --git a/geant/gap_ansible/roles/iptrunk_twamp/tasks/deploy_object.yaml b/geant/gap_ansible/roles/iptrunk_twamp/tasks/deploy_object.yaml index 78725f04ef7111fc84e409f1791d9e7c7d4f3fea..72336382bf44dc2a774bb99ea670f0e6f6677f1c 100644 --- a/geant/gap_ansible/roles/iptrunk_twamp/tasks/deploy_object.yaml +++ b/geant/gap_ansible/roles/iptrunk_twamp/tasks/deploy_object.yaml @@ -6,11 +6,22 @@ src_format: text check_commit: true diff: true + register: output when: > local_side.iptrunk_side_node.vendor == "juniper" and ( dry_run | ansible.builtin.bool ) +- name: Fail if there is any diff + ansible.builtin.fail: + msg: TWAMP config drift detected!!! + when: > + output.changed | ansible.builtin.bool + and + is_verification_workflow | ansible.builtin.bool + and + local_side.iptrunk_side_node.vendor == "juniper" + - name: Deploy "{{ config_object }}" on "{{ inventory_hostname }}" [AND COMMIT][JUNIPER] junipernetworks.junos.junos_config: update: 'replace' @@ -31,12 +42,23 @@ content: "{{ lookup('ansible.builtin.template', '{{ local_side.iptrunk_side_node.vendor }}/{{ config_object }}.j2') }}" commit: true diff: true + register: output check_mode: true when: > local_side.iptrunk_side_node.vendor == "nokia" and ( dry_run | ansible.builtin.bool ) +- name: Fail if there is any diff + ansible.builtin.fail: + msg: TWAMP config drift detected!!! + when: > + output.changed | ansible.builtin.bool + and + is_verification_workflow | ansible.builtin.bool + and + local_side.iptrunk_side_node.vendor == "nokia" + - name: Deploy "{{ config_object }}"on "{{ inventory_hostname }}" [AND COMMIT][NOKIA] # ansible.netcommon.netconf_config: geant.gap_ansible.nokia_netconf_config: diff --git a/geant/gap_ansible/roles/iptrunk_twamp/vars/main.yml b/geant/gap_ansible/roles/iptrunk_twamp/vars/main.yml index ace9a7ac4a9f5463a660c58e4064c2e2a8d56605..a5c6e954c4150f3380948690e4af2499d64eb71c 100644 --- a/geant/gap_ansible/roles/iptrunk_twamp/vars/main.yml +++ b/geant/gap_ansible/roles/iptrunk_twamp/vars/main.yml @@ -4,6 +4,7 @@ # dry_run: "True" +is_verification_workflow: false nokia_twamp_server: