2017-07-17 03:44:09 +02:00
|
|
|
---
|
|
|
|
- debug: msg="START junos_lldp netconf/basic.yaml"
|
|
|
|
|
2017-07-18 08:44:10 +02:00
|
|
|
- name: setup - Disable lldp and remove it's configuration
|
2017-07-17 03:44:09 +02:00
|
|
|
junos_lldp:
|
|
|
|
state: absent
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
|
2017-07-18 08:44:10 +02:00
|
|
|
- name: Enable lldp
|
2017-07-17 03:44:09 +02:00
|
|
|
junos_lldp:
|
|
|
|
state: present
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
2017-07-18 08:44:10 +02:00
|
|
|
- name: Enable lldp (idempotent)
|
2017-07-17 03:44:09 +02:00
|
|
|
junos_lldp:
|
|
|
|
state: present
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2017-07-18 08:44:10 +02:00
|
|
|
- name: configure lldp parameters and enable lldp
|
2017-07-17 03:44:09 +02:00
|
|
|
junos_lldp:
|
2017-07-18 08:44:10 +02:00
|
|
|
interval: 10
|
|
|
|
hold_multiplier: 5
|
2017-08-04 12:04:42 +02:00
|
|
|
transmit_delay: 2
|
2017-07-18 08:44:10 +02:00
|
|
|
state: present
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-08-02 10:41:10 +02:00
|
|
|
- result.diff.prepared | search("\+ *advertisement-interval 10")
|
2017-08-04 12:46:35 +02:00
|
|
|
- result.diff.prepared | search("\+ *transmit-delay 2")
|
2017-08-02 10:41:10 +02:00
|
|
|
- result.diff.prepared | search("\+ *hold-multiplier 5")
|
2017-07-18 08:44:10 +02:00
|
|
|
|
|
|
|
- name: configure lldp parameters and enable lldp(idempotent)
|
|
|
|
junos_lldp:
|
|
|
|
interval: 10
|
|
|
|
hold_multiplier: 5
|
2017-08-04 12:57:36 +02:00
|
|
|
transmit_delay: 2
|
2017-07-18 08:44:10 +02:00
|
|
|
state: present
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: configure lldp parameters and disable lldp
|
|
|
|
junos_lldp:
|
|
|
|
interval: 10
|
|
|
|
hold_multiplier: 5
|
2017-08-04 12:57:36 +02:00
|
|
|
transmit_delay: 2
|
2017-07-18 08:44:10 +02:00
|
|
|
state: disabled
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-08-02 10:41:10 +02:00
|
|
|
- result.diff.prepared | search("\+ *disable")
|
2017-07-18 08:44:10 +02:00
|
|
|
- "'advertisement-interval 10;' not in result.diff.prepared"
|
2017-08-04 12:57:36 +02:00
|
|
|
- "'transmit-delay 2;' not in result.diff.prepared"
|
2017-07-18 08:44:10 +02:00
|
|
|
- "'hold-multiplier 5;' not in result.diff.prepared"
|
|
|
|
|
|
|
|
- name: configure lldp parameters and enable lldp
|
|
|
|
junos_lldp:
|
|
|
|
interval: 10
|
|
|
|
hold_multiplier: 5
|
2017-08-04 12:57:36 +02:00
|
|
|
transmit_delay: 2
|
2017-07-18 08:44:10 +02:00
|
|
|
state: enabled
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-08-02 10:41:10 +02:00
|
|
|
- result.diff.prepared | search("\- *disable")
|
2017-07-18 08:44:10 +02:00
|
|
|
- "'advertisement-interval 10;' not in result.diff.prepared"
|
2017-08-04 12:57:36 +02:00
|
|
|
- "'transmit-delay 2;' not in result.diff.prepared"
|
2017-07-18 08:44:10 +02:00
|
|
|
- "'hold-multiplier 5;' not in result.diff.prepared"
|
|
|
|
|
|
|
|
- name: Remove lldp configuration and diable lldp
|
|
|
|
junos_lldp:
|
|
|
|
interval: 10
|
|
|
|
hold_multiplier: 5
|
2017-08-04 12:57:36 +02:00
|
|
|
transmit_delay: 2
|
2017-07-17 03:44:09 +02:00
|
|
|
state: absent
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-08-02 10:41:10 +02:00
|
|
|
- result.diff.prepared | search("\+ *disable")
|
|
|
|
- result.diff.prepared | search("\- *advertisement-interval 10")
|
2017-08-04 12:57:36 +02:00
|
|
|
- result.diff.prepared | search("\- *transmit-delay 2")
|
2017-08-02 10:41:10 +02:00
|
|
|
- result.diff.prepared | search("\- *hold-multiplier 5")
|
2017-07-17 03:44:09 +02:00
|
|
|
|
2017-07-18 08:44:10 +02:00
|
|
|
- name: Remove lldp (idempotent)
|
2017-07-17 03:44:09 +02:00
|
|
|
junos_lldp:
|
|
|
|
state: absent
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|