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
|
|
|
|
transmit_delay: 30
|
|
|
|
state: present
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
- "'+ advertisement-interval 10;' in result.diff.prepared"
|
|
|
|
- "'+ transmit-delay 30;' in result.diff.prepared"
|
|
|
|
- "'+ hold-multiplier 5;' in result.diff.prepared"
|
|
|
|
|
|
|
|
- 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"
|
|
|
|
- "'+ disable;' in result.diff.prepared"
|
|
|
|
- "'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"
|
|
|
|
- "'- disable;' in result.diff.prepared"
|
|
|
|
- "'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 03:44:09 +02:00
|
|
|
state: absent
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-07-18 08:44:10 +02:00
|
|
|
- "'+ disable;' in result.diff.prepared"
|
|
|
|
- "'- advertisement-interval 10;' in result.diff.prepared"
|
|
|
|
- "'- transmit-delay 30;' in result.diff.prepared"
|
|
|
|
- "'- hold-multiplier 5;' in result.diff.prepared"
|
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"
|