diff --git a/geant/gap_ansible/roles/promote_p_to_pe/tasks/compile.yaml b/geant/gap_ansible/roles/promote_p_to_pe/tasks/compile.yaml index 5303efd345a44a711b932bb80c0e919d8e879dce..1ff554555b44b9f06975bcb25dc9eae2c10cde5e 100644 --- a/geant/gap_ansible/roles/promote_p_to_pe/tasks/compile.yaml +++ b/geant/gap_ansible/roles/promote_p_to_pe/tasks/compile.yaml @@ -9,57 +9,50 @@ ansible_host: "localhost" ansible_connection: local -- name: Create a folder for all the things - 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 }}/pe_promotion_base_config.conf" +- name: Print the template in "{{ play_storage_path }}/pe_promotion_base_config.conf" when: verb == "deploy_pe_base_config" ansible.builtin.template: src: "routers/{{ subscription.router.vendor }}/pe_promotion_base_config.j2" - dest: "/var/tmp/ansible_run_{{ opid }}/pe_promotion_base_config.conf" + dest: "{{ play_storage_path }}/pe_promotion_base_config.conf" lstrip_blocks: true trim_blocks: true mode: '0755' delegate_to: localhost -- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/pe_promotion_base_vprn.conf" +- name: Print the template in "{{ play_storage_path }}/pe_promotion_base_vprn.conf" when: verb == "deploy_routing_instances" ansible.builtin.template: src: "routers/{{ subscription.router.vendor }}/pe_promotion_base_vprn.j2" - dest: "/var/tmp/ansible_run_{{ opid }}/pe_promotion_base_vprn.conf" + dest: "{{ play_storage_path }}/pe_promotion_base_vprn.conf" lstrip_blocks: true trim_blocks: true mode: '0755' -- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/pe_update_sdp.conf" +- name: Print the template in "{{ play_storage_path }}/pe_update_sdp.conf" when: verb == "update_sdp_mesh" ansible.builtin.template: src: "routers/{{ subscription.router.vendor }}/pe_update_sdp.j2" - dest: "/var/tmp/ansible_run_{{ opid }}/pe_update_sdp.conf" + dest: "{{ play_storage_path }}/pe_update_sdp.conf" lstrip_blocks: true trim_blocks: true mode: '0755' delegate_to: localhost -- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/delete_default_static_routes.conf" +- name: Print the template in "{{ play_storage_path }}/delete_default_static_routes.conf" when: verb == "delete_default_routes" ansible.builtin.template: src: "routers/{{ subscription.router.vendor }}/router/delete_default_static_routes.j2" - dest: "/var/tmp/ansible_run_{{ opid }}/delete_default_static_routes.conf" + dest: "{{ play_storage_path }}/delete_default_static_routes.conf" lstrip_blocks: true trim_blocks: true mode: '0755' delegate_to: localhost -- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/pe_promotion_static_routes.conf" +- name: Print the template in "{{ play_storage_path }}/pe_promotion_static_routes.conf" when: verb == "add_pe_static_routes" ansible.builtin.template: src: "routers/{{ subscription.router.vendor }}/router/pe_promotion_static_routes.j2" - dest: "/var/tmp/ansible_run_{{ opid }}/pe_promotion_static_routes.conf" + dest: "{{ play_storage_path }}/pe_promotion_static_routes.conf" lstrip_blocks: true trim_blocks: true mode: '0755' diff --git a/geant/gap_ansible/roles/promote_p_to_pe/tasks/configure_storage.yaml b/geant/gap_ansible/roles/promote_p_to_pe/tasks/configure_storage.yaml new file mode 120000 index 0000000000000000000000000000000000000000..67d67dcb2717062e2e9158d3ed1da000bb66e932 --- /dev/null +++ b/geant/gap_ansible/roles/promote_p_to_pe/tasks/configure_storage.yaml @@ -0,0 +1 @@ +../../../playbooks/configure_storage.yaml \ No newline at end of file diff --git a/geant/gap_ansible/roles/promote_p_to_pe/tasks/main.yml b/geant/gap_ansible/roles/promote_p_to_pe/tasks/main.yml index c31c8db5370dc25ccb42f15d01c06c7a0dab4cfd..08e188e5e28ba3e661864948b9019076a10a3192 100644 --- a/geant/gap_ansible/roles/promote_p_to_pe/tasks/main.yml +++ b/geant/gap_ansible/roles/promote_p_to_pe/tasks/main.yml @@ -37,18 +37,13 @@ ansible_connection: "{{ netconf_access[subscription.router.vendor].ansible_connection }}" ansible_network_os: "{{ netconf_access[subscription.router.vendor].ansible_network_os }}" -- name: Generate an ID for this run - ansible.builtin.set_fact: - opid: "{{ lookup('community.general.random_string', length=18, special=false) }}" - -- name: Print the ID - ansible.builtin.debug: - msg: "{{ opid }}" -# # - name: Include ISIS overload tasks # when: verb in ['set_isis_overload', 'remove_isis_overload'] # ansible.builtin.include_tasks: configure_isis_overload.yaml +- name: Include configure storage tasks + ansible.builtin.include_tasks: configure_storage.yaml + - name: Include templates compilation when: verb in [ 'deploy_pe_base_config', 'update_sdp_mesh', 'deploy_routing_instances', 'delete_default_routes', 'add_pe_static_routes' ] ansible.builtin.include_tasks: compile.yaml