2016-10-28 20:50:29 +02:00
|
|
|
---
|
2017-12-20 15:03:29 +01:00
|
|
|
- debug: msg="START cli/toplevel_after.yaml on connection={{ ansible_connection }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- name: setup
|
|
|
|
ios_config:
|
|
|
|
lines:
|
|
|
|
- "snmp-server contact ansible"
|
2017-01-20 21:18:12 +01:00
|
|
|
- "hostname {{ shorter_hostname }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
match: none
|
2018-02-02 15:50:15 +01:00
|
|
|
provider: "{{ cli }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- name: configure top level command with before
|
|
|
|
ios_config:
|
|
|
|
lines: ['hostname foo']
|
|
|
|
after: ['snmp-server contact bar']
|
2018-02-02 15:50:15 +01:00
|
|
|
provider: "{{ cli }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
- "'hostname foo' in result.updates"
|
|
|
|
- "'snmp-server contact bar' in result.updates"
|
|
|
|
|
|
|
|
- name: configure top level command with before idempotent check
|
|
|
|
ios_config:
|
|
|
|
lines: ['hostname foo']
|
|
|
|
after: ['snmp-server contact foo']
|
2018-02-02 15:50:15 +01:00
|
|
|
provider: "{{ cli }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: teardown
|
|
|
|
ios_config:
|
|
|
|
lines:
|
|
|
|
- "no snmp-server contact"
|
2017-01-20 21:18:12 +01:00
|
|
|
- "hostname {{ shorter_hostname }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
match: none
|
2018-02-02 15:50:15 +01:00
|
|
|
provider: "{{ cli }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
2017-12-20 15:03:29 +01:00
|
|
|
- debug: msg="END cli/toplevel_after.yaml on connection={{ ansible_connection }}"
|