ansible / ansible.builtin / v2.5.11 / module / cs_vpc Manages VPCs on Apache CloudStack based clouds. | "added in version" 2.3 of ansible.builtin" Authors: René Moser (@resmo) stableinterface | supported by communityansible.builtin.cs_vpc (v2.5.11) — module
pip
Install with pip install ansible==2.5.11
Create, update and delete VPCs.
- name: Ensure a VPC is present local_action: module: cs_vpc name: my_vpc display_text: My example VPC cidr: 10.10.0.0/16
- name: Ensure a VPC is absent local_action: module: cs_vpc name: my_vpc state: absent
- name: Ensure a VPC is restarted with clean up local_action: module: cs_vpc name: my_vpc clean_up: true state: restarted
cidr: description: - CIDR of the VPC, e.g. 10.1.0.0/16 - All VPC guest networks' CIDRs must be within this CIDR. - Required on C(state=present). name: description: - Name of the VPC. required: true tags: aliases: - tag description: - List of tags. Tags are a list of dictionaries having keys C(key) and C(value). - 'For deleting all tags, set an empty list e.g. C(tags: []).' zone: description: - Name of the zone. - If not set, default zone is used. state: choices: - present - absent - restarted default: present description: - State of the VPC. domain: description: - Domain the VPC is related to. account: description: - Account the VPC is related to. 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 project: description: - Name of the project the VPC is related to. clean_up: description: - Whether to redeploy a VPC router or not when C(state=restarted) version_added: '2.5' version_added_collection: ansible.builtin api_secret: description: - Secret key of the CloudStack API. - If not set, the C(CLOUDSTACK_SECRET) env variable is considered. required: true type: str poll_async: default: true description: - Poll async jobs until job has finished. api_timeout: default: 10 description: - HTTP timeout in seconds. - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered. type: int display_text: description: - Display text of the VPC. - If not set, C(name) will be used for creating. vpc_offering: description: - Name of the VPC offering. - If not set, default VPC offering is used. network_domain: description: - Network domain for the VPC. - All networks inside the VPC will belong to this domain. - Only considered while creating the VPC, can not be changed. 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 VPC is related to. returned: success sample: example account type: string cidr: description: CIDR of the VPC. returned: success sample: 10.10.0.0/16 type: string display_text: description: Display text of the VPC. returned: success sample: My example VPC type: string distributed_vpc_router: description: Whether the VPC uses distributed router or not. returned: success sample: true type: boolean domain: description: Domain the VPC is related to. returned: success sample: example domain type: string id: description: UUID of the VPC. returned: success sample: 04589590-ac63-4ffc-93f5-b698b8ac38b6 type: string name: description: Name of the VPC. returned: success sample: my_vpc type: string network_domain: description: Network domain of the VPC. returned: success sample: example.com type: string project: description: Name of project the VPC is related to. returned: success sample: Production type: string redundant_vpc_router: description: Whether the VPC has redundant routers or not. returned: success sample: true type: boolean region_level_vpc: description: Whether the VPC is region level or not. returned: success sample: true type: boolean restart_required: description: Whether the VPC router needs a restart or not. returned: success sample: true type: boolean state: description: State of the VPC. returned: success sample: Enabled type: string tags: description: List of resource tags associated with the VPC. returned: success sample: '[ { "key": "foo", "value": "bar" } ]' type: dict zone: description: Name of zone the VPC is in. returned: success sample: ch-gva-2 type: string