opentelekomcloud.cloud.cce_cluster_node (0.14.2) — module

Add/Delete CCE Cluster node

| "added in version" 0.4.0 of opentelekomcloud.cloud"

Authors: Tino Schreiber (@tischrei)

Install collection

Install with ansible-galaxy collection install opentelekomcloud.cloud:==0.14.2


Add to requirements.yml

  collections:
    - name: opentelekomcloud.cloud
      version: 0.14.2

Description

Add or Remove CCE Cluster node in OTC


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create CCE cluster node
- opentelekomcloud.cloud.cce_cluster_node:
    annotations:
      annotation1: 'abc'
    availability_zone: 'eu-de-02'
    cluster: "{{ cluster_name_or_id }}"
    count: 1
    data_volumes:
      - volumetype: 'SATA'
        size: 100
        encrypted: False
        cmk_id: ''
      - volumetype: 'SAS'
        size: 120
    flavor: 's2.large.2'
    k8s_tags:
      testtag: 'value'
    keypair: 'sshkey-pub'
    labels:
      mein: 'label'
    max_pods: 16
    name: "{{ cce_node_name }}"
    network: '25d24fc8-d019-4a34-9fff-0a09fde6a123'
    os: 'CentOS 7.7'
    root_volume_size: 40
    root_volume_type: SATA
    tags:
      - key: 'key1'
        value: 'value1'
      - key: 'key2'
        value: 'value2'
    wait: true
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Delete CCE cluster node
- opentelekomcloud.cloud.cce_cluster_node:
    cluster: "{{ cluster_name_or_id }}"
    name: "{{ cce_node_name }}"
    state: absent

Inputs

    
os:
    description: Operating System of the cluster node.
    type: str

auth:
    description:
    - Dictionary containing auth information as needed by the cloud's auth plugin strategy.
      For the default I(password) plugin, this would contain I(auth_url), I(username),
      I(password), I(project_name) and any information about domains (for example, I(os_user_domain_name)
      or I(os_project_domain_name)) if the cloud supports them. For other plugins, this
      param will need to contain whatever parameters that auth plugin requires. This parameter
      is not needed if a named cloud is provided or OpenStack OS_* environment variables
      are present.
    type: dict

name:
    description:
    - Name of the CCE cluster node.
    required: true
    type: str

tags:
    description: CCE cluster node tags
    elements: dict
    type: list

wait:
    default: true
    description:
    - If the module should wait for the cluster node to be
    - created or deleted.
    type: bool

cloud:
    description:
    - Named cloud or cloud config to operate against. If I(cloud) is a string, it references
      a named cloud config as defined in an OpenStack clouds.yaml file. Provides default
      values for I(auth) and I(auth_type). This parameter is not needed if I(auth) is
      provided or if OpenStack OS_* environment variables are present. If I(cloud) is
      a dict, it contains a complete cloud configuration like would be in a section of
      clouds.yaml.
    type: raw

count:
    default: 1
    description:
    - Cluster node count which will be created.
    - If node count is greater than 1 the name of the node
    - gets a suffix.
    type: int

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Should the resource be present or absent.
    type: str

flavor:
    description: Flavor ID of the cluster node
    type: str

labels:
    description: Labels for the CCE cluster node
    type: dict

ca_cert:
    aliases:
    - cacert
    description:
    - A path to a CA Cert bundle that can be used as part of verifying SSL API requests.
    type: str

cluster:
    description:
    - CCE cluster name or id which hosts the cce cluster node
    required: true
    type: str

network:
    description:
    - Network ID of the CCE cluster node.
    type: str

ssh_key:
    description: Name of the public key to login
    type: str

timeout:
    default: 180
    description:
    - The amount of time the module should wait.
    type: int

k8s_tags:
    description: Dictionary of Kubernetes tags.
    type: dict

max_pods:
    description: Maximum number of pods on the node.
    type: int

auth_type:
    description:
    - Name of the auth plugin to use. If the cloud uses something other than password
      authentication, the name of the plugin should be indicated here and the contents
      of the I(auth) parameter should be updated accordingly.
    type: str

ecs_group:
    description: ID of the ECS group where the CCE node can belong to.
    type: str

interface:
    aliases:
    - endpoint_type
    choices:
    - admin
    - internal
    - public
    default: public
    description:
    - Endpoint URL type to fetch from the service catalog.
    type: str

