community.general.cs_vpc_offering (0.1.1) — module

Manages vpc offerings on Apache CloudStack based clouds.

Authors: David Passante (@dpassante)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

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.
    - 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

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

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

display_text:
    description:
    - Display text of the vpc offerings
    type: str

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

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

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