version = node.metadata['pleroma']['version'] users = { 'pleroma': { 'home': '/opt/pleroma', }, } directories = { '/opt/pleroma': {}, '/var/pleroma': { 'owner': 'pleroma', }, '/var/pleroma/uploads': { 'owner': 'pleroma', }, '/var/pleroma/static': { 'owner': 'pleroma', }, '/var/pleroma/static/emoji': { 'owner': 'pleroma', }, } if node.has_bundle('zfs'): directories['/var/pleroma']['needs'] = { 'zfs_dataset:tank/pleroma-data', } actions = { 'pleroma_download_release': { 'command': \ 'cd /opt/pleroma/ && '\ f'wget -O/opt/pleroma/pleroma.zip https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/stable/download?job=amd64 && '\ 'rm -rf release && '\ 'unzip /opt/pleroma/pleroma.zip', 'unless': f'[ "$(cat /opt/pleroma/.bundlewrap_installed_version)" = "{version}" ]', 'needs': { 'directory:/opt/pleroma', }, }, 'pleroma_create_schema': { 'triggered': True, 'command': 'sudo -u pleroma /opt/pleroma/src/rel/files/bin/pleroma_ctl create', 'triggered_by': { 'postgres_db:pleroma', }, }. } files = { '/opt/pleroma/pleroma.config.exs': { 'content_type': 'mako', }, }