2017-07-17 03:44:09 +02:00
|
|
|
---
|
|
|
|
- debug: msg="START net_lldp junos/basic.yaml"
|
|
|
|
|
2017-10-31 10:51:27 +01:00
|
|
|
- name: setup - Disable lldp and remove it's configuration
|
2017-07-17 03:44:09 +02:00
|
|
|
net_lldp:
|
|
|
|
state: absent
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
|
2017-10-31 10:51:27 +01:00
|
|
|
- name: Enable lldp
|
2017-07-17 03:44:09 +02:00
|
|
|
net_lldp:
|
|
|
|
state: present
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
2017-10-31 10:51:27 +01:00
|
|
|
- name: Enable lldp (idempotent)
|
2017-07-17 03:44:09 +02:00
|
|
|
net_lldp:
|
|
|
|
state: present
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2017-10-31 10:51:27 +01:00
|
|
|
- name: configure lldp parameters and enable lldp
|
|
|
|
net_lldp:
|
|
|
|
interval: 10
|
|
|
|
hold_multiplier: 5
|
|
|
|
transmit_delay: 2
|
|
|
|
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-10-31 10:51:27 +01:00
|
|
|
|
|
|
|
- name: configure lldp parameters and enable lldp(idempotent)
|
|
|
|
net_lldp:
|
|
|
|
interval: 10
|
|
|
|
hold_multiplier: 5
|
|
|
|
transmit_delay: 2
|
|
|
|
state: present
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: configure lldp parameters and disable lldp
|
|
|
|
net_lldp:
|
|
|
|
interval: 10
|
|
|
|
hold_multiplier: 5
|
|
|
|
transmit_delay: 2
|
|
|
|
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-10-31 10:51:27 +01:00
|
|
|
- "'advertisement-interval 10;' not in result.diff.prepared"
|
|
|
|
- "'transmit-delay 2;' not in result.diff.prepared"
|
|
|
|
- "'hold-multiplier 5;' not in result.diff.prepared"
|
|
|
|
|
|
|
|
- name: configure lldp parameters and enable lldp
|
|
|
|
net_lldp:
|
|
|
|
interval: 10
|
|
|
|
hold_multiplier: 5
|
|
|
|
transmit_delay: 2
|
|
|
|
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-10-31 10:51:27 +01:00
|
|
|
- "'advertisement-interval 10;' not in result.diff.prepared"
|
|
|
|
- "'transmit-delay 2;' not in result.diff.prepared"
|
|
|
|
- "'hold-multiplier 5;' not in result.diff.prepared"
|
|
|
|
|
|
|
|
- name: Remove lldp configuration and diable lldp
|
2017-07-17 03:44:09 +02:00
|
|
|
net_lldp:
|
2017-10-31 10:51:27 +01:00
|
|
|
interval: 10
|
|
|
|
hold_multiplier: 5
|
|
|
|
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-10-31 10:51:27 +01:00
|
|
|
- name: Remove lldp (idempotent)
|
2017-07-17 03:44:09 +02:00
|
|
|
net_lldp:
|
|
|
|
state: absent
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|