mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
4fe08441be
* Warn on tests used as filters * Update docs, add aliases for tests that fit more gramatically with test syntax * Fix rst formatting * Add successful filter, alias of success * Remove renamed_deprecation, it was overkill * Make directory alias for is_dir * Update tests to use proper jinja test syntax * Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax * Add conversion script, porting guide updates, and changelog updates * Update newly added uses of tests as filters * No underscore variable * Convert recent tests as filter changes to win_stat * Fix some changes related to rebasing a few integration tests * Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name * Add test for tests_as_filters_warning * Update tests as filters in newly added/modified tests * Address recent changes to several integration tests * Address recent changes in cs_vpc
297 lines
7.5 KiB
YAML
297 lines
7.5 KiB
YAML
---
|
|
- debug: msg="START junos_interface netconf/basic.yaml"
|
|
|
|
- name: setup remove interface
|
|
junos_interface:
|
|
name: ge-0/0/1
|
|
description: test-interface
|
|
state: absent
|
|
provider: "{{ netconf }}"
|
|
|
|
- name: Create interface
|
|
junos_interface:
|
|
name: ge-0/0/1
|
|
description: test-interface
|
|
state: present
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- name: Get running configuration
|
|
junos_rpc:
|
|
rpc: get-configuration
|
|
provider: "{{ netconf }}"
|
|
register: config
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
- "'<name>ge-0/0/1</name>' in config.xml"
|
|
- "'<description>test-interface</description>' in config.xml"
|
|
|
|
- name: Create interface (idempotent)
|
|
junos_interface:
|
|
name: ge-0/0/1
|
|
description: test-interface
|
|
state: present
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == false"
|
|
|
|
- name: Deactivate interface configuration
|
|
junos_interface:
|
|
name: ge-0/0/1
|
|
description: test-interface
|
|
state: present
|
|
active: False
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- name: Get running configuration
|
|
junos_rpc:
|
|
rpc: get-configuration
|
|
provider: "{{ netconf }}"
|
|
register: config
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
- "'<interface inactive=\"inactive\">' in config.xml"
|
|
- "'<name>ge-0/0/1</name>' in config.xml"
|
|
|
|
- name: Activate interface configuration
|
|
junos_interface:
|
|
name: ge-0/0/1
|
|
description: test-interface
|
|
state: present
|
|
active: True
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- name: Get running configuration
|
|
junos_rpc:
|
|
rpc: get-configuration
|
|
provider: "{{ netconf }}"
|
|
register: config
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
- "'<name>ge-0/0/1</name>' in config.xml"
|
|
|
|
- name: Configure interface attributes
|
|
junos_interface:
|
|
name: ge-0/0/1
|
|
description: test-interface
|
|
state: present
|
|
speed: 1g
|
|
mtu: 256
|
|
duplex: full
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- name: Get running configuration
|
|
junos_rpc:
|
|
rpc: get-configuration
|
|
provider: "{{ netconf }}"
|
|
register: config
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
- "'<name>ge-0/0/1</name>' in config.xml"
|
|
- "'<link-mode>full-duplex</link-mode>' in config.xml"
|
|
- "'<mtu>256</mtu>' in config.xml"
|
|
- "'<speed>1g</speed>' in config.xml"
|
|
- "'<description>test-interface</description>' in config.xml"
|
|
|
|
- name: Disable interface
|
|
junos_interface:
|
|
name: ge-0/0/1
|
|
description: test-interface
|
|
enabled: False
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
- result.diff.prepared is search("\+ *disable")
|
|
|
|
- name: Enable interface
|
|
junos_interface:
|
|
name: ge-0/0/1
|
|
description: test-interface
|
|
enabled: True
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
- result.diff.prepared is search("\- *disable")
|
|
|
|
- name: Delete interface
|
|
junos_interface:
|
|
name: ge-0/0/1
|
|
description: test-interface
|
|
state: absent
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- name: Get running configuration
|
|
junos_rpc:
|
|
rpc: get-configuration
|
|
provider: "{{ netconf }}"
|
|
register: config
|
|
|
|
- assert:
|
|
that:
|
|
- "result.changed == true"
|
|
- "'<name>ge-0/0/1</name>' not in config.xml"
|
|
|
|
- name: Aggregate setup- delete interface ge-0/0/1
|
|
junos_interface:
|
|
name: ge-0/0/1
|
|
state: absent
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- name: Aggregate setup- delete interface ge-0/0/2
|
|
junos_interface:
|
|
name: ge-0/0/2
|
|
state: absent
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- name: Set interface on aggregate
|
|
junos_interface:
|
|
aggregate:
|
|
- { name: ge-0/0/1, description: test-interface-1, speed: 1g, mtu: 512}
|
|
- { name: ge-0/0/2, description: test-interface-2, speed: 10m, mtu: 256}
|
|
duplex: full
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- result.diff.prepared is search("\+ *ge-0/0/1")
|
|
- result.diff.prepared is search("\+ *description test-interface-1")
|
|
- result.diff.prepared is search("\+ *speed 1g")
|
|
- result.diff.prepared is search("\+ *mtu 512")
|
|
- result.diff.prepared is search("\+ *link-mode full-duplex")
|
|
- result.diff.prepared is search("\+ *description test-interface-2")
|
|
- result.diff.prepared is search("\+ *speed 10m")
|
|
- result.diff.prepared is search("\+ * mtu 256")
|
|
- result.diff.prepared is search("\+ *link-mode full-duplex")
|
|
|
|
- name: Set interface on aggregate (idempotent)
|
|
junos_interface:
|
|
aggregate:
|
|
- { name: ge-0/0/1, description: test-interface-1, speed: 1g, mtu: 512 }
|
|
- { name: ge-0/0/2, description: test-interface-2, speed: 10m, mtu: 256 }
|
|
duplex: full
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == false'
|
|
|
|
- name: Disable interface on aggregate
|
|
junos_interface:
|
|
aggregate:
|
|
- name: ge-0/0/1
|
|
- name: ge-0/0/2
|
|
enabled: False
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- result.diff.prepared is search("\+ *disable")
|
|
|
|
- name: Enable interface on aggregate
|
|
junos_interface:
|
|
aggregate:
|
|
- name: ge-0/0/1
|
|
- name: ge-0/0/2
|
|
enabled: True
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- result.diff.prepared is search("\- *disable")
|
|
|
|
- name: Deactivate interface configuration on aggregate
|
|
junos_interface:
|
|
aggregate:
|
|
- { name: ge-0/0/1, description: test-interface-1, speed: 1g, mtu: 512 }
|
|
- { name: ge-0/0/2, description: test-interface-2, speed: 10m, mtu: 256 }
|
|
duplex: full
|
|
active: False
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- result.diff.prepared is search("! *inactive[:] ge-0/0/1")
|
|
- result.diff.prepared is search("! *inactive[:] ge-0/0/2")
|
|
|
|
- name: Activate interface configuration on aggregate
|
|
junos_interface:
|
|
aggregate:
|
|
- { name: ge-0/0/1, description: test-interface-1, speed: 1g, mtu: 512 }
|
|
- { name: ge-0/0/2, description: test-interface-2, speed: 10m, mtu: 256 }
|
|
duplex: full
|
|
active: True
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- result.diff.prepared is search("! *active[:] ge-0/0/1")
|
|
- result.diff.prepared is search("! *active[:] ge-0/0/2")
|
|
|
|
- name: Delete interface on aggregate
|
|
junos_interface:
|
|
aggregate:
|
|
- name: ge-0/0/1
|
|
- name: ge-0/0/2
|
|
state: absent
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == true'
|
|
- result.diff.prepared is search("\- *ge-0/0/1")
|
|
- result.diff.prepared is search("\- *description test-interface-1")
|
|
- result.diff.prepared is search("\- *speed 1g")
|
|
- result.diff.prepared is search("\- *mtu 512")
|
|
- result.diff.prepared is search("\- *link-mode full-duplex")
|
|
- result.diff.prepared is search("\- *description test-interface-2")
|
|
- result.diff.prepared is search("\- *speed 10m")
|
|
- result.diff.prepared is search("\- * mtu 256")
|
|
- result.diff.prepared is search("\- *link-mode full-duplex")
|
|
|
|
- name: Delete interface on aggregate (idempotent)
|
|
junos_interface:
|
|
aggregate:
|
|
- name: ge-0/0/1
|
|
- name: ge-0/0/2
|
|
state: absent
|
|
provider: "{{ netconf }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- 'result.changed == false'
|