2016-10-28 20:50:29 +02:00
|
|
|
---
|
2017-12-13 20:30:24 +01:00
|
|
|
- debug: msg="START cli/simple.yaml on connection={{ ansible_connection }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- name: setup
|
|
|
|
vyos_config:
|
2017-01-09 18:21:04 +01:00
|
|
|
lines: set system host-name {{ inventory_hostname_short }}
|
2016-10-28 20:50:29 +02:00
|
|
|
match: none
|
|
|
|
|
|
|
|
- name: configure simple config command
|
|
|
|
vyos_config:
|
|
|
|
lines: set system host-name foo
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-02-26 03:14:40 +01:00
|
|
|
- "'set system host-name foo' in result.commands"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- name: check simple config command idempontent
|
|
|
|
vyos_config:
|
|
|
|
lines: set system host-name foo
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2020-01-06 11:50:36 +01:00
|
|
|
- name: Delete services
|
|
|
|
vyos_config: &del
|
|
|
|
lines:
|
|
|
|
- delete service lldp
|
|
|
|
- delete protocols static
|
|
|
|
|
2020-01-03 13:05:37 +01:00
|
|
|
- name: Configuring when commands starts with whitespaces
|
|
|
|
vyos_config:
|
|
|
|
src: "{{ role_path }}/tests/cli/config.cfg"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
- '"set service lldp" in result.commands'
|
|
|
|
- '"set protocols static" in result.commands'
|
|
|
|
|
2020-01-06 11:50:36 +01:00
|
|
|
- name: Delete services
|
|
|
|
vyos_config: *del
|
2020-01-03 13:05:37 +01:00
|
|
|
|
2016-10-28 20:50:29 +02:00
|
|
|
- name: teardown
|
|
|
|
vyos_config:
|
2017-01-09 18:21:04 +01:00
|
|
|
lines: set system host-name {{ inventory_hostname_short }}
|
2016-10-28 20:50:29 +02:00
|
|
|
match: none
|
|
|
|
|
2017-12-13 20:30:24 +01:00
|
|
|
- debug: msg="END cli/simple.yaml on connection={{ ansible_connection }}"
|