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:
|
2017-11-08 17:09:21 +01:00
|
|
|
- delete system name-server 1.1.1.1
|
|
|
|
- delete system name-server 2.2.2.2
|
|
|
|
- delete system name-server 3.3.3.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:
|
|
|
|
- 1.1.1.1
|
|
|
|
- 2.2.2.2
|
|
|
|
- 3.3.3.3
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- result.changed == true
|
|
|
|
- result.commands|length == 3
|
2017-11-27 23:58:08 +01:00
|
|
|
- result.commands[0] is search("set system name-server '1.1.1.1'")
|
|
|
|
- result.commands[1] is search("set system name-server '2.2.2.2'")
|
|
|
|
- result.commands[2] is search("set system name-server '3.3.3.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:
|
|
|
|
- 1.1.1.1
|
|
|
|
- 2.2.2.2
|
|
|
|
- 3.3.3.3
|
|
|
|
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:
|
2017-11-08 17:09:21 +01:00
|
|
|
- 3.3.3.3
|
|
|
|
state: absent
|
2017-06-23 16:38:12 +02:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- result.changed == true
|
|
|
|
- result.commands|length == 1
|
2017-11-27 23:58:08 +01:00
|
|
|
- result.commands[0] is search("delete system name-server '3.3.3.3'")
|
2017-06-23 16:38:12 +02:00
|
|
|
|
|
|
|
- name: teardown
|
|
|
|
vyos_config:
|
|
|
|
lines:
|
2017-11-08 17:09:21 +01:00
|
|
|
- delete system name-server name-server 1.1.1.1
|
|
|
|
- delete system name-server name-server 2.2.2.2
|
|
|
|
- delete system name-server name-server 3.3.3.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 }}"
|