community.general.hwc_vpc_security_group_rule – Creates a resource of Vpc/SecurityGroupRule in Huawei Cloud¶
Note
This plugin is part of the community.general collection (version 1.3.6).
To install it use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.hwc_vpc_security_group_rule.
New in version 0.2.0: of community.general
Requirements¶
The below requirements are needed on the host that executes this module.
keystoneauth1 >= 3.6.0
Parameters¶
Notes¶
Note
If id option is provided, it takes precedence over enterprise_project_id for security group rule selection.
security_group_id is used for security group rule selection. If more than one security group rule with this options exists, execution is aborted.
No parameter support updating. If one of option is changed, the module will create a new resource.
For authentication, you can set identity_endpoint using the
ANSIBLE_HWC_IDENTITY_ENDPOINTenv variable.For authentication, you can set user using the
ANSIBLE_HWC_USERenv variable.For authentication, you can set password using the
ANSIBLE_HWC_PASSWORDenv variable.For authentication, you can set domain using the
ANSIBLE_HWC_DOMAINenv variable.For authentication, you can set project using the
ANSIBLE_HWC_PROJECTenv variable.For authentication, you can set region using the
ANSIBLE_HWC_REGIONenv variable.Environment variables values will only be used if the playbook values are not set.
Examples¶
# create a security group rule
- name: Create a security group
hwc_vpc_security_group:
name: "ansible_network_security_group_test"
register: sg
- name: Create a security group rule
community.general.hwc_vpc_security_group_rule:
direction: "ingress"
protocol: "tcp"
ethertype: "IPv4"
port_range_max: 22
security_group_id: "{{ sg.id }}"
port_range_min: 22
remote_ip_prefix: "0.0.0.0/0"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Huawei Inc. (@huaweicloud)