ansible.builtin.cs_vpc_offering (v2.9.18) — module

Manages vpc offerings on Apache CloudStack based clouds.

| "added in version" 2.5 of ansible.builtin"

Authors: David Passante (@dpassante)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.18

Description

Create, update, enable, disable and remove CloudStack VPC offerings.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a vpc offering and enable it
  cs_vpc_offering:
    name: my_vpc_offering
    display_text: vpc offering description
    state: enabled
    supported_services: [ Dns, Dhcp ]
    service_providers:
      - {service: 'dns', provider: 'VpcVirtualRouter'}
      - {service: 'dhcp', provider: 'VpcVirtualRouter'}
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a vpc offering with redundant router
  cs_vpc_offering:
    name: my_vpc_offering
    display_text: vpc offering description
    supported_services: [ Dns, Dhcp, SourceNat ]
    service_providers:
      - {service: 'dns', provider: 'VpcVirtualRouter'}
      - {service: 'dhcp', provider: 'VpcVirtualRouter'}
      - {service: 'SourceNat', provider: 'VpcVirtualRouter'}
    service_capabilities:
      - {service: 'SourceNat', capabilitytype: 'RedundantRouter', capabilityvalue: true}
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a region level vpc offering with distributed router
  cs_vpc_offering:
    name: my_vpc_offering
    display_text: vpc offering description
    state: present
    supported_services: [ Dns, Dhcp, SourceNat ]
    service_providers:
      - {service: 'dns', provider: 'VpcVirtualRouter'}
      - {service: 'dhcp', provider: 'VpcVirtualRouter'}
      - {service: 'SourceNat', provider: 'VpcVirtualRouter'}
    service_capabilities:
      - {service: 'Connectivity', capabilitytype: 'DistributedRouter', capabilityvalue: true}
      - {service: 'Connectivity', capabilitytype: 'RegionLevelVPC', capabilityvalue: true}
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a vpc offering
  cs_vpc_offering:
    name: my_vpc_offering
    state: absent
  delegate_to: localhost

Inputs

    
name:
    description:
    - The name of the vpc offering
    required: true
    type: str

state:
    choices:
    - enabled
    - present
    - disabled
    - absent
    default: present
    description:
    - State of the vpc offering.
    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

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.
    type: bool

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 offerings
    type: str

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

service_offering:
    description:
    - The name or ID of the service offering for the VPC router appliance.
    type: str

service_providers:
    aliases:
    - service_provider
    description:
    - provider to service mapping. If not specified, the provider for the service will
      be mapped to the default provider on the physical network
    type: list

supported_services:
    aliases:
    - supported_service
    description:
    - Services supported by the vpc offering
    type: list

api_verify_ssl_cert:
    description:
    - Verify CA authority cert file.
    - If not given, the C(CLOUDSTACK_VERIFY) env variable is considered.
    type: str

service_capabilities:
    aliases:
    - service_capability
    description:
    - Desired service capabilities as part of vpc offering.
    type: list

Outputs

display_text:
  description: The display text of the vpc offering
  returned: success
  sample: My vpc offering
  type: str
distributed:
  description: Indicates if the vpc offering supports distributed router for one-hop
    forwarding.
  returned: success
  sample: false
  type: bool
id:
  description: UUID of the vpc offering.
  returned: success
  sample: a6f7a5fc-43f8-11e5-a151-feff819cdc9f
  type: str
is_default:
  description: Whether VPC offering is the default offering or not.
  returned: success
  sample: false
  type: bool
name:
  description: The name of the vpc offering
  returned: success
  sample: MyCustomVPCOffering
  type: str
region_level:
  description: Indicated if the offering can support region level vpc.
  returned: success
  sample: false
  type: bool
service_offering_id:
  description: The service offering ID.
  returned: success
  sample: c5f7a5fc-43f8-11e5-a151-feff819cdc9f
  type: str
state:
  description: The state of the vpc offering
  returned: success
  sample: Enabled
  type: str