gcore / gcore.cloud / 1.0.1 / module / securitygroup Manages securitygroups. Authors: GCore (@GCore)gcore.cloud.securitygroup (1.0.1) — module
Install with ansible-galaxy collection install gcore.cloud:==1.0.1
collections: - name: gcore.cloud version: 1.0.1
Create, update, delete or copy securitygroup.
- name: Create new securitygroup gcore.cloud.securitygroup: api_key: "{{ api_key }}" region_id: "{{ region_id }}" project_id: "{{ project_id }}" command: create security_group: { 'description': 'My new security group', 'name': 'my_new_sg', 'metadata': {'key': 'value'} }
- name: Update securitygroup gcore.cloud.securitygroup: api_key: "{{ api_key }}" region_id: "{{ region_id }}" project_id: "{{ project_id }}" command: update securitygroup_id: "{{ securitygroup_id }}" name: 'new-name' changed_rules: "{{ changed_rules }}"
- name: Copy securitygroup gcore.cloud.securitygroup: api_key: "{{ api_key }}" region_id: "{{ region_id }}" project_id: "{{ project_id }}" command: copy securitygroup_id: "{{ securitygroup_id }}" name: 'copied-securitygroup'
- name: Delete securitygroup gcore.cloud.securitygroup: api_key: "{{ api_key }}" region_id: "{{ region_id }}" project_id: "{{ project_id }}" command: delete securitygroup_id: "{{ securitygroup_id }}"
name: description: - Security group name. - Used if I(command) is update. required: false type: str api_key: description: - GCore API auth key - Can be passed as I(CLOUD_API_KEY) environment variable. type: str command: choices: - create - update - delete - copy description: - Operation to perform. required: true type: str api_host: default: https://api.gcore.com/cloud description: - GCore API base host - Can be passed as I(CLOUD_API_HOST) environment variable. type: str instances: description: - List of instances. - Used if I(command) is create. elements: str required: false type: list region_id: description: - GCore API region ID - Required if I(region_name) is not passed - Can be passed as I(CLOUD_REGION_ID) environment variable. type: int project_id: description: - GCore API project ID - Required if I(project_name) is not passed - Can be passed as I(CLOUD_PROJECT_ID) environment variable. type: int api_timeout: default: 30 description: - Timeout in seconds to polling GCore API type: int region_name: description: - GCore API region name - Required if I(region_id) is not passed - Can be passed as I(CLOUD_REGION_NAME) environment variable. type: str project_name: description: - GCore API project name - Required if I(project_id) is not passed - Can be passed as I(CLOUD_PROJECT_NAME) environment variable. type: str changed_rules: description: - List of rules to create or delete. - Used if I(command) is update. elements: dict required: false type: list security_group: description: - Security group. - Required if I(command) is create. required: false type: dict securitygroup_id: description: - The ID of securitygroup. - Required if I(command) is update, delete or copy required: false type: str
securitygroup: contains: created_at: description: Datetime when the security group was created returned: always sample: 2019-07-26T13:25:03+0000 type: str description: description: Security group description returned: always sample: Default security group type: str id: description: Security group ID returned: always sample: 3addc7a1-e926-46da-b5a2-eb4b2f935230 type: str metadata: description: Network metadata elements: dict returned: always sample: - key: hosting read_only: false value: some value type: list name: description: Security group name returned: always sample: default type: str project_id: description: Project ID returned: always sample: 1 type: int region: description: Region name returned: always sample: Luxembourg 1 type: str region_id: description: Region ID returned: always sample: 1 type: int revision_number: description: The number of revisions returned: always sample: 0 type: int security_group_rules: description: Security group rules elements: dict returned: always sample: - created_at: 2019-07-26T13:25:03+0000 description: None direction: egress ethertype: IPv4 id: 253c1ad7-8061-44b9-9f33-5616ad8ba5b6 port_range_max: None port_range_min: None protocol: None remote_group_id: None remote_ip_prefix: None revision_number: 0 security_group_id: 3addc7a1-e926-46da-b5a2-eb4b2f935230 updated_at: 2019-07-26T13:25:03+0000 type: list tags: description: Security group tags elements: str returned: always sample: - hosting type: list updated_at: description: Datetime when the security group was last updated returned: always sample: 2019-07-26T13:25:03+0000 type: str description: - Response depends of I(command). - Resource dictionary. returned: always type: complex