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