diff --git a/geant/gap_ansible/roles/iptrunk/tasks/deploy_object.yaml b/geant/gap_ansible/roles/iptrunk/tasks/deploy_object.yaml index ae4365cc7a7c517ec328a112c0e38d2001127347..cfa6c675faf81fdcf957f14cfe9ffe882325f8a7 100644 --- a/geant/gap_ansible/roles/iptrunk/tasks/deploy_object.yaml +++ b/geant/gap_ansible/roles/iptrunk/tasks/deploy_object.yaml @@ -1,35 +1,22 @@ --- - name: Deploy "{{ config_object }}" on "{{ inventory_hostname }}" [CHECK ONLY][JUNIPER] - juniper_junos_config: - load: 'replace' + junipernetworks.junos.junos_config: + update: 'replace' src: "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf" - format: text - config_mode: "private" - check: true - commit: false - register: response + src_format: text + check_commit: true + diff: true when: > verb == "deploy" and local_side.iptrunk_side_node.vendor == "juniper" and dry_run | ansible.builtin.bool -- name: Show DRY diff of "{{ config_object }}" - ansible.builtin.debug: - msg: "{{ response }}" - when: > - verb == "deploy" - and dry_run | ansible.builtin.bool and - local_side.iptrunk_side_node.vendor == "juniper" - - name: Deploy "{{ config_object }}" on "{{ inventory_hostname }}" [AND COMMIT][JUNIPER] - juniper_junos_config: - load: 'replace' + junipernetworks.junos.junos_config: + update: 'replace' src: "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf" - format: text - config_mode: "private" - commit: true + src_format: text comment: "{{ commit_comment }}" - register: response when: > verb == "deploy" and local_side.iptrunk_side_node.vendor == "juniper" and diff --git a/geant/gap_ansible/roles/iptrunk/tasks/modify_trunk.yaml b/geant/gap_ansible/roles/iptrunk/tasks/modify_trunk.yaml index b926454ea0ac85d055ac1ab5e8a76f0de16f6c14..584e8ca9656dbb58628f87f0b9d227d568dd2a42 100644 --- a/geant/gap_ansible/roles/iptrunk/tasks/modify_trunk.yaml +++ b/geant/gap_ansible/roles/iptrunk/tasks/modify_trunk.yaml @@ -10,33 +10,18 @@ when: old_wfo_trunk is defined and wfo_trunk.iptrunk.iptrunk_isis_metric != old_wfo_trunk.iptrunk.iptrunk_isis_metric - name: Update ISIS metric [CHECK ONLY] - juniper_junos_config: - load: 'replace' + junipernetworks.junos.junos_config: + update: 'replace' src: "/var/tmp/ansible_run_{{ opid }}/isis_interface.conf" - format: text - config_mode: "private" - check: true - commit: false - register: response + src_format: text + check_commit: true + diff: true when: verb == "modify" and (dry_run | ansible.builtin.bool) and (modify_metric | ansible.builtin.bool) -- name: Show DRY diff of "{{ config_object }}" - ansible.builtin.debug: - msg: "{{ response }}" - when: verb == "deploy" and dry_run | ansible.builtin.bool and (modify_metric | ansible.builtin.bool) - - name: Update ISIS metric [FOR REAL] - juniper_junos_config: - load: 'replace' + junipernetworks.junos.junos_config: + update: 'replace' src: "/var/tmp/ansible_run_{{ opid }}/isis_interface.conf" - format: text - config_mode: "private" - commit: true + src_format: text comment: "{{ commit_comment }}" - register: response when: verb == "modify" and not (dry_run | ansible.builtin.bool) and (modify_metric | ansible.builtin.bool) - -- name: Show real diff of "{{ config_object }}" - ansible.builtin.debug: - msg: "{{ response }}" - when: verb == "deploy" and not (dry_run | ansible.builtin.bool) and (modify_metric | ansible.builtin.bool) diff --git a/geant/gap_ansible/roles/iptrunk/tasks/remove_trunk.yaml b/geant/gap_ansible/roles/iptrunk/tasks/remove_trunk.yaml index e6c059807218f801939c41c227ea94ce51687006..9c1d637ccfa225d987acca88420ef1ffc5715ac3 100644 --- a/geant/gap_ansible/roles/iptrunk/tasks/remove_trunk.yaml +++ b/geant/gap_ansible/roles/iptrunk/tasks/remove_trunk.yaml @@ -1,43 +1,23 @@ --- -- name: Remove "{{ config_object }}" [CHECK ONLY] - juniper_junos_config: - load: merge +- name: Remove "{{ config_object }}" on "{{ inventory_hostname }}" [CHECK ONLY][JUNIPER] + junipernetworks.junos.junos_config: + update: 'merge' src: "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf" - format: set - config_mode: "private" - check: true - commit: false - register: response - when: - verb == "terminate" and - dry_run | ansible.builtin.bool and - local_side.iptrunk_side_node.vendor == "juniper" - -- name: Show DRY diff of "{{ config_object }}" - ansible.builtin.debug: - msg: "{{ response }}" + src_format: set + check_commit: true + diff: true when: verb == "terminate" and dry_run | ansible.builtin.bool and local_side.iptrunk_side_node.vendor == "juniper" -- name: Remove "{{ config_object }}" [FOR REAL] - juniper_junos_config: - load: merge +- name: Remove "{{ config_object }}" on "{{ inventory_hostname }}" [AND COMMIT][JUNIPER] + junipernetworks.junos.junos_config: + update: 'merge' src: "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf" - format: set - config_mode: "private" - commit: true + src_format: set comment: "{{ commit_comment }}" - register: response - when: - verb == "terminate" and - not (dry_run | ansible.builtin.bool) and - local_side.iptrunk_side_node.vendor == "juniper" - -- name: Show real diff of "{{ config_object }}" - ansible.builtin.debug: - msg: "{{ response }}" + diff: true when: verb == "terminate" and dry_run | ansible.builtin.bool and