mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ec2_group: add integration test for port ranges (#27112)
* fix port ranges for ec2_group and add a test to verify
This commit is contained in:
parent
435a562630
commit
517c91df18
1 changed files with 27 additions and 0 deletions
|
@ -408,6 +408,33 @@
|
||||||
- 'result.group_id.startswith("sg-")'
|
- 'result.group_id.startswith("sg-")'
|
||||||
|
|
||||||
|
|
||||||
|
# ============================================================
|
||||||
|
|
||||||
|
- name: test adding a range of ports and ports given as strings (expected changed=true)
|
||||||
|
ec2_group:
|
||||||
|
name: '{{ec2_group_name}}'
|
||||||
|
description: '{{ec2_group_description}}'
|
||||||
|
ec2_region: '{{ec2_region}}'
|
||||||
|
ec2_access_key: '{{ec2_access_key}}'
|
||||||
|
ec2_secret_key: '{{ec2_secret_key}}'
|
||||||
|
security_token: '{{security_token}}'
|
||||||
|
state: present
|
||||||
|
# set purge_rules to false so we don't get a false positive from previously added rules
|
||||||
|
purge_rules: false
|
||||||
|
rules:
|
||||||
|
- proto: "tcp"
|
||||||
|
ports:
|
||||||
|
- 8183-8190
|
||||||
|
- '8192'
|
||||||
|
cidr_ip: 1.1.1.1/32
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: assert state=present (expected changed=true)
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- 'result.changed'
|
||||||
|
- 'result.group_id.startswith("sg-")'
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
- name: test state=absent (expected changed=true)
|
- name: test state=absent (expected changed=true)
|
||||||
ec2_group:
|
ec2_group:
|
||||||
|
|
Loading…
Reference in a new issue