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.
77 lines
1.8 KiB
YAML
77 lines
1.8 KiB
YAML
---
|
|
- debug: msg="START cli/set_lookup_source.yaml"
|
|
|
|
- name: setup
|
|
ios_config:
|
|
lines:
|
|
- no ip domain lookup source-interface
|
|
- vrf definition ansible
|
|
match: none
|
|
authorize: yes
|
|
provider: "{{ cli }}"
|
|
|
|
- name: configure lookup_source
|
|
ios_system:
|
|
lookup_source: Loopback10
|
|
provider: "{{ cli }}"
|
|
authorize: yes
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result.changed == true
|
|
- "'ip domain lookup source-interface Loopback10' in result.commands"
|
|
|
|
- name: verify lookup_source
|
|
ios_system:
|
|
lookup_source: Loopback10
|
|
provider: "{{ cli }}"
|
|
authorize: yes
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result.changed == false
|
|
|
|
#- name: change to vrf
|
|
# ios_system:
|
|
# lookup_source:
|
|
# - interface: Loopback10
|
|
# vrf: ansible
|
|
# authorize: yes
|
|
# provider: "{{ cli }}"
|
|
# register: result
|
|
#
|
|
#- assert:
|
|
# that:
|
|
# - result.changed == true
|
|
# - "'no ip domain lookup source-interface Management1' in result.commands"
|
|
# - "'ip domain lookup vrf ansible source-interface Management1' in result.commands"
|
|
# - result.commands|length == 2
|
|
#
|
|
#- name: verify change to vrf
|
|
# ios_system:
|
|
# lookup_source:
|
|
# - interface: Management1
|
|
# vrf: ansible
|
|
# authorize: yes
|
|
# provider: "{{ cli }}"
|
|
# register: result
|
|
#
|
|
#- assert:
|
|
# that:
|
|
# - result.changed == false
|
|
|
|
- name: teardown
|
|
ios_config:
|
|
lines:
|
|
- no ip domain lookup source-interface
|
|
- no vrf definition ansible
|
|
match: none
|
|
authorize: yes
|
|
provider: "{{ cli }}"
|
|
ignore_errors: yes
|
|
# FIXME: Not sure why this is failing with msg": "no vrf definition ansible\r\n% IPv4 and IPv6 addresses from all interfaces in VRF ansible have been removed\r\nfoo(config)#", rc:1
|
|
|
|
- debug: msg="END cli/set_lookup_source.yaml"
|