gcore.cloud.keypair_info (1.0.1) — module

Gather infos about all GCore keypairs.

Authors: GCore (@GCore)

Install collection

Install with ansible-galaxy collection install gcore.cloud:==1.0.1


Add to requirements.yml

  collections:
    - name: gcore.cloud
      version: 1.0.1

Description

Gather infos about all GCore keypairs.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gather gcore keypairs infos
  gcore.cloud.keypair_info:
    api_key: "{{ api_key }}"
    region_id: "{{ region_id }}"
    project_id: "{{ project_id }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gather gcore specific keypair info
  gcore.cloud.keypair_info:
    keypair_id: "{{ keypair_id }}"
    region_id: "{{ region_id }}"
    project_id: "{{ project_id }}"
    api_key: "{{ api_key }}"

Inputs

    
api_key:
    description:
    - GCore API auth key
    - Can be passed as I(CLOUD_API_KEY) environment variable.
    type: str

api_host:
    default: https://api.gcore.com/cloud
    description:
    - GCore API base host
    - Can be passed as I(CLOUD_API_HOST) environment variable.
    type: str

region_id:
    description:
    - GCore API region ID
    - Required if I(region_name) is not passed
    - Can be passed as I(CLOUD_REGION_ID) environment variable.
    type: int

keypair_id:
    description:
    - The ID of keypair you want to get.
    - The module will fail if the provided ID is invalid.
    required: false
    type: str

project_id:
    description:
    - GCore API project ID
    - Required if I(project_name) is not passed
    - Can be passed as I(CLOUD_PROJECT_ID) environment variable.
    type: int

api_timeout:
    default: 30
    description:
    - Timeout in seconds to polling GCore API
    type: int

region_name:
    description:
    - GCore API region name
    - Required if I(region_id) is not passed
    - Can be passed as I(CLOUD_REGION_NAME) environment variable.
    type: str

project_name:
    description:
    - GCore API project name
    - Required if I(project_id) is not passed
    - Can be passed as I(CLOUD_PROJECT_NAME) environment variable.
    type: str

Outputs

keypair_info:
  contains:
    created_at:
      description:
      - Datetime object. It automatically is being generated when the keypair is created
        or imported.
      returned: always
      sample: '2021-11-10T06:58:11'
      type: str
    fingerprint:
      description: Key fingerprint
      returned: if available
      sample: 86:75:ce:e7:e9:1e:f0:79:ec:6f:d8:92:9b:43:fc:4d
      type: str
    private_key:
      description: Private part of the key
      returned: if available
      sample: null
      type: str
    project_id:
      description: Project ID
      returned: always
      sample: 1
      type: int
    public_key:
      description: Public part of the key
      returned: always
      sample: ''' ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFHrnwGVBZs6q6vmTBzQFfzdRLQW8N6Rd0ogGe3h8tm83ZJLTTsF+1H4JcOvwI5ETkHMaFIWd2U1
        5nHU5M7plE6UPRKfzy4rq6yI6cE4tojd3A9attMpbEEX7EbGKrbrb4AsjzxHKAVaREAb31ZplJkUlsiees25hTQXBcWQ
        nOESlc9RCxZ/QQgNUUgqm7QGg7CNkL8Mpq9V4YaOhcFGWj0jXP1CL3g6Xe3xJo1CmUbkIOGUyAmrSfLEiy2O91iOUhbm
        YQyXksznNrT9O6uLkijf6syLZOdyAuUd/Z86eYXej4/YsvIA5eIFU4B6y9zOXEO2A81txPYMRAytYt7+e7
        alice@alice '''
      type: str
    shared_in_project:
      description: Keypair is shared for all users in the project
      returned: always
      sample: false
      type: bool
    sshkey_id:
      description: Key ID, equal to sshkey_name
      returned: always
      sample: alice
      type: str
    sshkey_name:
      description: Key name
      returned: always
      sample: alice
      type: str
    state:
      description: Key state
      returned: always
      sample: ACTIVE
      type: str
  description:
  - When I(keypair_id) is passed, it is a dict of resource.
  - Otherwise it is a list of dictionaries.
  returned: always
  type: complex

See also