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-11-27 23:58:08 +01:00
|
|
|
- result.diff.prepared is search("\+ *advertisement-interval 10")
|
|
|
|
- result.diff.prepared is search("\+ *transmit-delay 2")
|
|
|
|
- result.diff.prepared is 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-11-27 23:58:08 +01:00
|
|
|
- result.diff.prepared is 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-11-27 23:58:08 +01:00
|
|
|
- result.diff.prepared is 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-11-27 23:58:08 +01:00
|
|
|
- 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")
|
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"
|