ansible / ansible.builtin / v2.5.11 / module / cs_instance_nic Manages NICs of an instance on Apache CloudStack based clouds. | "added in version" 2.4 of ansible.builtin" Authors: Marc-Aurèle Brothier (@marcaurele), René Moser (@resmo) preview | supported by communityansible.builtin.cs_instance_nic (v2.5.11) — module
pip
Install with pip install ansible==2.5.11
Add and remove nic to and from network
# Add a nic on another network - local_action: module: cs_instance_nic vm: privnet network: privNetForBasicZone
# Ensure IP address on a nic - local_action: module: cs_instance_nic vm: privnet ip_address: 10.10.11.32 network: privNetForBasicZone
# Remove a secondary nic - local_action: module: cs_instance_nic vm: privnet state: absent network: privNetForBasicZone
vm: aliases: - name description: - Name of instance. required: true vpc: default: null description: - Name of the VPC the C(vm) is related to. required: false zone: default: null description: - Name of the zone in which the instance is deployed in. - If not set, default zone is used. required: false state: choices: - present - absent default: present description: - State of the nic. required: false domain: default: null description: - Domain the instance is related to. required: false account: default: null description: - Account the instance is related to. required: false 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: - Name of the network. required: true project: default: null description: - Name of the project the instance is deployed in. required: false 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: default: null description: - IP address to be used for the nic. required: false poll_async: default: true description: - Poll async jobs until job has finished. required: false 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 VM is related to. returned: success sample: example account type: string domain: description: Domain the VM is related to. returned: success sample: example domain type: string id: description: UUID of the nic. returned: success sample: 87b1e0ce-4e01-11e4-bb66-0050569e64b8 type: string ip_address: description: Primary IP of the NIC. returned: success sample: 10.10.10.10 type: string mac_address: description: MAC address of the NIC. returned: success sample: 02:00:33:31:00:e4 type: string netmask: description: Netmask of the NIC. returned: success sample: 255.255.255.0 type: string network: description: Name of the network if not default. returned: success sample: sync network type: string project: description: Name of project the VM is related to. returned: success sample: Production type: string vm: description: Name of the VM. returned: success sample: web-01 type: string