1
0
Fork 0
This repository has been archived on 2023-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
fedihub-ansible/roles/matrix/tasks/media_repo.yml

67 lines
2.1 KiB
YAML

---
- name: Install system packages for Matrix Media Repo
apt:
name: golang
notify: Load, enable and restart Matrix Media Repo
- name: Create Matrix Media Repo system group
group:
name: '{{ matrix__media_repo__group }}'
system: true
notify: Load, enable and restart Matrix Media Repo
- name: Create Matrix Media Repo system user
user:
name: '{{ matrix__media_repo__user }}'
group: '{{ matrix__media_repo__group }}'
system: true
create_home: true
home: '{{ matrix__media_repo__lib_dir }}'
notify: Load, enable and restart Matrix Media Repo
- name: Create Matrix Media Repo directories
file:
state: directory
path: '{{ item }}'
mode: 'u=rwx,g=rwx,o=rx'
owner: '{{ matrix__media_repo__user }}'
group: '{{ matrix__media_repo__group }}'
with_items:
- '{{ matrix__media_repo__conf_dir }}'
- '{{ matrix__media_repo__opt_dir }}'
- '{{ matrix__media_repo__src_dir }}'
notify: Load, enable and restart Matrix Media Repo
- name: Create Matrix Media Repo config
template:
src: '../templates/media_repo/config.yaml'
dest: '{{ matrix__media_repo__conf_file }}'
mode: 'u=rw,g=rw,o='
owner: '{{ matrix__media_repo__user }}'
group: '{{ matrix__media_repo__group }}'
notify: Load, enable and restart Matrix Media Repo
- name: Create Matrix Media Repo systemd service
template:
src: '../templates/media_repo/matrix-media-repo.service'
dest: '{{ matrix__media_repo__service_file }}'
mode: 'u=rw,g=rw,o=r'
owner: root
group: root
notify: Load, enable and restart Matrix Media Repo
- name: Get Matrix Media Repo source code
become_user: '{{ matrix__media_repo__user }}'
git:
repo: 'https://github.com/turt2live/matrix-media-repo.git'
dest: '{{ matrix__media_repo__src_dir }}'
version: 'b73a0082dd22e9ff447950b18e9ca49c73a6d912'
- name: Build Matrix Media Repo source code
become_user: '{{ matrix__media_repo__user }}'
command:
chdir: '{{ matrix__media_repo__src_dir }}'
creates: '{{ matrix__media_repo__src_dir }}/bin/media_repo'
cmd: '/bin/bash {{ matrix__media_repo__src_dir }}/build.sh'
notify: Load, enable and restart Matrix Media Repo