ngine_io / ngine_io.cloudstack / 2.3.0 / module / cs_ip_address Manages public IP address associations on Apache CloudStack based clouds. | "added in version" 0.1.0 of ngine_io.cloudstack" Authors: Darren Worrall (@dazworrall), René Moser (@resmo)ngine_io.cloudstack.cs_ip_address (2.3.0) — module
Install with ansible-galaxy collection install ngine_io.cloudstack:==2.3.0
collections: - name: ngine_io.cloudstack version: 2.3.0
Acquires and associates a public IP to an account or project.
Due to API limitations this is not an idempotent call, so be sure to only conditionally call this when I(state=present).
Tagging the IP address can also make the call idempotent.
- name: Associate an IP address conditionally ngine_io.cloudstack.cs_ip_address: network: My Network zone: zone01 register: ip_address when: instance.public_ip is undefined
- name: Disassociate an IP address ngine_io.cloudstack.cs_ip_address: ip_address: 1.2.3.4 zone: zone01 state: absent
- name: Associate an IP address with tags ngine_io.cloudstack.cs_ip_address: network: My Network zone: zone01 tags: - key: myCustomID value: 5510c31a-416e-11e8-9013-02000a6b00bf register: ip_address
- name: Disassociate an IP address with tags ngine_io.cloudstack.cs_ip_address: state: absent zone: zone01 tags: - key: myCustomID value: 5510c31a-416e-11e8-9013-02000a6b00bf
vpc: description: - VPC the IP address is related to. - Mutually exclusive with I(network). type: str tags: aliases: - tag description: - List of tags. Tags are a list of dictionaries having keys I(key) and I(value). - Tags can be used as an unique identifier for the IP Addresses. - In this case, at least one of them must be unique to ensure idempotency. elements: dict type: list zone: description: - Name of the zone in which the IP address is in. required: true type: str state: choices: - present - absent default: present description: - State of the IP address. type: str domain: description: - Domain the IP address is related to. type: str account: description: - Account the IP address is related to. type: str api_key: description: - API key of the CloudStack API. - If not given, the C(CLOUDSTACK_KEY) env variable is considered. required: true type: str api_url: description: - URL of the CloudStack API e.g. https://cloud.example.com/client/api. - If not given, the C(CLOUDSTACK_ENDPOINT) env variable is considered. required: true type: str network: description: - Network the IP address is related to. - Mutually exclusive with I(vpc). type: str project: description: - Name of the project the IP address is related to. type: str api_secret: description: - Secret key of the CloudStack API. - If not set, the C(CLOUDSTACK_SECRET) env variable is considered. required: true type: str ip_address: description: - Public IP address. - Required if I(state=absent) and I(tags) is not set. type: str poll_async: default: true description: - Poll async jobs until job has finished. type: bool api_timeout: default: 10 description: - HTTP timeout in seconds. - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered. type: int api_http_method: choices: - get - post default: get description: - HTTP method used to query the API endpoint. - If not given, the C(CLOUDSTACK_METHOD) env variable is considered. type: str api_verify_ssl_cert: description: - Verify CA authority cert file. - If not given, the C(CLOUDSTACK_VERIFY) env variable is considered. type: str
account: description: Account the IP address is related to. returned: success sample: example account type: str domain: description: Domain the IP address is related to. returned: success sample: example domain type: str id: description: UUID of the Public IP address. returned: success sample: a6f7a5fc-43f8-11e5-a151-feff819cdc9f type: str ip_address: description: Public IP address. returned: success sample: 1.2.3.4 type: str project: description: Name of project the IP address is related to. returned: success sample: Production type: str tags: description: List of resource tags associated with the IP address. returned: success sample: '[ { "key": "myCustomID", "value": "5510c31a-416e-11e8-9013-02000a6b00bf" } ]' type: dict zone: description: Name of zone the IP address is related to. returned: success sample: ch-gva-2 type: str