mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
65 lines
1.8 KiB
YAML
65 lines
1.8 KiB
YAML
|
---
|
||
|
- debug: msg="START cli/sublevel_block.yaml"
|
||
|
|
||
|
- name: setup
|
||
|
asa_command:
|
||
|
commands:
|
||
|
- show run object-group
|
||
|
provider: "{{ cli }}"
|
||
|
register: object_group
|
||
|
|
||
|
- name: setup
|
||
|
asa_config:
|
||
|
lines:
|
||
|
- no object-group network OG-ANSIBLE
|
||
|
match: none
|
||
|
provider: "{{ cli }}"
|
||
|
#when: "'object-group network OG-ANSIBLE\n' in {{ object_group.stdout }}"
|
||
|
|
||
|
- name: configure sub level command using block replace
|
||
|
asa_config:
|
||
|
lines:
|
||
|
- network-object 192.168.10.0 255.255.255.0
|
||
|
- network-object 192.168.20.0 255.255.255.0
|
||
|
- network-object 192.168.30.0 255.255.255.0
|
||
|
- network-object 192.168.40.0 255.255.255.0
|
||
|
parents: ['object-group network OG-ANSIBLE']
|
||
|
replace: block
|
||
|
after: ['exit']
|
||
|
provider: "{{ cli }}"
|
||
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- "result.changed == true"
|
||
|
- "'object-group network OG-ANSIBLE' in result.updates"
|
||
|
- "'network-object 192.168.10.0 255.255.255.0' in result.updates"
|
||
|
- "'network-object 192.168.20.0 255.255.255.0' in result.updates"
|
||
|
- "'network-object 192.168.30.0 255.255.255.0' in result.updates"
|
||
|
- "'network-object 192.168.40.0 255.255.255.0' in result.updates"
|
||
|
|
||
|
- name: check sub level command using block replace
|
||
|
asa_config:
|
||
|
lines:
|
||
|
- network-object 192.168.10.0 255.255.255.0
|
||
|
- network-object 192.168.20.0 255.255.255.0
|
||
|
- network-object 192.168.30.0 255.255.255.0
|
||
|
- network-object 192.168.40.0 255.255.255.0
|
||
|
parents: ['object-group network OG-ANSIBLE']
|
||
|
replace: block
|
||
|
after: ['exit']
|
||
|
provider: "{{ cli }}"
|
||
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- "result.changed == false"
|
||
|
|
||
|
- name: teardown
|
||
|
asa_config:
|
||
|
lines:
|
||
|
- no object-group network OG-ANSIBLE
|
||
|
provider: "{{ cli }}"
|
||
|
|
||
|
- debug: msg="END cli/sublevel_block.yaml"
|