mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.4 KiB
YAML
62 lines
1.4 KiB
YAML
7 years ago
|
---
|
||
7 years ago
|
- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}"
|
||
7 years ago
|
|
||
|
- name: setup
|
||
|
vyos_config:
|
||
|
lines:
|
||
7 years ago
|
- delete system name-server 1.1.1.1
|
||
|
- delete system name-server 2.2.2.2
|
||
|
- delete system name-server 3.3.3.3
|
||
7 years ago
|
match: none
|
||
|
|
||
7 years ago
|
- name: configure name servers
|
||
7 years ago
|
vyos_system:
|
||
7 years ago
|
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
|
||
7 years ago
|
- 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'")
|
||
7 years ago
|
|
||
|
- name: verify name_servers
|
||
7 years ago
|
vyos_system:
|
||
7 years ago
|
name_servers:
|
||
|
- 1.1.1.1
|
||
|
- 2.2.2.2
|
||
|
- 3.3.3.3
|
||
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- result.changed == false
|
||
|
|
||
|
- name: remove one
|
||
7 years ago
|
vyos_system:
|
||
7 years ago
|
name_servers:
|
||
7 years ago
|
- 3.3.3.3
|
||
|
state: absent
|
||
7 years ago
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- result.changed == true
|
||
|
- result.commands|length == 1
|
||
7 years ago
|
- result.commands[0] is search("delete system name-server '3.3.3.3'")
|
||
7 years ago
|
|
||
|
- name: teardown
|
||
|
vyos_config:
|
||
|
lines:
|
||
7 years ago
|
- 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
|
||
7 years ago
|
match: none
|
||
|
|
||
7 years ago
|
- debug: msg="END cli/basic.yaml on connection={{ ansible_connection }}"
|