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.
133 lines
2.6 KiB
YAML
133 lines
2.6 KiB
YAML
---
|
|
- debug: msg="START cli/set_domain_search.yaml"
|
|
|
|
- name: setup
|
|
ios_config:
|
|
lines:
|
|
- no ip domain-list ansible.com
|
|
- no ip domain-list redhat.com
|
|
match: none
|
|
authorize: yes
|
|
provider: "{{ cli }}"
|
|
|
|
- name: configure domain_search
|
|
ios_system:
|
|
domain_search:
|
|
- ansible.com
|
|
- redhat.com
|
|
provider: "{{ cli }}"
|
|
authorize: yes
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result.changed == true
|
|
- "'ip domain list ansible.com' in result.commands"
|
|
- "'ip domain list redhat.com' in result.commands"
|
|
|
|
- name: verify domain_search
|
|
ios_system:
|
|
domain_search:
|
|
- ansible.com
|
|
- redhat.com
|
|
provider: "{{ cli }}"
|
|
authorize: yes
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result.changed == false
|
|
|
|
- name: remove one entry
|
|
ios_system:
|
|
domain_search:
|
|
- ansible.com
|
|
provider: "{{ cli }}"
|
|
authorize: yes
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result.changed == true
|
|
- "'no ip domain list redhat.com' in result.commands"
|
|
|
|
- name: verify remove one entry
|
|
ios_system:
|
|
domain_search:
|
|
- ansible.com
|
|
provider: "{{ cli }}"
|
|
authorize: yes
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result.changed == false
|
|
|
|
- name: add one entry
|
|
ios_system:
|
|
domain_search:
|
|
- ansible.com
|
|
- redhat.com
|
|
provider: "{{ cli }}"
|
|
authorize: yes
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result.changed == true
|
|
- "'ip domain list redhat.com' in result.commands"
|
|
|
|
- name: verify add one entry
|
|
ios_system:
|
|
domain_search:
|
|
- ansible.com
|
|
- redhat.com
|
|
provider: "{{ cli }}"
|
|
authorize: yes
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result.changed == false
|
|
|
|
- name: add and remove one entry
|
|
ios_system:
|
|
domain_search:
|
|
- ansible.com
|
|
- eng.ansible.com
|
|
provider: "{{ cli }}"
|
|
authorize: yes
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result.changed == true
|
|
- "'no ip domain list redhat.com' in result.commands"
|
|
- "'ip domain list eng.ansible.com' in result.commands"
|
|
- result.commands|length == 2
|
|
|
|
- name: verify add and remove one entry
|
|
ios_system:
|
|
domain_search:
|
|
- ansible.com
|
|
- eng.ansible.com
|
|
provider: "{{ cli }}"
|
|
authorize: yes
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result.changed == false
|
|
|
|
- name: teardown
|
|
ios_config:
|
|
lines:
|
|
- no ip domain-list ansible.com
|
|
- no ip domain-list redhat.com
|
|
- no ip domain-list eng.ansible.com
|
|
match: none
|
|
authorize: yes
|
|
provider: "{{ cli }}"
|
|
|
|
- debug: msg="END cli/set_domain_search.yaml"
|