2017-06-23 16:38:12 +02:00
|
|
|
---
|
2018-01-10 16:58:49 +01:00
|
|
|
- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}"
|
2017-06-23 16:38:12 +02:00
|
|
|
|
|
|
|
- name: setup
|
|
|
|
vyos_config:
|
|
|
|
lines:
|
2018-05-30 19:03:20 +02:00
|
|
|
- delete system name-server 192.0.2.1
|
|
|
|
- delete system name-server 192.0.2.2
|
|
|
|
- delete system name-server 192.0.2.3
|
2017-06-23 16:38:12 +02:00
|
|
|
match: none
|
|
|
|
|
2017-11-08 17:09:21 +01:00
|
|
|
- name: configure name servers
|
2018-01-10 16:58:49 +01:00
|
|
|
vyos_system:
|
2017-06-23 16:38:12 +02:00
|
|
|
name_servers:
|
2018-05-30 19:03:20 +02:00
|
|
|
- 192.0.2.1
|
|
|
|
- 192.0.2.2
|
|
|
|
- 192.0.2.3
|
2017-06-23 16:38:12 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- result.changed == true
|
|
|
|
- result.commands|length == 3
|
2018-05-30 19:03:20 +02:00
|
|
|
- result.commands[0] is search("set system name-server '192.0.2.1'")
|
|
|
|
- result.commands[1] is search("set system name-server '192.0.2.2'")
|
|
|
|
- result.commands[2] is search("set system name-server '192.0.2.3'")
|
2017-06-23 16:38:12 +02:00
|
|
|
|
|
|
|
- name: verify name_servers
|
2018-01-10 16:58:49 +01:00
|
|
|
vyos_system:
|
2017-06-23 16:38:12 +02:00
|
|
|
name_servers:
|
2018-05-30 19:03:20 +02:00
|
|
|
- 192.0.2.1
|
|
|
|
- 192.0.2.2
|
|
|
|
- 192.0.2.3
|
2017-06-23 16:38:12 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- result.changed == false
|
|
|
|
|
|
|
|
- name: remove one
|
2018-01-10 16:58:49 +01:00
|
|
|
vyos_system:
|
2017-06-23 16:38:12 +02:00
|
|
|
name_servers:
|
2018-05-30 19:03:20 +02:00
|
|
|
- 192.0.2.3
|
2017-11-08 17:09:21 +01:00
|
|
|
state: absent
|
2017-06-23 16:38:12 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- result.changed == true
|
|
|
|
- result.commands|length == 1
|
2018-05-30 19:03:20 +02:00
|
|
|
- result.commands[0] is search("delete system name-server '192.0.2.3'")
|
2017-06-23 16:38:12 +02:00
|
|
|
|
|
|
|
- name: teardown
|
|
|
|
vyos_config:
|
|
|
|
lines:
|
2018-05-30 19:03:20 +02:00
|
|
|
- delete system name-server name-server 192.0.2.1
|
|
|
|
- delete system name-server name-server 192.0.2.2
|
|
|
|
- delete system name-server name-server 192.0.2.3
|
2017-06-23 16:38:12 +02:00
|
|
|
match: none
|
|
|
|
|
2018-01-10 16:58:49 +01:00
|
|
|
- debug: msg="END cli/basic.yaml on connection={{ ansible_connection }}"
|