diff --git a/playbooks/init_hetzer_vm.yaml b/playbooks/init_hetzer_vm.yaml new file mode 100644 index 0000000..b2bcbb9 --- /dev/null +++ b/playbooks/init_hetzer_vm.yaml @@ -0,0 +1,25 @@ +--- +- name: Ensure cit user + hosts: all + roles: + - cit_user + +- name: Set the authorized_keys of the cit user to the authorized_keys of the root user + hosts: all + tasks: + - name: Ensure cit user .ssh directory + ansible.builtin.file: + path: /home/cit/.ssh + state: directory + owner: cit + group: cit + mode: "0700" + + - name: Copy the root users authorized_keys for the cit user + ansible.builtin.copy: + src: /root/.ssh/authorized_keys + remote_src: true + dest: /home/cit/.ssh/authorized_keys + owner: cit + group: cit + mode: "0600"