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

Merge branch 'base_config_update' into 'develop'

remote user should be now passed as environmental var

See merge request !106
parents c4a90258 c0c537e1
No related branches found
No related tags found
1 merge request!106remote user should be now passed as environmental var
Pipeline #85739 passed
- name: Manage base config playbook - name: Manage base config playbook
hosts: all hosts: all
gather_facts: false gather_facts: false
remote_user: admin # remote_user: admin
# remote_user: geant-gap-test
roles: roles:
- Juniper.junos - Juniper.junos
- ../roles/base_config - ../roles/base_config
- name: Deploy base_config on "{{ inventory_hostname }}" [CHECK ONLY][Juniper] - name: Deploy base_config on "{{ inventory_hostname }}" [CHECK ONLY][Juniper]
juniper_junos_config: junipernetworks.junos.junos_config:
load: 'replace' update: 'replace'
src: "/var/tmp/ansible_run_{{ opid }}/{{ mytemplates.template_name }}.conf" src: "/var/tmp/ansible_run_{{ opid }}/{{ mytemplates.template_name }}.conf"
format: text src_format: text
config_mode: "private" check_commit: true
check: true diff: true
commit: false
register: response
when: > when: >
verb == "deploy" and verb == "deploy" and
( dry_run | ansible.builtin.bool ) is true and ( dry_run | ansible.builtin.bool ) is true and
wfo_router.router.vendor == "juniper" wfo_router.router.vendor == "juniper"
- name: Show diff for dry run
ansible.builtin.debug:
msg: "{{ response }}"
when: >
verb == "deploy" and
( dry_run | ansible.builtin.bool ) is true and
wfo_router.router.vendor == "juniper"
- name: Deploy base_config on "{{ inventory_hostname }}" [AND COMMIT][Juniper] - name: Deploy base_config on "{{ inventory_hostname }}" [AND COMMIT][Juniper]
juniper_junos_config: junipernetworks.junos.junos_config:
load: 'replace' update: 'replace'
src: "/var/tmp/ansible_run_{{ opid }}/{{ mytemplates.template_name }}.conf" src: "/var/tmp/ansible_run_{{ opid }}/{{ mytemplates.template_name }}.conf"
format: text src_format: text
config_mode: "private"
comment: "{{ commit_comment }}" comment: "{{ commit_comment }}"
register: response register: response
when: > when: >
...@@ -33,13 +23,13 @@ ...@@ -33,13 +23,13 @@
( dry_run | ansible.builtin.bool ) is false and ( dry_run | ansible.builtin.bool ) is false and
wfo_router.router.vendor == "juniper" wfo_router.router.vendor == "juniper"
- name: Show diff # - name: Show diff
ansible.builtin.debug: # ansible.builtin.debug:
msg: "{{ response }}" # msg: "{{ response }}"
when: > # when: >
verb == "deploy" and # verb == "deploy" and
( dry_run | ansible.builtin.bool ) is false and # ( dry_run | ansible.builtin.bool ) is false and
wfo_router.router.vendor == "juniper" # wfo_router.router.vendor == "juniper"
- name: Deploy base_config on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA] - name: Deploy base_config on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA]
ansible.netcommon.netconf_config: ansible.netcommon.netconf_config:
......
...@@ -17,4 +17,4 @@ is_ias_connected: "{{ wfo_router.router.is_ias_connected }}" ...@@ -17,4 +17,4 @@ is_ias_connected: "{{ wfo_router.router.is_ias_connected }}"
mytemplates: mytemplates:
template_name: base_config template_name: base_config
template_path: "routers/{{ wfo_router.vendor }}/base_config.j2" template_path: "routers/{{ wfo_router.router.vendor }}/base_config.j2"
- name: Base config Juniper checks
juniernetworks.junos.junos_command:
commands:
- show version
- show system alarms
...@@ -20,6 +20,14 @@ ...@@ -20,6 +20,14 @@
when: when:
wfo_router.router.vendor == "juniper" wfo_router.router.vendor == "juniper"
- name: Execute post-check command - name: Execute post-check command [NOKIA]
when:
wfo_router.router.vendor == "nokia"
ansible.builtin.include_tasks: base_config_single_command.yaml ansible.builtin.include_tasks: base_config_single_command.yaml
with_items: "{{ commands }}" with_items: "{{ commands }}"
- name: Execute post-check command [JUNIPER]
when:
wfo_router.router.vendor == "juniper"
ansible.builtin.include_tasks: base_config_checks_juniper.yaml
# with_items: "{{ commands }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment