Merge "system-config-run-borg-backup: rename hosts to distro"
This commit is contained in:
commit
74389454ce
@ -18,9 +18,9 @@ groups:
|
|||||||
- borg-backup01.region.provider.opendev.org
|
- borg-backup01.region.provider.opendev.org
|
||||||
|
|
||||||
borg-backup:
|
borg-backup:
|
||||||
- borg-backup-test01.opendev.org
|
- borg-backup-bionic.opendev.org
|
||||||
- borg-backup-test02.opendev.org
|
- borg-backup-focal.opendev.org
|
||||||
- borg-backup-test03.opendev.org
|
- borg-backup-jammy.opendev.org
|
||||||
|
|
||||||
kerberos-kdc:
|
kerberos-kdc:
|
||||||
- kdc-primary.opendev.org
|
- kdc-primary.opendev.org
|
||||||
|
@ -16,9 +16,9 @@ import os.path
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
testinfra_hosts = ['borg-backup01.region.provider.opendev.org',
|
testinfra_hosts = ['borg-backup01.region.provider.opendev.org',
|
||||||
'borg-backup-test01.opendev.org',
|
'borg-backup-bionic.opendev.org',
|
||||||
'borg-backup-test02.opendev.org',
|
'borg-backup-focal.opendev.org',
|
||||||
'borg-backup-test03.opendev.org']
|
'borg-backup-jammy.opendev.org']
|
||||||
|
|
||||||
|
|
||||||
def test_borg_installed(host):
|
def test_borg_installed(host):
|
||||||
@ -33,12 +33,12 @@ def test_borg_installed(host):
|
|||||||
|
|
||||||
def test_borg_server_users(host):
|
def test_borg_server_users(host):
|
||||||
hostname = host.backend.get_hostname()
|
hostname = host.backend.get_hostname()
|
||||||
if hostname.startswith('borg-backup-test'):
|
if hostname != 'borg-backup01.region.provider.opendev.org':
|
||||||
pytest.skip()
|
pytest.skip()
|
||||||
|
|
||||||
for username in ('borg-borg-backup-test01',
|
for username in ('borg-borg-backup-bionic',
|
||||||
'borg-borg-backup-test02',
|
'borg-borg-backup-focal',
|
||||||
'borg-borg-backup-test03'):
|
'borg-borg-backup-jammy'):
|
||||||
homedir = os.path.join('/opt/backups/', username)
|
homedir = os.path.join('/opt/backups/', username)
|
||||||
borg_repo = os.path.join(homedir, 'backup')
|
borg_repo = os.path.join(homedir, 'backup')
|
||||||
authorized_keys = os.path.join(homedir, '.ssh', 'authorized_keys')
|
authorized_keys = os.path.join(homedir, '.ssh', 'authorized_keys')
|
||||||
@ -85,8 +85,8 @@ def test_borg_backup(host):
|
|||||||
|
|
||||||
cmd = host.run('ls /opt/backups')
|
cmd = host.run('ls /opt/backups')
|
||||||
# this directory should now have a directory
|
# this directory should now have a directory
|
||||||
# borg-backup-test0X-YYYY-MM-DDT...
|
# borg-backup-<distro>-YYYY-MM-DDT...
|
||||||
assert 'borg-backup-test' in cmd.stdout
|
assert hostname.split('.')[0] in cmd.stdout
|
||||||
|
|
||||||
# unmount it for sanity
|
# unmount it for sanity
|
||||||
cmd = host.run('umount /opt/backups')
|
cmd = host.run('umount /opt/backups')
|
||||||
@ -94,7 +94,7 @@ def test_borg_backup(host):
|
|||||||
|
|
||||||
def test_borg_server_prune(host):
|
def test_borg_server_prune(host):
|
||||||
hostname = host.backend.get_hostname()
|
hostname = host.backend.get_hostname()
|
||||||
if hostname.startswith('borg-backup-test'):
|
if hostname != 'borg-backup01.region.provider.opendev.org':
|
||||||
pytest.skip()
|
pytest.skip()
|
||||||
|
|
||||||
cmd = host.run('echo "prune" | /usr/local/bin/prune-borg-backups &> /var/log/prune-borg-backups.log')
|
cmd = host.run('echo "prune" | /usr/local/bin/prune-borg-backups &> /var/log/prune-borg-backups.log')
|
||||||
@ -102,7 +102,7 @@ def test_borg_server_prune(host):
|
|||||||
|
|
||||||
def test_borg_server_verify(host):
|
def test_borg_server_verify(host):
|
||||||
hostname = host.backend.get_hostname()
|
hostname = host.backend.get_hostname()
|
||||||
if hostname.startswith('borg-backup-test'):
|
if hostname != 'borg-backup01.region.provider.opendev.org':
|
||||||
pytest.skip()
|
pytest.skip()
|
||||||
|
|
||||||
cmd = host.run('/usr/local/bin/verify-borg-backups &> /var/log/verify-borg-backups.log')
|
cmd = host.run('/usr/local/bin/verify-borg-backups &> /var/log/verify-borg-backups.log')
|
||||||
|
@ -378,11 +378,11 @@
|
|||||||
label: ubuntu-bionic
|
label: ubuntu-bionic
|
||||||
- name: borg-backup01.region.provider.opendev.org
|
- name: borg-backup01.region.provider.opendev.org
|
||||||
label: ubuntu-focal
|
label: ubuntu-focal
|
||||||
- name: borg-backup-test01.opendev.org
|
- name: borg-backup-focal.opendev.org
|
||||||
label: ubuntu-focal
|
label: ubuntu-focal
|
||||||
- name: borg-backup-test02.opendev.org
|
- name: borg-backup-bionic.opendev.org
|
||||||
label: ubuntu-bionic
|
label: ubuntu-bionic
|
||||||
- name: borg-backup-test03.opendev.org
|
- name: borg-backup-jammy.opendev.org
|
||||||
label: ubuntu-jammy
|
label: ubuntu-jammy
|
||||||
vars:
|
vars:
|
||||||
run_playbooks:
|
run_playbooks:
|
||||||
@ -402,13 +402,13 @@
|
|||||||
host_copy_output:
|
host_copy_output:
|
||||||
'/var/log/prune-borg-backups.log': logs
|
'/var/log/prune-borg-backups.log': logs
|
||||||
'/var/log/verify-borg-backups.log': logs
|
'/var/log/verify-borg-backups.log': logs
|
||||||
borg-backup-test01.opendev.org:
|
borg-backup-bionic.opendev.org:
|
||||||
host_copy_output:
|
host_copy_output:
|
||||||
'/var/log/borg-backup-borg-backup01.region.provider.opendev.org.log': logs
|
'/var/log/borg-backup-borg-backup01.region.provider.opendev.org.log': logs
|
||||||
borg-backup-test02.opendev.org:
|
borg-backup-focal.opendev.org:
|
||||||
host_copy_output:
|
host_copy_output:
|
||||||
'/var/log/borg-backup-borg-backup01.region.provider.opendev.org.log': logs
|
'/var/log/borg-backup-borg-backup01.region.provider.opendev.org.log': logs
|
||||||
borg-backup-test03.opendev.org:
|
borg-backup-jammy.opendev.org:
|
||||||
host_copy_output:
|
host_copy_output:
|
||||||
'/var/log/borg-backup-borg-backup01.region.provider.opendev.org.log': logs
|
'/var/log/borg-backup-borg-backup01.region.provider.opendev.org.log': logs
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user