mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-06 13:23:06 +00:00
Add security_group_info module
Let's add a new missing module for getting info about security groups. Add tests. Change-Id: Ib032c8d14444cea1fcbfd98d252cc56b9f5f383e
This commit is contained in:
committed by
Sagi Shnaidman
parent
8a4974025f
commit
e4c7bd3df8
@@ -105,11 +105,24 @@
|
||||
openstack.cloud.security_group_rule_info:
|
||||
cloud: "{{ cloud }}"
|
||||
when: sdk_version is version("0.32", '>=')
|
||||
register: test_sec_rules
|
||||
|
||||
- name: Check - List all available rules of all security groups in a project
|
||||
assert:
|
||||
that:
|
||||
- test_sec_rules.security_group_rules | length > 0
|
||||
when: sdk_version is version("0.32", '>=')
|
||||
|
||||
- name: List all available rules of a specific security group
|
||||
openstack.cloud.security_group_rule_info:
|
||||
cloud: "{{ cloud }}"
|
||||
security_group: "{{ secgroup_name }}"
|
||||
register: test_sec_rule1
|
||||
|
||||
- name: Check - List all available rules of a specific security group
|
||||
assert:
|
||||
that:
|
||||
- test_sec_rule1.security_group_rules | length > 0
|
||||
|
||||
- name: List all available rules with filters
|
||||
openstack.cloud.security_group_rule_info:
|
||||
@@ -120,6 +133,38 @@
|
||||
port_range_max: 80
|
||||
remote_ip_prefix: 0.0.0.0/0
|
||||
when: sdk_version is version("0.32", '>=')
|
||||
register: test_sec_rule
|
||||
|
||||
- name: Check - List all available rules with filters
|
||||
assert:
|
||||
that:
|
||||
- test_sec_rule.security_group_rules | length == 1
|
||||
when: sdk_version is version("0.32", '>=')
|
||||
|
||||
- name: List all security groups of a project
|
||||
openstack.cloud.security_group_info:
|
||||
cloud: "{{ cloud }}"
|
||||
register: test_sec_groups
|
||||
|
||||
- name: Check - List all security groups of a project
|
||||
assert:
|
||||
that:
|
||||
- test_sec_groups.security_groups | length > 0
|
||||
|
||||
- name: Filter security group by name
|
||||
openstack.cloud.security_group_info:
|
||||
cloud: "{{ cloud }}"
|
||||
name: "{{ secgroup_name }}"
|
||||
register: test_sec_group
|
||||
|
||||
- name: Check - List all security groups of a project
|
||||
assert:
|
||||
that:
|
||||
- test_sec_group.security_groups | length == 1
|
||||
- test_sec_group.security_groups[0]['name'] == secgroup_name
|
||||
# This fails on Stein only
|
||||
when: sdk_version is version("0.36.5", '>=')
|
||||
|
||||
|
||||
- name: Delete empty ICMP rule
|
||||
openstack.cloud.security_group_rule:
|
||||
|
||||
Reference in New Issue
Block a user