|
|
|
|
@ -350,6 +350,64 @@
|
|
|
|
|
- result.ip_permissions[0].user_id_group_pairs or
|
|
|
|
|
result.ip_permissions[1].user_id_group_pairs
|
|
|
|
|
|
|
|
|
|
# ============================================================
|
|
|
|
|
- name: test ip rules convert port numbers from string to int (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
|
|
|
|
|
rules:
|
|
|
|
|
- proto: "tcp"
|
|
|
|
|
from_port: "8183"
|
|
|
|
|
to_port: "8183"
|
|
|
|
|
cidr_ipv6: "64:ff9b::/96"
|
|
|
|
|
rules_egress:
|
|
|
|
|
- proto: "tcp"
|
|
|
|
|
from_port: "8184"
|
|
|
|
|
to_port: "8184"
|
|
|
|
|
cidr_ipv6: "64:ff9b::/96"
|
|
|
|
|
register: result
|
|
|
|
|
|
|
|
|
|
- name: assert state=present (expected changed=true)
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- 'result.changed'
|
|
|
|
|
- 'result.group_id.startswith("sg-")'
|
|
|
|
|
|
|
|
|
|
# ============================================================
|
|
|
|
|
- name: test group rules convert port numbers from string to int (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
|
|
|
|
|
rules:
|
|
|
|
|
- proto: "tcp"
|
|
|
|
|
from_port: "8185"
|
|
|
|
|
to_port: "8185"
|
|
|
|
|
group_id: "{{result.group_id}}"
|
|
|
|
|
rules_egress:
|
|
|
|
|
- proto: "tcp"
|
|
|
|
|
from_port: "8186"
|
|
|
|
|
to_port: "8186"
|
|
|
|
|
cidr_ipv6: "64:ff9b::/96"
|
|
|
|
|
group_id: "{{result.group_id}}"
|
|
|
|
|
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)
|
|
|
|
|
ec2_group:
|
|
|
|
|
|