Compare commits
3 commits
e74b43fde4
...
97334b21ad
Author | SHA1 | Date | |
---|---|---|---|
![]() |
97334b21ad | ||
![]() |
589fca4e1d | ||
![]() |
3a3111f669 |
2 changed files with 25 additions and 19 deletions
|
@ -17,11 +17,11 @@ downloads[f'/tmp/nextcloud-{version}.tar.bz2'] = {
|
|||
'triggered': True,
|
||||
}
|
||||
actions['delete_nextcloud'] = {
|
||||
'command': 'find /opt/nextcloud -maxdepth 1 ! -path /opt/nextcloud ! -name config ! -name userapps -exec rm -rf {} \;',
|
||||
'command': 'rm -rf /opt/nextcloud/*',
|
||||
'triggered': True,
|
||||
}
|
||||
actions['extract_nextcloud'] = {
|
||||
'command': f'tar xfvj /tmp/nextcloud-{version}.tar.bz2 --skip-old-files --strip 1 -C /opt/nextcloud nextcloud',
|
||||
'command': f'tar xfvj /tmp/nextcloud-{version}.tar.bz2 --exclude "^config" --strip 1 -C /opt/nextcloud nextcloud',
|
||||
'unless': f"""php -r 'include "/opt/nextcloud/version.php"; echo "$OC_VersionString";' | grep -q '^{version}$'""",
|
||||
'preceded_by': [
|
||||
'action:delete_nextcloud',
|
||||
|
@ -52,6 +52,15 @@ directories['/var/lib/nextcloud/.cache'] = {
|
|||
'owner': 'www-data',
|
||||
'group': 'www-data',
|
||||
}
|
||||
files['/etc/nextcloud/CAN_INSTALL'] = {
|
||||
'content': '',
|
||||
'owner': 'www-data',
|
||||
'group': 'www-data',
|
||||
'mode': '640',
|
||||
'needs': [
|
||||
'directory:/etc/nextcloud',
|
||||
],
|
||||
}
|
||||
files['/etc/nextcloud/managed.config.php'] = {
|
||||
'content_type': 'mako',
|
||||
'owner': 'www-data',
|
||||
|
@ -61,8 +70,7 @@ files['/etc/nextcloud/managed.config.php'] = {
|
|||
'db_password': node.metadata.get('postgresql/roles/nextcloud/password'),
|
||||
},
|
||||
'needs': [
|
||||
'directory:/opt/nextcloud',
|
||||
'action:delete_nextcloud',
|
||||
'directory:/etc/nextcloud',
|
||||
],
|
||||
}
|
||||
actions['symlink_/opt/nextcloud/config'] = {
|
||||
|
@ -104,6 +112,7 @@ actions['install_nextcloud'] = {
|
|||
'directory:/var/lib/nextcloud',
|
||||
'directory:/var/lib/nextcloud/.apps',
|
||||
'directory:/var/lib/nextcloud/.cache',
|
||||
'file:/etc/nextcloud/CAN_INSTALL',
|
||||
'file:/etc/nextcloud/managed.config.php',
|
||||
'action:extract_nextcloud',
|
||||
'action:symlink_/opt/nextcloud/userapps',
|
||||
|
|
|
@ -30,6 +30,11 @@ defaults = {
|
|||
},
|
||||
},
|
||||
},
|
||||
'backup': {
|
||||
'files': [
|
||||
'/etc/nextcloud/config.php',
|
||||
],
|
||||
},
|
||||
'nextcloud': {
|
||||
'admin_user': 'admin',
|
||||
'admin_pass': repo.vault.password_for(f'{node.name} nextcloud admin pw'),
|
||||
|
@ -54,19 +59,11 @@ defaults = {
|
|||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'nextcloud/instance_id',
|
||||
)
|
||||
def instance_id(metadata):
|
||||
return {
|
||||
'nextcloud': {
|
||||
'instance_id': repo.libs.derive_string.derive_string(
|
||||
UUID(metadata.get('id')).bytes,
|
||||
length=12,
|
||||
choices=(string.ascii_lowercase + string.digits).encode(),
|
||||
).decode(),
|
||||
'zfs': {
|
||||
'datasets': {
|
||||
'tank/nexcloud': {
|
||||
'mountpoint': '/var/lib/nextcloud',
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue