Skip to content

Latest commit

 

History

History
84 lines (64 loc) · 3.57 KB

ssh_key_list.md

File metadata and controls

84 lines (64 loc) · 3.57 KB

ssh_key_list

List and filter on SSH Keys.

Minimum Required Fields

Field Type Required Description
api_token str Required The Linode account personal access token. It is necessary to run the module.
It can be exposed by the environment variable LINODE_API_TOKEN instead.
See details in Usage.

Examples

- name: List all of the SSH keys for the current Linode Account
  linode.cloud.ssh_key_list: {}
- name: List the latest 5 SSH keys for the current Linode Account
  linode.cloud.ssh_key_list:

    count: 5
    order_by: created
    order: desc
- name: List filtered personal SSH keys for the current Linode Account
  linode.cloud.ssh_key_list:

    filters:
      - name: label-or-some-other-field
        values: MySSHKey1
- name: List filtered personal SSH keys for the current Linode Account
  linode.cloud.ssh_key_list:
    filters:
      - name: label-or-some-other-field
        values:
          - MySSHKey1
          - MySSHKey2

Parameters

Field Type Required Description
order str Optional The order to list SSH Keys in. (Choices: desc, asc; Default: asc)
order_by str Optional The attribute to order SSH Keys by.
filters (sub-options) list Optional A list of filters to apply to the resulting SSH Keys.
count int Optional The number of SSH Keys to return. If undefined, all results will be returned.

filters

Field Type Required Description
name str Required The name of the field to filter on. Valid filterable fields can be found here.
values list Required A list of values to allow for this field. Fields will pass this filter if at least one of these values matches.

Return Values

  • ssh_keys - The returned SSH Keys.

    • Sample Response:
      [
          {
            "created": "2018-01-01T00:01:01",
            "id": 42,
            "label": "MySSHKey1",
            "ssh_key": "ssh-rsa AAAA_valid_public_ssh_key_123456785== user@their-computer"
          }
      ]
    • See the Linode API response documentation for a list of returned fields