Skip to content
Snippets Groups Projects
Commit 30ef02d8 authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov
Browse files

Merge branch 'feature/nat-1090-common-storage' into 'develop'

Feature/nat 1090 common storage

See merge request !260
parents be68df6b 830536bf
No related branches found
No related tags found
1 merge request!260Feature/nat 1090 common storage
Pipeline #93687 passed
Showing
with 58 additions and 62 deletions
......@@ -9,10 +9,12 @@
ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/routers
- 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: Set "config_is_different" var
# ansible.builtin.set_fact:
# config_is_different: "False"
- name: Load local info
ansible.builtin.set_fact:
......@@ -38,10 +40,6 @@
when:
( local_side.iptrunk_side_node.router_access_via_ts | ansible.builtin.bool )
- name: Print the ID
ansible.builtin.debug:
msg: "{{ opid }}"
- name: Set short router names for local and remote sides
ansible.builtin.set_fact:
local_side_short_name: '{{ local_side.iptrunk_side_node.router_fqdn | replace(domain_name_regex, "") }}'
......
......@@ -4,11 +4,11 @@
ansible_host: "localhost"
ansible_connection: local
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/{{ l2circuits_fqdn }}_l2c.conf"
- name: Print the template in "{{ play_storage_path }}/{{ l2circuits_fqdn }}_l2c.conf"
# when: verb in ["deploy", "update", "terminate"]
ansible.builtin.template:
src: "{{ l2circuits_vendor }}/{{ verb }}/l2circuit.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/{{ l2circuits_fqdn }}_l2c.conf"
dest: "{{ play_storage_path }}/{{ l2circuits_fqdn }}_l2c.conf"
lstrip_blocks: true
trim_blocks: true
mode: "0755"
......
../../../tasks/configure_storage.yaml
\ No newline at end of file
......@@ -7,8 +7,8 @@
- name: Produce the config for the current l2circuit endpoint
when: inventory_hostname == l2circuits_fqdn
block:
- name: Include standard tasks
ansible.builtin.include_tasks: standard_tasks.yaml
- name: Include configure storage tasks
ansible.builtin.include_tasks: configure_storage.yaml
- name: Merge vars
ansible.builtin.include_tasks: merge_vars.yaml
......
......@@ -7,7 +7,7 @@
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.file', '/var/tmp/ansible_run_{{ opid }}/{{ l2circuits_fqdn }}_l2c.conf') }}"
content: "{{ lookup('ansible.builtin.file', '{{ play_storage_path }}/{{ l2circuits_fqdn }}_l2c.conf') }}"
commit: true
validate: true
config_mode: private
......@@ -32,7 +32,7 @@
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.file', '/var/tmp/ansible_run_{{ opid }}/{{ l2circuits_fqdn }}_l2c.conf') }}"
content: "{{ lookup('ansible.builtin.file', '{{ play_storage_path }}/{{ l2circuits_fqdn }}_l2c.conf') }}"
commit: true
commit_comment: "{{ commit_comment }}"
config_mode: private
......@@ -46,7 +46,7 @@
l2circuits_vendor == "juniper"
junipernetworks.junos.junos_config:
update: "replace"
src: "/var/tmp/ansible_run_{{ opid }}/{{ l2circuits_fqdn }}_l2c.conf"
src: "{{ play_storage_path }}/{{ l2circuits_fqdn }}_l2c.conf"
src_format: set
check_commit: true
diff: true
......@@ -58,7 +58,7 @@
l2circuits_vendor == "juniper"
junipernetworks.junos.junos_config:
update: "replace"
src: "/var/tmp/ansible_run_{{ opid }}/{{ l2circuits_fqdn }}_l2c.conf"
src: "{{ play_storage_path }}/{{ l2circuits_fqdn }}_l2c.conf"
src_format: set
comment: "{{ commit_comment }}"
diff: true
......@@ -7,9 +7,13 @@
ansible.builtin.debug:
msg: "{{ opid }}"
- name: Generate FS path for artifacts storage
ansible.builtin.set_fact:
play_storage_path: "{{ storage_mount_prefix | default('/var/tmp') }}/{{ gso_process_id | default('gso_pid_undefined') }}/ansible_run_{{ opid }}"
- name: Create a folder for all compiled output
ansible.builtin.file:
path: "/var/tmp/ansible_run_{{ opid }}"
path: "{{ play_storage_path }}"
state: directory
mode: "0755"
delegate_to: localhost
......@@ -4,11 +4,11 @@
ansible_host: "localhost"
ansible_connection: local
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_pim.conf"
- name: Print the template in "{{ play_storage_path }}/{{ partner_name }}_pim.conf"
# when: verb in ["deploy", "update", "terminate"]
ansible.builtin.template:
src: "pim.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_pim.conf"
dest: "{{ play_storage_path }}/{{ partner_name }}_pim.conf"
lstrip_blocks: true
trim_blocks: true
mode: '0755'
......
......@@ -19,7 +19,7 @@
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.file', '/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_prefix_lists.conf') }}"
content: "{{ lookup('ansible.builtin.file', '{{ play_storage_path }}/{{ partner_name }}_prefix_lists.conf') }}"
commit: true
validate: true
config_mode: private
......@@ -32,7 +32,7 @@
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.file', '/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_prefix_lists.conf') }}"
content: "{{ lookup('ansible.builtin.file', '{{ play_storage_path }}/{{ partner_name }}_prefix_lists.conf') }}"
commit: true
commit_comment: "{{ commit_comment }}"
config_mode: private
......
......@@ -140,11 +140,11 @@
nren_prefix_lists: "{{ nren_prefix_lists | default([]) + [{'name': ipv4_prefix_list_name, 'prefixes': bgpq_routes_ipv4},
{'name': ipv6_prefix_list_name, 'prefixes': bgpq_routes_ipv6}] }}"
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_prefix_lists.conf"
- name: Print the template in "{{ play_storage_path }}/{{ partner_name }}_prefix_lists.conf"
delegate_to: localhost
ansible.builtin.template:
src: "nokia/prefix_lists.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_prefix_lists.conf"
dest: "{{ play_storage_path }}/{{ partner_name }}_prefix_lists.conf"
lstrip_blocks: true
trim_blocks: true
mode: '0755'
......
......@@ -4,11 +4,11 @@
ansible_host: "localhost"
ansible_connection: local
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/PO.conf"
- name: Print the template in "{{ play_storage_path }}/PO.conf"
# when: verb in ["deploy", "update", "terminate"]
ansible.builtin.template:
src: "policy_options.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/PO.conf"
dest: "{{ play_storage_path }}/PO.conf"
lstrip_blocks: true
trim_blocks: true
mode: '0755'
......
......@@ -19,7 +19,7 @@
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.file', '/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_po.conf') }}"
content: "{{ lookup('ansible.builtin.file', '{{ play_storage_path }}/{{ partner_name }}_po.conf') }}"
commit: true
validate: true
config_mode: private
......@@ -32,7 +32,7 @@
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.file', '/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_po.conf') }}"
content: "{{ lookup('ansible.builtin.file', '{{ play_storage_path }}/{{ partner_name }}_po.conf') }}"
commit: true
commit_comment: "{{ commit_comment }}"
config_mode: private
......
......@@ -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'
......
../../../tasks/configure_storage.yaml
\ No newline at end of file
......@@ -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
......
......@@ -4,11 +4,11 @@
ansible_host: "localhost"
ansible_connection: local
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_sbp.conf"
- name: Print the template in "{{ play_storage_path }}/{{ partner_name }}_sbp.conf"
# when: verb in ["deploy", "update", "terminate"]
ansible.builtin.template:
src: "{{ vendor }}/{{ verb }}/sbp.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_sbp.conf"
dest: "{{ play_storage_path }}/{{ partner_name }}_sbp.conf"
lstrip_blocks: true
trim_blocks: true
mode: '0755'
......
......@@ -19,7 +19,7 @@
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.file', '/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_sbp.conf') }}"
content: "{{ lookup('ansible.builtin.file', '{{ play_storage_path }}/{{ partner_name }}_sbp.conf') }}"
commit: true
validate: true
config_mode: private
......@@ -32,7 +32,7 @@
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.file', '/var/tmp/ansible_run_{{ opid }}/{{ partner_name }}_sbp.conf') }}"
content: "{{ lookup('ansible.builtin.file', '{{ play_storage_path }}/{{ partner_name }}_sbp.conf') }}"
commit: true
commit_comment: "{{ commit_comment }}"
config_mode: private
......
......@@ -4,10 +4,10 @@
ansible_host: "localhost"
ansible_connection: local
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/SDP.conf"
- name: Print the template in "{{ play_storage_path }}/SDP.conf"
ansible.builtin.template:
src: "routers/nokia/{{ verb }}/sdp.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/SDP.conf"
dest: "{{ play_storage_path }}/SDP.conf"
lstrip_blocks: true
trim_blocks: true
mode: "0755"
......
../../../tasks/configure_storage.yaml
\ No newline at end of file
......@@ -18,8 +18,11 @@
when: (verb is not defined) or (verb not in verbs)
ansible.builtin.meta: end_play
- name: Include standard tasks
ansible.builtin.include_tasks: standard_tasks.yaml
# - name: Include standard tasks
# ansible.builtin.include_tasks: standard_tasks.yaml
- name: Include configure storage tasks
ansible.builtin.include_tasks: configure_storage.yaml
- name: Include merge vars tasks
ansible.builtin.include_tasks: merge_vars.yaml
......
......@@ -5,7 +5,7 @@
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.file', '/var/tmp/ansible_run_{{ opid }}/SDP.conf') }}"
content: "{{ lookup('ansible.builtin.file', '{{ play_storage_path }}/SDP.conf') }}"
commit: true
validate: true
config_mode: private
......@@ -28,7 +28,7 @@
geant.gap_ansible.nokia_netconf_config:
format: xml
default_operation: merge
content: "{{ lookup('ansible.builtin.file', '/var/tmp/ansible_run_{{ opid }}/SDP.conf') }}"
content: "{{ lookup('ansible.builtin.file', '{{ play_storage_path }}/SDP.conf') }}"
commit: true
commit_comment: "{{ commit_comment }}"
config_mode: private
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment