You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
569 B
YAML
16 lines
569 B
YAML
---
|
|
- name: 'upload ssh keys for root access to hetzner cloud'
|
|
hosts: '{{ host | default("all") }}'
|
|
gather_facts: false
|
|
connection: local
|
|
|
|
pre_tasks:
|
|
- name: "add ssh key for root access"
|
|
hetzner.hcloud.hcloud_ssh_key:
|
|
api_token: "{{ hetzner_authentication_ansible }}"
|
|
name: "{{ lookup('file', 'users/' + item + '/ssh.pub').split(' ') | last }}"
|
|
public_key: "{{ lookup('file', 'users/' + item + '/ssh.pub') }}"
|
|
state: "{{ ssh_key_state | default('present') }}"
|
|
loop: '{{ hetzner_ssh_keys }}'
|
|
run_once: true
|