phoenixnap.bmc.ssh_key_info (1.17.0) — module

Gather information about phoenixNAP BMC SSH Keys

| "added in version" 0.7.0 of phoenixnap.bmc"

Authors: Pavle Jojkic (@pajuga) <pavlej@phoenixnap.com>, Goran Jelenic (@goranje) <goranje@phoenixnap.com>

preview | supported by certified

Install collection

Install with ansible-galaxy collection install phoenixnap.bmc:==1.17.0


Add to requirements.yml

  collections:
    - name: phoenixnap.bmc
      version: 1.17.0

Description

Gather information about ssh keys available.

This module has a dependency on requests

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# All the examples assume that you have file config.yaml with your 'clientId' and 'clientSecret'
# in location: ~/.pnap/config.yaml

- name: List all SSH keys
  hosts: localhost
  gather_facts: false
  vars_files:
    - ~/.pnap/config.yaml
  tasks:
    - name: List all SSH keys information for account
      phoenixnap.bmc.ssh_key_info:
        client_id: "{{ clientId }}"
        client_secret: "{{ clientSecret }}"
      register: output
    - name: Print the gathered infos
      ansible.builtin.debug:
        var: output.ssh_keys
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: List the SSH key details
  hosts: localhost
  gather_facts: false
  vars_files:
    - ~/.pnap/config.yaml
  tasks:
    - name: List SSH keys information based on the specified names
      phoenixnap.bmc.ssh_key_info:
        client_id: "{{ clientId }}"
        client_secret: "{{ clientSecret }}"
        names: [default-key]
      register: output
    - name: Print the gathered infos
      ansible.builtin.debug:
        var: output.ssh_keys

Inputs

    
names:
    description: SSH key names that represent an SSH keys
    elements: str
    type: list

client_id:
    description: Client ID (Application Management)
    type: str

client_secret:
    description: Client Secret (Application Management)
    type: str

Outputs

ssh_keys:
  contains:
    createdOn:
      description: Date and time of creation.
      returned: always
      sample: '2020-03-19T16:39:00Z'
      type: str
    default:
      description: Keys marked as default are always included on server creation and
        reset unless toggled off in creation/reset request.
      returned: always
      sample: true
      type: bool
    fingerprint:
      description: SSH key auto-generated SHA-256 fingerprint.
      returned: always
      sample: iL4k5YTrOnzvlxFMN+WU4BPI/QqrMcvvhU0xlfeMwZI
      type: str
    id:
      description: The unique identifier of the SSH key..
      returned: always
      sample: 5fa54d1e91867c03a0a7b4a4
      type: str
    key:
      description: SSH key value.
      returned: always
      sample: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDF9LdAFElNCi...
      type: str
    lastUpdatedOn:
      description: Date and time of last update.
      returned: always
      sample: '2020-03-19T16:39:00Z'
      type: str
    name:
      description: Friendly SSH key name to represent an SSH key.
      returned: always
      sample: sshkey-name-01
      type: str
  description: The SSH key information as list
  returned: success
  type: complex