client_key:
    aliases:
    - key
    description:
    - A path to a client key to use as part of the SSL transaction.
    type: str

lvm_config:
    description: ConfigMap of the Docker data disk.
    type: str

annotations:
    description: Specifiy annotations for CCE node
    type: dict

api_timeout:
    description:
    - How long should the socket layer wait before timing out for API calls. If this is
      omitted, nothing will be passed to the requests library.
    type: int

client_cert:
    aliases:
    - cert
    description:
    - A path to a client certificate to use as part of the SSL transaction.
    type: str

floating_ip:
    description: Floating IP used to connect to public networks.
    type: str

region_name:
    description:
    - Name of the region.
    type: str

data_volumes:
    description: List of data volumes attached to the cluster node.
    elements: dict
    type: list

fault_domain:
    description: The node is created in the specified fault domain.
    type: str

offload_node:
    description: If node is offloading its components.
    type: bool

sdk_log_path:
    description:
    - Path to the logfile of the OpenStackSDK. If empty no log is written
    type: str

node_image_id:
    description: ID of a custom image used in a baremetall scenario.
    type: str

sdk_log_level:
    choices:
    - ERROR
    - WARN
    - INFO
    - DEBUG
    default: WARN
    description: Log level of the OpenStackSDK
    type: str

dedicated_host:
    description:
    - ID of a Dedicated Host where the cluster node will be located to.
    type: str

validate_certs:
    aliases:
    - verify
    description:
    - Whether or not SSL API requests should be verified.
    - Before Ansible 2.3 this defaulted to C(yes).
    type: bool

root_volume_size:
    default: 40
    description:
    - Size of the root volume
    type: int

root_volume_type:
    choices:
    - SATA
    - SAS
    - SSD
    default: SATA
    description:
    - Type of the root volume.
    type: str

availability_zone:
    description: Availability zone
    type: str

preinstall_script:
    description: Base64 encoded pre installation script.
    type: str

postinstall_script:
    description: Base64 encoded post installation script.
    type: str

Outputs

cce_cluster_node:
  description: Dictionary describing the Cluster Node.
  returned: On success when C(state=present)
  sample:
    cce_cluster_node:
      api_version: v3
      id: a815a926-30cd-11eb-b02d-0255ac101123
      kind: Node
      location:
        cloud: otc
        project:
          domain_id: null
          domain_name: null
          id: 16d53a84a13b49529d2e2c3646691123
          name: eu-de
        region_name: eu-de
        zone: null
      metadata:
        annotations:
          annotation1: abc
        created_at: null
        id: a815a926-30cd-11eb-b02d-0255ac101123
        labels:
          mein: label
        location: null
        name: testccenode
        updated_at: null
      name: testccenode
      spec:
        availability_zone: eu-de-02
        billing_mode: 0
        count: 1
        data_volumes:
        - id: null
          location: null
          name: null
          size: 150
          type: SATA
        - id: null
          location: null
          name: null
          size: 100
          type: SAS
        dedicated_host: null
        ecs_group: null
        extend_params:
          id: null
          location: null
          lvm_config: null
          max_pods: 16
          name: null
          node_image_id: null
          postinstall_script: null
          preinstall_script: null
        fault_domain: null
        flavor: s2.large.2
        floating_ip:
          count: null
          floating_ip:
            bandwidth: {}
          id: null
          ids: null
          location: null
          name: null
        id: null
        k8s_tags:
          kubernetes.io/eniquota: '12'
          kubernetes.io/subeniquota: '0'
          testtag: value
        location: null
        login:
          sshKey: sshkey-pub
          userPassword: {}
        name: null
        offload_node: null
        os: CentOS 7.7
        root_volume:
          id: null
          location: null
          name: null
          size: 40
          type: SATA
        tags:
        - id: null
          key: hellokey1
          location: null
          name: null
          value: hellovalue1
        - id: null
          key: hellokey2
          location: null
          name: null
          value: hellovalue2
        taints: null
      status:
        floating_ip: null
        id: null
        instance_id: null
        job_id: a8168c15-30cd-11eb-b02d-0255ac101123
        location: null
        name: null
        private_ip: null
        status: null
  type: dict
id:
  description: The CCE Cluster Node UUID.
  returned: On success when C(state=present)
  sample: 39007a7e-ee4f-4d13-8283-b4da2e037123
  type: str