diff --git a/geant/gap_ansible/roles/base_config/tasks/deploy_base_config.yaml b/geant/gap_ansible/roles/base_config/tasks/deploy_base_config.yaml index cbd919bf21c55aa53ba493d279da2e27fc91e089..ce174aecc01ffa9e4327691eeab697cbec4e6e6a 100644 --- a/geant/gap_ansible/roles/base_config/tasks/deploy_base_config.yaml +++ b/geant/gap_ansible/roles/base_config/tasks/deploy_base_config.yaml @@ -7,8 +7,10 @@ diff: true register: output when: > - verb == "deploy" and - ( dry_run | ansible.builtin.bool ) is true and + verb == "deploy" + and + ( dry_run | ansible.builtin.bool ) + and wfo_router.router.vendor == "juniper" @@ -20,8 +22,10 @@ comment: "{{ commit_comment }}" diff: true when: > - verb == "deploy" and - ( dry_run | ansible.builtin.bool ) is false and + verb == "deploy" + and + not ( dry_run | ansible.builtin.bool ) + and wfo_router.router.vendor == "juniper" - name: Deploy base_config on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA] @@ -36,11 +40,14 @@ register: output check_mode: true when: > - verb == "deploy" and - ( dry_run | ansible.builtin.bool ) is true and + verb == "deploy" + and + ( dry_run | ansible.builtin.bool ) + and wfo_router.router.vendor == "nokia" -- name: Fail if there is any diff + +- name: Fail if there is any diff ansible.builtin.fail: msg: There are diffs!!!! when: > @@ -53,8 +60,10 @@ ansible.builtin.debug: msg: "Base config has been validated against the router and no syntax errors were found" when: > - verb == "deploy" and - ( dry_run | ansible.builtin.bool ) is true and + verb == "deploy" + and + ( dry_run | ansible.builtin.bool ) + and wfo_router.router.vendor == "nokia" @@ -69,14 +78,18 @@ diff: true check_mode: false when: > - verb == "deploy" and - ( dry_run | ansible.builtin.bool ) is false and + verb == "deploy" + and + not ( dry_run | ansible.builtin.bool ) + and wfo_router.router.vendor == "nokia" - name: PLEASE CHECK THE CONFIG ON THE BOX ansible.builtin.debug: msg: "Base config has been deployed, check on the router for the result" when: > - verb == "deploy" and - ( dry_run | ansible.builtin.bool ) is false and + verb == "deploy" + and + not ( dry_run | ansible.builtin.bool ) + and wfo_router.router.vendor == "nokia"