mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-13 22:26:49 +00:00
28 lines
674 B
YAML
28 lines
674 B
YAML
- name: "Include SSH for user root"
|
|
include_role:
|
|
name: 'sys-svc-ssh'
|
|
when: not (run_once_sys_svc_ssh | default(false) | bool)
|
|
|
|
- name: Ensure '{{ USER_ROOT_SSH_DIR }}' exists
|
|
file:
|
|
path: "{{ USER_ROOT_SSH_DIR }}"
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: '0700'
|
|
|
|
- name: Generate a SSH key for root if it does not exist
|
|
community.crypto.openssh_keypair:
|
|
path: "{{ USER_ROOT_SSH_KEY_PRIVATE }}"
|
|
type: rsa
|
|
size: 4096
|
|
|
|
- name: Display the public SSH key
|
|
command: "cat {{ USER_ROOT_SSH_KEY_PUBLIC }}"
|
|
register: public_key
|
|
changed_when: false
|
|
|
|
- name: Output the public SSH key
|
|
debug:
|
|
msg: "{{ public_key.stdout }}"
|