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

`base_config` - use updated storage path

parent 242cb5a4
Branches
Tags
1 merge request!260Feature/nat 1090 common storage
...@@ -18,15 +18,15 @@ ...@@ -18,15 +18,15 @@
- name: Create a folder for all the things - name: Create a folder for all the things
ansible.builtin.file: ansible.builtin.file:
path: "/var/tmp/ansible_run_{{ opid }}" path: "{{ play_storage_path }}"
state: directory state: directory
mode: '0755' mode: '0755'
delegate_to: localhost delegate_to: localhost
- name: Print the template in "/var/tmp/ansible_run_{{ opid }}/base_config.conf" - name: Print the template in "{{ play_storage_path }}/base_config.conf"
ansible.builtin.template: ansible.builtin.template:
src: "routers/{{ wfo_router.router.vendor }}/base_config.j2" src: "routers/{{ wfo_router.router.vendor }}/base_config.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/base_config.conf" dest: "{{ play_storage_path }}/base_config.conf"
lstrip_blocks: true lstrip_blocks: true
trim_blocks: true trim_blocks: true
mode: '0755' mode: '0755'
......
../../../playbooks/configure_storage.yaml
\ No newline at end of file
- name: Deploy base_config on "{{ inventory_hostname }}" [CHECK ONLY][Juniper] - name: Deploy base_config on "{{ inventory_hostname }}" [CHECK ONLY][Juniper]
junipernetworks.junos.junos_config: junipernetworks.junos.junos_config:
update: 'replace' update: 'replace'
src: "/var/tmp/ansible_run_{{ opid }}/{{ mytemplates.template_name }}.conf" src: "{{ play_storage_path }}/{{ mytemplates.template_name }}.conf"
src_format: text src_format: text
check_commit: true check_commit: true
diff: true diff: true
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
- name: Deploy base_config on "{{ inventory_hostname }}" [AND COMMIT][Juniper] - name: Deploy base_config on "{{ inventory_hostname }}" [AND COMMIT][Juniper]
junipernetworks.junos.junos_config: junipernetworks.junos.junos_config:
update: 'replace' update: 'replace'
src: "/var/tmp/ansible_run_{{ opid }}/{{ mytemplates.template_name }}.conf" src: "{{ play_storage_path }}/{{ mytemplates.template_name }}.conf"
src_format: text src_format: text
comment: "{{ commit_comment }}" comment: "{{ commit_comment }}"
diff: true diff: true
......
...@@ -39,17 +39,8 @@ ...@@ -39,17 +39,8 @@
when: when:
wfo_router.router.vendor == "juniper" wfo_router.router.vendor == "juniper"
- name: Include configure storage tasks
- name: Generate an ID for this run ansible.builtin.include_tasks: configure_storage.yaml
ansible.builtin.set_fact:
opid: "{{ lookup('community.general.random_string', length=18, special=false) }}"
config_is_different: "False"
- name: Print the ID
ansible.builtin.debug:
msg: "{{ opid }}"
- name: Merge the variables - name: Merge the variables
when: verb in verbs when: verb in verbs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment