From 22c43ec52b7279749231257d16454faa5fc254fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Torma?= Date: Tue, 25 Jul 2023 15:43:46 +0200 Subject: [PATCH] adjust realmd --- roles/realmd/tasks/main.yaml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/roles/realmd/tasks/main.yaml b/roles/realmd/tasks/main.yaml index b0def1a..f7fd294 100644 --- a/roles/realmd/tasks/main.yaml +++ b/roles/realmd/tasks/main.yaml @@ -43,7 +43,8 @@ - name: Join to AD with realmd ansible.builtin.shell: - cmd: echo -e {{ join_passw }} | realm join -v -U Administrator intra.tormakris.dev + cmd: echo {{ join_passw }} | realm join -v -U Administrator intra.tormakris.dev + ignore_errors: True - name: Enable pam homedir create on first logon ansible.builtin.command: @@ -101,4 +102,22 @@ path: /etc/ssh/sshd_config line: "%linuxadmins@intra.tormakris.dev ALL=(ALL) NOPASSWD: ALL" when: checksudoers.found == 0 + +- name: Create home for tormakris + ansible.builtin.command: + cmd: mkhomedir_helper tormakris@intra.tormakris.dev + +- name: Copy tormakris home + ansible.builtin.copy: + src: /home/tormakris + dest: /home/tormakris@intra.tormakris.dev + remote_src: yes + owner: tormakris@intra.tormakris.dev + group: domain users@intra.tormakris.dev + +- name: "Update authorized_keys of tormakris" + ansible.posix.authorized_key: + user: tormakris@intra.tormakris.dev + state: present + key: https://static.tormakristof.eu/ssh.keys ...