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

Add validation steps to the `iptrunk` deploy

parent b8d5857e
No related branches found
No related tags found
1 merge request!152IPtrunk: validation workflow additions
...@@ -6,11 +6,22 @@ ...@@ -6,11 +6,22 @@
src_format: text src_format: text
check_commit: true check_commit: true
diff: true diff: true
register: output
when: > when: >
verb == "deploy" and verb == "deploy" and
local_side.iptrunk_side_node.vendor == "juniper" and local_side.iptrunk_side_node.vendor == "juniper" and
dry_run | ansible.builtin.bool dry_run | ansible.builtin.bool
- name: Fail if there is any diff
ansible.builtin.fail:
msg: Trunk config drift detected!!!
when: >
output.changed | ansible.builtin.bool
and
is_verification_workflow | ansible.builtin.bool
and
local_side.iptrunk_side_node.vendor == "juniper"
- name: Deploy "{{ config_object }}" on "{{ inventory_hostname }}" [AND COMMIT][JUNIPER] - name: Deploy "{{ config_object }}" on "{{ inventory_hostname }}" [AND COMMIT][JUNIPER]
junipernetworks.junos.junos_config: junipernetworks.junos.junos_config:
update: 'replace' update: 'replace'
...@@ -23,14 +34,6 @@ ...@@ -23,14 +34,6 @@
local_side.iptrunk_side_node.vendor == "juniper" and local_side.iptrunk_side_node.vendor == "juniper" and
not (dry_run | ansible.builtin.bool) not (dry_run | ansible.builtin.bool)
# - name: Show real diff of "{{ config_object }}"
# ansible.builtin.debug:
# msg: "{{ response }}"
# when: >
# verb == "deploy" and
# local_side.iptrunk_side_node.vendor == "juniper" and
# not (dry_run | ansible.builtin.bool)
- name: Deploy "{{ config_object }}" on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA] - name: Deploy "{{ config_object }}" on "{{ inventory_hostname }}" [CHECK ONLY][NOKIA]
# ansible.netcommon.netconf_config: # ansible.netcommon.netconf_config:
geant.gap_ansible.nokia_netconf_config: geant.gap_ansible.nokia_netconf_config:
...@@ -39,12 +42,23 @@ ...@@ -39,12 +42,23 @@
content: "{{ lookup('ansible.builtin.template', '{{ local_side.iptrunk_side_node.vendor }}/{{ config_object }}.j2') }}" content: "{{ lookup('ansible.builtin.template', '{{ local_side.iptrunk_side_node.vendor }}/{{ config_object }}.j2') }}"
commit: true commit: true
diff: true diff: true
register: output
check_mode: true check_mode: true
when: > when: >
verb == "deploy" and verb == "deploy" and
( dry_run | ansible.builtin.bool ) is true and ( dry_run | ansible.builtin.bool ) is true and
local_side.iptrunk_side_node.vendor == "nokia" local_side.iptrunk_side_node.vendor == "nokia"
- name: Fail if there is any diff
ansible.builtin.fail:
msg: Trunk config drift detected!!!
when: >
output.changed | ansible.builtin.bool
and
is_verification_workflow | ansible.builtin.bool
and
local_side.iptrunk_side_node.vendor == "nokia"
- name: Deploy "{{ config_object }}"on "{{ inventory_hostname }}" [AND COMMIT][NOKIA] - name: Deploy "{{ config_object }}"on "{{ inventory_hostname }}" [AND COMMIT][NOKIA]
# ansible.netcommon.netconf_config: # ansible.netcommon.netconf_config:
geant.gap_ansible.nokia_netconf_config: geant.gap_ansible.nokia_netconf_config:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment