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

Manages user roles on Apache CloudStack based clouds.

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

Authors: René Moser (@resmo)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.18

Description

Create, update, delete user roles.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure an user role is present
  cs_role:
    name: myrole_user
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a role having particular ID is named as myrole_user
  cs_role:
    name: myrole_user
    id: 04589590-ac63-4ffc-93f5-b698b8ac38b6
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure a role is absent
  cs_role:
    name: myrole_user
    state: absent
  delegate_to: localhost

Inputs

    
id:
    aliases:
    - uuid
    description:
    - ID of the role.
    - If provided, I(id) is used as key.
    type: str

name:
    description:
    - Name of the role.
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the role.
    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

role_type:
    choices:
    - User
    - DomainAdmin
    - ResourceAdmin
    - Admin
    default: User
    description:
    - Type of the role.
    - Only considered for creation.
    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

api_timeout:
    default: 10
    description:
    - HTTP timeout in seconds.
    - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered.
    type: int

description:
    description:
    - Description of the role.
    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

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

Outputs

description:
  description: Description of the role.
  returned: success
  sample: This is my role description
  type: str
id:
  description: UUID of the role.
  returned: success
  sample: 04589590-ac63-4ffc-93f5-b698b8ac38b6
  type: str
name:
  description: Name of the role.
  returned: success
  sample: myrole
  type: str
role_type:
  description: Type of the role.
  returned: success
  sample: User
  type: str