2017-06-23 14:38:12 +00:00
|
|
|
---
|
2018-01-10 15:58:49 +00:00
|
|
|
- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}"
|
2017-06-23 14:38:12 +00:00
|
|
|
|
|
|
|
- name: setup
|
|
|
|
vyos_config:
|
|
|
|
lines:
|
2017-11-08 16:09:21 +00: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 14:38:12 +00:00
|
|
|
match: none
|
|
|
|
|
2017-11-08 16:09:21 +00:00
|
|
|
- name: configure name servers
|
2018-01-10 15:58:49 +00:00
|
|
|
vyos_system:
|
2017-06-23 14:38:12 +00: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 22:58:08 +00: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 14:38:12 +00:00
|
|
|
|
|
|
|
- name: verify name_servers
|
2018-01-10 15:58:49 +00:00
|
|
|
vyos_system:
|
2017-06-23 14:38:12 +00: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 15:58:49 +00:00
|
|
|
vyos_system:
|
2017-06-23 14:38:12 +00:00
|
|
|
name_servers:
|
2017-11-08 16:09:21 +00:00
|
|
|
- 3.3.3.3
|
|
|
|
state: absent
|
2017-06-23 14:38:12 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- result.changed == true
|
|
|
|
- result.commands|length == 1
|
2017-11-27 22:58:08 +00:00
|
|
|
- result.commands[0] is search("delete system name-server '3.3.3.3'")
|
2017-06-23 14:38:12 +00:00
|
|
|
|
|
|
|
- name: teardown
|
|
|
|
vyos_config:
|
|
|
|
lines:
|
2017-11-08 16:09:21 +00: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 14:38:12 +00:00
|
|
|
match: none
|
|
|
|
|
2018-01-10 15:58:49 +00:00
|
|
|
- debug: msg="END cli/basic.yaml on connection={{ ansible_connection }}"
|