Client-Ansible-Setup/services/service_invidious/deploy-service.yml

43 lines
1.5 KiB
YAML
Executable File

- hosts: localhost
become: 'yes'
vars:
ansible_become_method: doas
tasks:
- name: Create necessary directories
ansible.builtin.file:
path: "{{ item }}"
owner: service_invidious
group: service_invidious
state: directory
loop:
- "{{ services_directory }}/service_invidious/"
- "{{ services_directory }}/service_invidious/postgres-data"
- name: Copy docker compose config and other invidious files
ansible.builtin.template:
src: "{{ item }}"
dest: "{{ services_directory }}/service_invidious/{{ item }}"
owner: service_invidious
group: service_invidious
loop:
- docker-compose.yml
- name: Copy postgresql config and other database files
ansible.builtin.template:
src: "{{ item }}"
dest: "{{ services_directory }}/service_invidious/postgres-data/{{ item }}"
owner: service_invidious
group: service_invidious
loop:
- postgresql.conf
# Note: Currently the repository has to be cloned, this is because the init-invidious-db.sh file and the config/sql directory have to be mounted to the postgres container. This "problem" will be solved in the future.
- name: Clone invidious git repository
ansible.builtin.git:
repo: https://github.com/iv-org/invidious.git
dest: "{{ services_directory }}/service_invidious/invidious-git"
- name: Debug Finish message
debug:
msg: Ansible playbook has finished!