fixup! Per Device SSH-Keys
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-09-14 14:54:09 +02:00
parent e6255c76e3
commit 6976503097
2 changed files with 5 additions and 7 deletions

View File

@ -18,18 +18,15 @@
become: false
changed_when: false
register: pubkey
community.crypto.openssl_publickey:
format: OpenSSH
path: "/tmp/{{ inventory_hostname }}.pub"
privatekey_path: "{{ ansible_ssh_private_key_file }}"
return_content: true
ansible.builtin.command:
cmd: "ssh-keygen -y -f {{ ansible_ssh_private_key_file }}"
- name: Deploy Machine SSH-Key
ansible.posix.authorized_key:
user: "{{ ansible_user }}"
state: present
manage_dir: false
path: "/etc/ssh/authorized_keys/{{ ansible_user }}"
key: "{{ pubkey.publickey }} drone-machine-deploy"
key: "{{ pubkey.stdout }}"
- name: Deploy Common SSH-Keys
ansible.posix.authorized_key:
user: "{{ ansible_user }}"