diff --git a/roles/backup_client/molecule/default/prepare.yml b/roles/backup_client/molecule/default/prepare.yml index 8bf085c6f7df3a7fdb8133d90fa225d7a19ceb9a..c779fe1fd9523abe1f8210e29f3dfdba4a66c0fa 100644 --- a/roles/backup_client/molecule/default/prepare.yml +++ b/roles/backup_client/molecule/default/prepare.yml @@ -36,10 +36,26 @@ notify: - Restart ssh + - name: Drop the outdated public keys + file: + path: "{{ item }}" + state: absent + with_items: + - /etc/ssh/ssh_host_rsa_key.pub + - /etc/ssh/ssh_host_ed25519_key.pub + - /etc/ssh/ssh_host_ecdsa_key.pub + + - name: Force the use of internal-sftp subsystem fro SFTP + lineinfile: + path: /etc/ssh/sshd_config + regexp: "^Subsystem.*sftp" + line: "Subsystem sftp internal-sftp" + state: present + - name: Deploy custom SSH server configuration that chroots users copy: - src: "tests/data/backup_server_custom-sshd_config" - dest: "/etc/ssh/sshd_config" + src: "tests/data/backup_server-sshd-chroot_backup_users.conf" + dest: "/etc/ssh/sshd_config.d/chroot_backup_users.conf" owner: root group: root mode: 0600 @@ -86,7 +102,7 @@ with_items: - /home/backupuser - /home/bak-param-mandatory-buster - - /home/bak-param-mandatory-buster + - /home/bak-param-mandatory-bullseye - name: Set-up duplicity backup directories file: @@ -118,5 +134,7 @@ backup_users: - name: bak-param-mandatory-buster key: "{{ lookup('file', 'tests/data/ssh/parameters-mandatory.pub') }}" + - name: bak-param-mandatory-bullseye + key: "{{ lookup('file', 'tests/data/ssh/parameters-mandatory.pub') }}" - name: backupuser key: "{{ lookup('file', 'tests/data/ssh/parameters-optional.pub') }}"