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
No related branches found
No related tags found
1 merge request!260Feature/nat 1090 common storage
......@@ -18,15 +18,15 @@
- name: Create a folder for all the things
ansible.builtin.file:
path: "/var/tmp/ansible_run_{{ opid }}"
path: "{{ play_storage_path }}"
state: directory
mode: '0755'
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:
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
trim_blocks: true
mode: '0755'
......
../../../playbooks/configure_storage.yaml
\ No newline at end of file
- name: Deploy base_config on "{{ inventory_hostname }}" [CHECK ONLY][Juniper]
junipernetworks.junos.junos_config:
update: 'replace'
src: "/var/tmp/ansible_run_{{ opid }}/{{ mytemplates.template_name }}.conf"
src: "{{ play_storage_path }}/{{ mytemplates.template_name }}.conf"
src_format: text
check_commit: true
diff: true
......@@ -17,7 +17,7 @@
- name: Deploy base_config on "{{ inventory_hostname }}" [AND COMMIT][Juniper]
junipernetworks.junos.junos_config:
update: 'replace'
src: "/var/tmp/ansible_run_{{ opid }}/{{ mytemplates.template_name }}.conf"
src: "{{ play_storage_path }}/{{ mytemplates.template_name }}.conf"
src_format: text
comment: "{{ commit_comment }}"
diff: true
......
......@@ -39,17 +39,8 @@
when:
wfo_router.router.vendor == "juniper"
- name: Generate an ID for this run
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: Include configure storage tasks
ansible.builtin.include_tasks: configure_storage.yaml
- name: Merge the variables
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