From dadd1de147abc51ed7e97072f9b47cb023780ebe Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Tue, 23 Jul 2024 18:51:39 +0200 Subject: [PATCH] ff --- roles/mgrote_zfs_sanoid/tasks/destination.yml | 7 ++++--- roles/mgrote_zfs_sanoid/templates/private_key.j2 | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 roles/mgrote_zfs_sanoid/templates/private_key.j2 diff --git a/roles/mgrote_zfs_sanoid/tasks/destination.yml b/roles/mgrote_zfs_sanoid/tasks/destination.yml index 1f5e936e..a69188a7 100644 --- a/roles/mgrote_zfs_sanoid/tasks/destination.yml +++ b/roles/mgrote_zfs_sanoid/tasks/destination.yml @@ -1,9 +1,8 @@ --- - name: template ssh private key become: true - ansible.builtin.copy: - content: | - "{{ sanoid_syncoid_ssh_privkey }}" + ansible.builtin.template: + src: private_key.j2 dest: "/etc/sanoid/.ssh/id_sanoid" owner: "{{ sanoid_user }}" group: "{{ sanoid_user_group }}" @@ -12,6 +11,8 @@ when: - sanoid_syncoid_destination_host + + - name: add user to sudoers become: true ansible.builtin.blockinfile: diff --git a/roles/mgrote_zfs_sanoid/templates/private_key.j2 b/roles/mgrote_zfs_sanoid/templates/private_key.j2 new file mode 100644 index 00000000..de719dbf --- /dev/null +++ b/roles/mgrote_zfs_sanoid/templates/private_key.j2 @@ -0,0 +1 @@ +{{ sanoid_syncoid_ssh_privkey }}