community / community.general / 0.2.1 / module / digital_ocean_sshkey Manage DigitalOcean SSH keys Authors: Patrick Marques (@pmarques)community.general.digital_ocean_sshkey (0.2.1) — module
Install with ansible-galaxy collection install community.general:==0.2.1
collections: - name: community.general version: 0.2.1
Create/delete DigitalOcean SSH keys.
- name: "Create ssh key" digital_ocean_sshkey: oauth_token: "{{ oauth_token }}" name: "My SSH Public Key" ssh_pub_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example" state: present register: result
- name: "Delete ssh key" digital_ocean_sshkey: oauth_token: "{{ oauth_token }}" state: "absent" fingerprint: "3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa"
name: description: - The name for the SSH key state: choices: - present - absent default: present description: - Indicate desired state of the target. fingerprint: aliases: - id description: - This is a unique identifier for the SSH key used to delete a key oauth_token: description: - DigitalOcean OAuth token. required: true ssh_pub_key: description: - The Public SSH key to add.
data: description: This is only present when C(state=present) returned: when C(state=present) sample: ssh_key: fingerprint: 3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa id: 512189 name: My SSH Public Key public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example type: dict