community / community.general / 0.1.1 / module / cs_instance_nic Manages NICs of an instance on Apache CloudStack based clouds. Authors: Marc-Aurèle Brothier (@marcaurele), René Moser (@resmo) preview | supported by communitycommunity.general.cs_instance_nic (0.1.1) — module
Install with ansible-galaxy collection install community.general:==0.1.1
collections: - name: community.general version: 0.1.1
Add and remove nic to and from network
- name: Add a nic on another network cs_instance_nic: vm: privnet network: privNetForBasicZone delegate_to: localhost
- name: Ensure IP address on a nic cs_instance_nic: vm: privnet ip_address: 10.10.11.32 network: privNetForBasicZone delegate_to: localhost
- name: Remove a secondary nic cs_instance_nic: vm: privnet state: absent network: privNetForBasicZone delegate_to: localhost
vm: aliases: - name description: - Name of instance. required: true type: str vpc: description: - Name of the VPC the I(vm) is related to. type: str zone: description: - Name of the zone in which the instance is deployed in. - If not set, default zone is used. type: str state: choices: - present - absent default: present description: - State of the nic. type: str domain: description: - Domain the instance is related to. type: str account: description: - Account the instance 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. - As the last option, the value is taken from the ini config file, also see the notes. 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. - As the last option, the value is taken from the ini config file, also see the notes. type: str network: description: - Name of the network. required: true type: str project: description: - Name of the project the instance is deployed in. type: str api_region: default: cloudstack description: - Name of the ini section in the C(cloustack.ini) file. - If not given, the C(CLOUDSTACK_REGION) env variable is considered. type: str api_secret: description: - Secret key of the CloudStack API. - If not set, the C(CLOUDSTACK_SECRET) env variable is considered. - As the last option, the value is taken from the ini config file, also see the notes. type: str ip_address: description: - IP address to be used for the nic. type: str poll_async: default: true description: - Poll async jobs until job has finished. type: bool api_timeout: description: - HTTP timeout in seconds. - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered. - As the last option, the value is taken from the ini config file, also see the notes. - Fallback value is 10 seconds if not specified. type: int api_http_method: choices: - get - post description: - HTTP method used to query the API endpoint. - If not given, the C(CLOUDSTACK_METHOD) env variable is considered. - As the last option, the value is taken from the ini config file, also see the notes. - Fallback value is C(get) if not specified. type: str
account: description: Account the VM is related to. returned: success sample: example account type: str domain: description: Domain the VM is related to. returned: success sample: example domain type: str id: description: UUID of the nic. returned: success sample: 87b1e0ce-4e01-11e4-bb66-0050569e64b8 type: str ip_address: description: Primary IP of the NIC. returned: success sample: 10.10.10.10 type: str mac_address: description: MAC address of the NIC. returned: success sample: 02:00:33:31:00:e4 type: str netmask: description: Netmask of the NIC. returned: success sample: 255.255.255.0 type: str network: description: Name of the network if not default. returned: success sample: sync network type: str project: description: Name of project the VM is related to. returned: success sample: Production type: str vm: description: Name of the VM. returned: success sample: web-01 type: str