fixup! Per Device SSH-Keys
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -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 }}"
|
||||
|
Reference in New Issue
Block a user