diff --git a/geant/gap_ansible/roles/iptrunk/tasks/compile_object.yaml b/geant/gap_ansible/roles/iptrunk/tasks/compile_object.yaml index f248c392804407ce71365a6186d6eae365e7d372..6c56467a5e41e4148d8de25dbef5b1ec05aae320 100644 --- a/geant/gap_ansible/roles/iptrunk/tasks/compile_object.yaml +++ b/geant/gap_ansible/roles/iptrunk/tasks/compile_object.yaml @@ -5,17 +5,10 @@ when: ( local_side.iptrunk_side_node.router_access_via_ts | ansible.builtin.bool ) is true -- name: Create a folder for all the templates - ansible.builtin.file: - path: "/var/tmp/ansible_run_{{ opid }}" - state: directory - mode: '0755' - delegate_to: localhost - -- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf" +- name: Print the template in "{{ play_storage_path }}/{{ config_object }}.conf" ansible.builtin.template: src: "{{ local_side.iptrunk_side_node.vendor }}/{{ config_object }}.j2" - dest: "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf" + dest: "{{ play_storage_path }}/{{ config_object }}.conf" lstrip_blocks: true trim_blocks: true mode: '0755' diff --git a/geant/gap_ansible/roles/iptrunk/tasks/configure_storage.yaml b/geant/gap_ansible/roles/iptrunk/tasks/configure_storage.yaml new file mode 120000 index 0000000000000000000000000000000000000000..67d67dcb2717062e2e9158d3ed1da000bb66e932 --- /dev/null +++ b/geant/gap_ansible/roles/iptrunk/tasks/configure_storage.yaml @@ -0,0 +1 @@ +../../../playbooks/configure_storage.yaml \ No newline at end of file diff --git a/geant/gap_ansible/roles/iptrunk/tasks/deploy_object.yaml b/geant/gap_ansible/roles/iptrunk/tasks/deploy_object.yaml index acbaade50ce347b6ccd125a15cd06806d601a3e5..81267508d5bdbe4a899fb570540d58a9162ea8c2 100644 --- a/geant/gap_ansible/roles/iptrunk/tasks/deploy_object.yaml +++ b/geant/gap_ansible/roles/iptrunk/tasks/deploy_object.yaml @@ -2,7 +2,7 @@ - name: Deploy "{{ config_object }}" on "{{ inventory_hostname }}" [CHECK ONLY][JUNIPER] junipernetworks.junos.junos_config: update: 'replace' - src: "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf" + src: "{{ play_storage_path }}/{{ config_object }}.conf" src_format: text check_commit: true diff: true @@ -25,7 +25,7 @@ - name: Deploy "{{ config_object }}" on "{{ inventory_hostname }}" [AND COMMIT][JUNIPER] junipernetworks.junos.junos_config: update: 'replace' - src: "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf" + src: "{{ play_storage_path }}/{{ config_object }}.conf" src_format: text comment: "{{ commit_comment }}" diff: true diff --git a/geant/gap_ansible/roles/iptrunk/tasks/main.yml b/geant/gap_ansible/roles/iptrunk/tasks/main.yml index d7f1c2d576a5b9d27c9ded4e602e0d0d0175e219..f3f0860e6251ffd94694bdad8e7e3e81705bdc06 100644 --- a/geant/gap_ansible/roles/iptrunk/tasks/main.yml +++ b/geant/gap_ansible/roles/iptrunk/tasks/main.yml @@ -20,10 +20,8 @@ ansible.builtin.include_vars: dir: /opt/ansible_inventory/group_vars/all -- name: Set an ID for this run - ansible.builtin.set_fact: - opid: "{{ lookup('community.general.random_string', length=18, special=false) }}" - config_is_different: "False" +- name: Include configure storage tasks + ansible.builtin.include_tasks: configure_storage.yaml - name: Load local info ansible.builtin.set_fact: @@ -56,10 +54,6 @@ when: ( local_side.iptrunk_side_node.router_access_via_ts | ansible.builtin.bool ) is true -- name: Print the ID - ansible.builtin.debug: - msg: "{{ opid }}" - - name: Include compiling the template ansible.builtin.include_tasks: compile_object.yaml when: (verb in verbs) diff --git a/geant/gap_ansible/roles/iptrunk/tasks/modify_trunk.yaml b/geant/gap_ansible/roles/iptrunk/tasks/modify_trunk.yaml index f99b0df4f0adccded7e53d3db70af9536f23d880..459701f307c98088e3bcbc33778edfc929735056 100644 --- a/geant/gap_ansible/roles/iptrunk/tasks/modify_trunk.yaml +++ b/geant/gap_ansible/roles/iptrunk/tasks/modify_trunk.yaml @@ -12,7 +12,7 @@ - name: Update ISIS metric [CHECK ONLY] junipernetworks.junos.junos_config: update: 'replace' - src: "/var/tmp/ansible_run_{{ opid }}/isis_interface.conf" + src: "{{ play_storage_path }}/isis_interface.conf" src_format: text check_commit: true diff: true @@ -21,7 +21,7 @@ - name: Update ISIS metric [FOR REAL] junipernetworks.junos.junos_config: update: 'replace' - src: "/var/tmp/ansible_run_{{ opid }}/isis_interface.conf" + src: "{{ play_storage_path }}/isis_interface.conf" src_format: text comment: "{{ commit_comment }}" diff: true diff --git a/geant/gap_ansible/roles/iptrunk/tasks/remove_trunk.yaml b/geant/gap_ansible/roles/iptrunk/tasks/remove_trunk.yaml index 271c8efe7707494557653099930c5ed9d1562951..075bed9b240773b8a9d1f11eaad483ae53522255 100644 --- a/geant/gap_ansible/roles/iptrunk/tasks/remove_trunk.yaml +++ b/geant/gap_ansible/roles/iptrunk/tasks/remove_trunk.yaml @@ -2,7 +2,7 @@ - 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" + src: "{{ play_storage_path }}/{{ config_object }}.conf" src_format: set check_commit: true diff: true @@ -14,7 +14,7 @@ - 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" + src: "{{ play_storage_path }}/{{ config_object }}.conf" src_format: set comment: "{{ commit_comment }}" diff: true