From 6d3843c3df5963115677a6217d8469d533e112bc Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Tue, 23 Jul 2024 18:49:21 +0200 Subject: [PATCH 1/2] dd --- roles/mgrote_zfs_sanoid/tasks/destination.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/mgrote_zfs_sanoid/tasks/destination.yml b/roles/mgrote_zfs_sanoid/tasks/destination.yml index 1e0fcd19..1f5e936e 100644 --- a/roles/mgrote_zfs_sanoid/tasks/destination.yml +++ b/roles/mgrote_zfs_sanoid/tasks/destination.yml @@ -2,7 +2,8 @@ - name: template ssh private key become: true ansible.builtin.copy: - content: "{{ sanoid_syncoid_ssh_privkey }}" + content: | + "{{ sanoid_syncoid_ssh_privkey }}" dest: "/etc/sanoid/.ssh/id_sanoid" owner: "{{ sanoid_user }}" group: "{{ sanoid_user_group }}" -- 2.43.0 From dadd1de147abc51ed7e97072f9b47cb023780ebe Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Tue, 23 Jul 2024 18:51:39 +0200 Subject: [PATCH 2/2] 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 }} -- 2.43.0