diff --git a/docs/rolereference.rst b/docs/rolereference.rst index d70de99ba1e81e627d39bec963173bb4f4f27864..222aed42f92bdc284496f474707c6d93ffca1e39 100644 --- a/docs/rolereference.rst +++ b/docs/rolereference.rst @@ -2341,6 +2341,7 @@ Distribution compatibility Role is compatible with the following distributions: - Debian 9 (Stretch) +- Debian 10 (Buster) Examples diff --git a/roles/backup_client/molecule/default/molecule.yml b/roles/backup_client/molecule/default/molecule.yml index a97db4ee451de6de328a3d6c5a66e62fb73e0b4f..4c9d403b9fb43ff2e9e164d619babe2ed7fcb5d1 100644 --- a/roles/backup_client/molecule/default/molecule.yml +++ b/roles/backup_client/molecule/default/molecule.yml @@ -18,7 +18,7 @@ lint: # stupid legacy design decisions! platforms: - name: backup-server - box: debian/contrib-stretch64 + box: debian/contrib-buster64 memory: 512 cpus: 1 interfaces: @@ -27,6 +27,30 @@ platforms: network_name: private_network type: static + - name: parameters-mandatory-b64 + groups: + - parameters-mandatory + box: debian/contrib-buster64 + memory: 256 + cpus: 1 + interfaces: + - auto_config: true + ip: 10.31.127.20 + network_name: private_network + type: static + + - name: parameters-optional-b64 + groups: + - parameters-optional + box: debian/contrib-buster64 + memory: 256 + cpus: 1 + interfaces: + - auto_config: true + ip: 10.31.127.21 + network_name: private_network + type: static + - name: parameters-mandatory-s64 groups: - parameters-mandatory diff --git a/roles/backup_client/molecule/default/prepare.yml b/roles/backup_client/molecule/default/prepare.yml index b712540408ddd9a5c46ad4d4451d80193a87cd50..cbf873b019caa40803532c5e47005ea393e4ffb3 100644 --- a/roles/backup_client/molecule/default/prepare.yml +++ b/roles/backup_client/molecule/default/prepare.yml @@ -86,7 +86,7 @@ with_items: - /home/backupuser - /home/bak-parameters-mandatory-s64 - - /home/bak-parameters-mandatory-j64 + - /home/bak-parameters-mandatory-b64 - name: Set-up duplicity backup directories file: @@ -107,7 +107,7 @@ mode: 0700 with_items: - "parameters-optional-s64" - - "parameters-optional-j64" + - "parameters-optional-b64" handlers: - name: Restart ssh @@ -117,9 +117,9 @@ vars: backup_users: - - name: bak-parameters-mandatory-j64 - key: "{{ lookup('file', 'tests/data/ssh/parameters-mandatory.pub') }}" - name: bak-parameters-mandatory-s64 key: "{{ lookup('file', 'tests/data/ssh/parameters-mandatory.pub') }}" + - name: bak-parameters-mandatory-b64 + key: "{{ lookup('file', 'tests/data/ssh/parameters-mandatory.pub') }}" - name: backupuser key: "{{ lookup('file', 'tests/data/ssh/parameters-optional.pub') }}" diff --git a/roles/backup_client/molecule/default/tests/test_parameters_mandatory.py b/roles/backup_client/molecule/default/tests/test_parameters_mandatory.py index 3629d88ee7feb6739ef2107e20bc98453cced8b7..a84a56d2ccd614a8b23db22c8f08cecb0a2a8dd5 100644 --- a/roles/backup_client/molecule/default/tests/test_parameters_mandatory.py +++ b/roles/backup_client/molecule/default/tests/test_parameters_mandatory.py @@ -62,13 +62,15 @@ def test_duply_configuration_content(host): Tests if duply configuration has been set-up correctly. """ + hostname = host.run('hostname').stdout.strip() + with host.sudo(): duply_configuration = host.file('/etc/duply/main/conf') assert "GPG_KEYS_ENC='59C26F031A129C54'" in duply_configuration.content_string assert "GPG_KEY_SIGN='59C26F031A129C54'" in duply_configuration.content_string - assert "TARGET='pexpect+sftp://bak-parameters-mandatory-s64@10.31.127.10:2222//duplicity'" in duply_configuration.content_string + assert "TARGET='pexpect+sftp://bak-%s@10.31.127.10:2222//duplicity'" % hostname in duply_configuration.content_string assert "DUPL_PARAMS=\"$DUPL_PARAMS --ssh-options='-oLogLevel=ERROR -oUserKnownHostsFile=/dev/null " \ "-oGlobalKnownHostsFile=/etc/duply/main/ssh/known_hosts -oIdentityFile=/etc/duply/main/ssh/identity'\"" in duply_configuration.content_string diff --git a/roles/backup_client/molecule/default/tests/test_parameters_optional.py b/roles/backup_client/molecule/default/tests/test_parameters_optional.py index 478d845b80c12b708870ba97a6dc24b816b6ec89..dc02af311ff1ca1585200ea84ebb40317e61518e 100644 --- a/roles/backup_client/molecule/default/tests/test_parameters_optional.py +++ b/roles/backup_client/molecule/default/tests/test_parameters_optional.py @@ -61,13 +61,15 @@ def test_duply_configuration_content(host): Tests if duply configuration has been set-up correctly. """ + hostname = host.run('hostname').stdout.strip() + with host.sudo(): duply_configuration = host.file('/etc/duply/main/conf') assert "GPG_KEYS_ENC='C4B2AE9F7A4F400A,3093C91BC3A9444B,86816FD928063B3F,8A14CD6C71223B72'" in duply_configuration.content_string assert "GPG_KEY_SIGN='C4B2AE9F7A4F400A'" in duply_configuration.content_string - assert "TARGET='pexpect+sftp://backupuser@10.31.127.10:3333//duplicity/parameters-optional-s64'" in duply_configuration.content_string + assert "TARGET='pexpect+sftp://backupuser@10.31.127.10:3333//duplicity/%s'" % hostname in duply_configuration.content_string assert "DUPL_PARAMS=\"$DUPL_PARAMS --ssh-options='-oLogLevel=ERROR -oUserKnownHostsFile=/dev/null " \ "-oGlobalKnownHostsFile=/etc/duply/main/ssh/known_hosts -oIdentityFile=/etc/duply/main/ssh/identity'\"" in duply_configuration.content_string