mirror of https://github.com/ansible/ansible.git
Fix junos integration zuul CI failures (#57309)
parent
51229eb99c
commit
a867ced4de
@ -1,119 +1,138 @@
|
|||||||
---
|
---
|
||||||
- debug: msg="START junos_lldp netconf/basic.yaml on connection={{ ansible_connection }}"
|
- debug: msg="START junos_lldp netconf/basic.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
||||||
- name: setup - Disable lldp and remove it's configuration
|
- name: get supported protocols
|
||||||
junos_lldp:
|
junos_command:
|
||||||
state: absent
|
commands: show lldp
|
||||||
provider: "{{ netconf }}"
|
|
||||||
|
|
||||||
- name: Enable lldp
|
|
||||||
junos_lldp:
|
|
||||||
state: present
|
|
||||||
provider: "{{ netconf }}"
|
|
||||||
register: result
|
register: result
|
||||||
|
ignore_errors: yes
|
||||||
- assert:
|
|
||||||
that:
|
- name: lldp supported
|
||||||
- "result.changed == true"
|
set_fact:
|
||||||
|
lldp_supported: True
|
||||||
- name: Enable lldp (idempotent)
|
when: not result.failed
|
||||||
junos_lldp:
|
|
||||||
state: present
|
- name: lldp not supported
|
||||||
provider: "{{ netconf }}"
|
set_fact:
|
||||||
register: result
|
lldp_supported: False
|
||||||
|
when: result.failed
|
||||||
- assert:
|
|
||||||
that:
|
- block:
|
||||||
- "result.changed == false"
|
- name: setup - Disable lldp and remove it's configuration
|
||||||
|
junos_lldp:
|
||||||
- name: configure lldp parameters and enable lldp
|
state: absent
|
||||||
junos_lldp:
|
provider: "{{ netconf }}"
|
||||||
interval: 10
|
|
||||||
hold_multiplier: 5
|
- name: Enable lldp
|
||||||
transmit_delay: 2
|
junos_lldp:
|
||||||
state: present
|
state: present
|
||||||
provider: "{{ netconf }}"
|
provider: "{{ netconf }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "result.changed == true"
|
- "result.changed == true"
|
||||||
- result.diff.prepared is search("\+ *advertisement-interval 10")
|
|
||||||
- result.diff.prepared is search("\+ *transmit-delay 2")
|
- name: Enable lldp (idempotent)
|
||||||
- result.diff.prepared is search("\+ *hold-multiplier 5")
|
junos_lldp:
|
||||||
|
state: present
|
||||||
- name: configure lldp parameters and enable lldp(idempotent)
|
provider: "{{ netconf }}"
|
||||||
junos_lldp:
|
register: result
|
||||||
interval: 10
|
|
||||||
hold_multiplier: 5
|
- assert:
|
||||||
transmit_delay: 2
|
that:
|
||||||
state: present
|
- "result.changed == false"
|
||||||
provider: "{{ netconf }}"
|
|
||||||
register: result
|
- name: configure lldp parameters and enable lldp
|
||||||
|
junos_lldp:
|
||||||
- assert:
|
interval: 10
|
||||||
that:
|
hold_multiplier: 5
|
||||||
- "result.changed == false"
|
transmit_delay: 2
|
||||||
|
state: present
|
||||||
- name: configure lldp parameters and disable lldp
|
provider: "{{ netconf }}"
|
||||||
junos_lldp:
|
register: result
|
||||||
interval: 10
|
|
||||||
hold_multiplier: 5
|
- assert:
|
||||||
transmit_delay: 2
|
that:
|
||||||
state: disabled
|
- "result.changed == true"
|
||||||
provider: "{{ netconf }}"
|
- result.diff.prepared is search("\+ *advertisement-interval 10")
|
||||||
register: result
|
- result.diff.prepared is search("\+ *transmit-delay 2")
|
||||||
|
- result.diff.prepared is search("\+ *hold-multiplier 5")
|
||||||
- assert:
|
|
||||||
that:
|
- name: configure lldp parameters and enable lldp(idempotent)
|
||||||
- "result.changed == true"
|
junos_lldp:
|
||||||
- result.diff.prepared is search("\+ *disable")
|
interval: 10
|
||||||
- "'advertisement-interval 10;' not in result.diff.prepared"
|
hold_multiplier: 5
|
||||||
- "'transmit-delay 2;' not in result.diff.prepared"
|
transmit_delay: 2
|
||||||
- "'hold-multiplier 5;' not in result.diff.prepared"
|
state: present
|
||||||
|
provider: "{{ netconf }}"
|
||||||
- name: configure lldp parameters and enable lldp
|
register: result
|
||||||
junos_lldp:
|
|
||||||
interval: 10
|
- assert:
|
||||||
hold_multiplier: 5
|
that:
|
||||||
transmit_delay: 2
|
- "result.changed == false"
|
||||||
state: enabled
|
|
||||||
provider: "{{ netconf }}"
|
- name: configure lldp parameters and disable lldp
|
||||||
register: result
|
junos_lldp:
|
||||||
|
interval: 10
|
||||||
- assert:
|
hold_multiplier: 5
|
||||||
that:
|
transmit_delay: 2
|
||||||
- "result.changed == true"
|
state: disabled
|
||||||
- result.diff.prepared is search("\- *disable")
|
provider: "{{ netconf }}"
|
||||||
- "'advertisement-interval 10;' not in result.diff.prepared"
|
register: result
|
||||||
- "'transmit-delay 2;' not in result.diff.prepared"
|
|
||||||
- "'hold-multiplier 5;' not in result.diff.prepared"
|
- assert:
|
||||||
|
that:
|
||||||
- name: Remove lldp configuration and diable lldp
|
- "result.changed == true"
|
||||||
junos_lldp:
|
- result.diff.prepared is search("\+ *disable")
|
||||||
interval: 10
|
- "'advertisement-interval 10;' not in result.diff.prepared"
|
||||||
hold_multiplier: 5
|
- "'transmit-delay 2;' not in result.diff.prepared"
|
||||||
transmit_delay: 2
|
- "'hold-multiplier 5;' not in result.diff.prepared"
|
||||||
state: absent
|
|
||||||
provider: "{{ netconf }}"
|
- name: configure lldp parameters and enable lldp
|
||||||
register: result
|
junos_lldp:
|
||||||
|
interval: 10
|
||||||
- assert:
|
hold_multiplier: 5
|
||||||
that:
|
transmit_delay: 2
|
||||||
- "result.changed == true"
|
state: enabled
|
||||||
- result.diff.prepared is search("\+ *disable")
|
provider: "{{ netconf }}"
|
||||||
- result.diff.prepared is search("\- *advertisement-interval 10")
|
register: result
|
||||||
- result.diff.prepared is search("\- *transmit-delay 2")
|
|
||||||
- result.diff.prepared is search("\- *hold-multiplier 5")
|
- assert:
|
||||||
|
that:
|
||||||
- name: Remove lldp (idempotent)
|
- "result.changed == true"
|
||||||
junos_lldp:
|
- result.diff.prepared is search("\- *disable")
|
||||||
state: absent
|
- "'advertisement-interval 10;' not in result.diff.prepared"
|
||||||
provider: "{{ netconf }}"
|
- "'transmit-delay 2;' not in result.diff.prepared"
|
||||||
register: result
|
- "'hold-multiplier 5;' not in result.diff.prepared"
|
||||||
|
|
||||||
- assert:
|
- name: Remove lldp configuration and diable lldp
|
||||||
that:
|
junos_lldp:
|
||||||
- "result.changed == false"
|
interval: 10
|
||||||
|
hold_multiplier: 5
|
||||||
|
transmit_delay: 2
|
||||||
|
state: absent
|
||||||
|
provider: "{{ netconf }}"
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result.changed == true"
|
||||||
|
- result.diff.prepared is search("\+ *disable")
|
||||||
|
- result.diff.prepared is search("\- *advertisement-interval 10")
|
||||||
|
- result.diff.prepared is search("\- *transmit-delay 2")
|
||||||
|
- result.diff.prepared is search("\- *hold-multiplier 5")
|
||||||
|
|
||||||
|
- name: Remove lldp (idempotent)
|
||||||
|
junos_lldp:
|
||||||
|
state: absent
|
||||||
|
provider: "{{ netconf }}"
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result.changed == false"
|
||||||
|
|
||||||
|
when: lldp_supported
|
||||||
|
|
||||||
- debug: msg="END junos_lldp netconf/basic.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END junos_lldp netconf/basic.yaml on connection={{ ansible_connection }}"
|
||||||
|
@ -1,106 +1,124 @@
|
|||||||
---
|
---
|
||||||
- debug: msg="START junos_lldp_interface netconf/basic.yaml on connection={{ ansible_connection }}"
|
- debug: msg="START junos_lldp_interface netconf/basic.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
||||||
- name: setup - Remove lldp interface configuration
|
- name: get supported protocols
|
||||||
junos_lldp_interface:
|
junos_command:
|
||||||
name: ge-0/0/5
|
commands: show lldp
|
||||||
state: absent
|
|
||||||
provider: "{{ netconf }}"
|
|
||||||
|
|
||||||
- name: lldp interface configuration
|
|
||||||
junos_lldp_interface:
|
|
||||||
name: ge-0/0/5
|
|
||||||
state: present
|
|
||||||
provider: "{{ netconf }}"
|
|
||||||
register: result
|
register: result
|
||||||
|
ignore_errors: yes
|
||||||
- assert:
|
|
||||||
that:
|
- name: lldp supported
|
||||||
- "result.changed == true"
|
set_fact:
|
||||||
- result.diff.prepared is search("\+ *interface ge-0/0/5")
|
lldp_supported: True
|
||||||
|
when: not result.failed
|
||||||
- name: lldp interface configuration (idempotent)
|
|
||||||
junos_lldp_interface:
|
- name: lldp not supported
|
||||||
name: ge-0/0/5
|
set_fact:
|
||||||
state: present
|
lldp_supported: False
|
||||||
provider: "{{ netconf }}"
|
when: result.failed
|
||||||
register: result
|
|
||||||
|
- block:
|
||||||
- assert:
|
- name: setup - Remove lldp interface configuration
|
||||||
that:
|
junos_lldp_interface:
|
||||||
- "result.changed == false"
|
name: ge-0/0/5
|
||||||
|
state: absent
|
||||||
- name: Deactivate lldp interface configuration
|
provider: "{{ netconf }}"
|
||||||
junos_lldp_interface:
|
|
||||||
name: ge-0/0/5
|
- name: lldp interface configuration
|
||||||
state: present
|
junos_lldp_interface:
|
||||||
active: False
|
name: ge-0/0/5
|
||||||
provider: "{{ netconf }}"
|
state: present
|
||||||
register: result
|
provider: "{{ netconf }}"
|
||||||
|
register: result
|
||||||
- assert:
|
|
||||||
that:
|
- assert:
|
||||||
- "result.changed == true"
|
that:
|
||||||
- result.diff.prepared is search("! *inactive[:] interface ge-0/0/5")
|
- "result.changed == true"
|
||||||
|
- result.diff.prepared is search("\+ *interface ge-0/0/5")
|
||||||
- name: Activate lldp interface configuration
|
|
||||||
junos_lldp_interface:
|
- name: lldp interface configuration (idempotent)
|
||||||
name: ge-0/0/5
|
junos_lldp_interface:
|
||||||
state: present
|
name: ge-0/0/5
|
||||||
active: True
|
state: present
|
||||||
provider: "{{ netconf }}"
|
provider: "{{ netconf }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "result.changed == true"
|
- "result.changed == false"
|
||||||
- result.diff.prepared is search("! *active[:] interface ge-0/0/5")
|
|
||||||
|
- name: Deactivate lldp interface configuration
|
||||||
- name: Disable lldp on particular interface
|
junos_lldp_interface:
|
||||||
junos_lldp_interface:
|
name: ge-0/0/5
|
||||||
name: ge-0/0/5
|
state: present
|
||||||
state: disabled
|
active: False
|
||||||
provider: "{{ netconf }}"
|
provider: "{{ netconf }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "result.changed == true"
|
- "result.changed == true"
|
||||||
- result.diff.prepared is search("\+ *disable")
|
- result.diff.prepared is search("! *inactive[:] interface ge-0/0/5")
|
||||||
|
|
||||||
- name: Enable lldp on particular interface
|
- name: Activate lldp interface configuration
|
||||||
junos_lldp_interface:
|
junos_lldp_interface:
|
||||||
name: ge-0/0/5
|
name: ge-0/0/5
|
||||||
state: enabled
|
state: present
|
||||||
provider: "{{ netconf }}"
|
active: True
|
||||||
register: result
|
provider: "{{ netconf }}"
|
||||||
|
register: result
|
||||||
- assert:
|
|
||||||
that:
|
- assert:
|
||||||
- "result.changed == true"
|
that:
|
||||||
- result.diff.prepared is search("\- *disable")
|
- "result.changed == true"
|
||||||
|
- result.diff.prepared is search("! *active[:] interface ge-0/0/5")
|
||||||
- name: Delete lldp on particular interface
|
|
||||||
junos_lldp_interface:
|
- name: Disable lldp on particular interface
|
||||||
name: ge-0/0/5
|
junos_lldp_interface:
|
||||||
state: absent
|
name: ge-0/0/5
|
||||||
provider: "{{ netconf }}"
|
state: disabled
|
||||||
register: result
|
provider: "{{ netconf }}"
|
||||||
|
register: result
|
||||||
- assert:
|
|
||||||
that:
|
- assert:
|
||||||
- "result.changed == true"
|
that:
|
||||||
- result.diff.prepared is search("\- *interface ge-0/0/5")
|
- "result.changed == true"
|
||||||
|
- result.diff.prepared is search("\+ *disable")
|
||||||
- name: Delete lldp on particular interface (idempotent)
|
|
||||||
junos_lldp_interface:
|
- name: Enable lldp on particular interface
|
||||||
name: ge-0/0/5
|
junos_lldp_interface:
|
||||||
state: absent
|
name: ge-0/0/5
|
||||||
provider: "{{ netconf }}"
|
state: enabled
|
||||||
register: result
|
provider: "{{ netconf }}"
|
||||||
|
register: result
|
||||||
- assert:
|
|
||||||
that:
|
- assert:
|
||||||
- "result.changed == false"
|
that:
|
||||||
|
- "result.changed == true"
|
||||||
|
- result.diff.prepared is search("\- *disable")
|
||||||
|
|
||||||
|
- name: Delete lldp on particular interface
|
||||||
|
junos_lldp_interface:
|
||||||
|
name: ge-0/0/5
|
||||||
|
state: absent
|
||||||
|
provider: "{{ netconf }}"
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result.changed == true"
|
||||||
|
- result.diff.prepared is search("\- *interface ge-0/0/5")
|
||||||
|
|
||||||
|
- name: Delete lldp on particular interface (idempotent)
|
||||||
|
junos_lldp_interface:
|
||||||
|
name: ge-0/0/5
|
||||||
|
state: absent
|
||||||
|
provider: "{{ netconf }}"
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result.changed == false"
|
||||||
|
when: lldp_supported
|
||||||
|
|
||||||
- debug: msg="END junos_lldp_interface netconf/basic.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END junos_lldp_interface netconf/basic.yaml on connection={{ ansible_connection }}"
|
||||||
|
Loading…
Reference in New Issue