snackpot.yml - add docker compose config

Nominally working and tested on a remote VM
This commit is contained in:
Nick Stokoe
2021-01-11 11:54:44 +00:00
parent e887ad1898
commit 32f6767cd4
13 changed files with 457 additions and 0 deletions

View File

@@ -1,6 +1,18 @@
---
- name: snackpot | server
hosts: all
vars:
nextcloud_db_password: "{{lookup('passwordstore', 'servers/snackpot/nextcloud_db.password')}}"
postgres_password: "{{lookup('passwordstore', 'servers/snackpot/postgres_db.password')}}"
postgres_db_user: postgres
nextcloud_hostname: nc.noodlefactory.co.uk
nextcloud_base_dir: /var/www/html
nextcloud_data_dir: /var/www/data
nextcloud_db_user: nextcloud
nextcloud_db: nextcloud
letsencrypt_email: webmaster@noodlefactory.co.uk
docker_compose_base_dir: /opt/docker-compose
tasks:
- include_role:
name: docker_compose
@@ -8,3 +20,40 @@
tags: docker_compose
vars:
docker_compose_version: 1.27.4
- name: ensure directory exists
file:
path: "{{ docker_compose_base_dir }}/{{ item.path }}"
state: directory
with_filetree: templates/docker-compose
when: item.state == "directory"
- name: configure docker compose files
template:
dest: "{{ docker_compose_base_dir }}/{{ item.path }}"
src: "docker-compose/{{ item.path }}"
owner: root
group: root
mode: 0440
backup: yes
notify: restart docker compose services
with_filetree: templates/docker-compose
when: item.state == "file" and not item.path.endswith("~")
- name: ensure directory exists
file:
path: "{{ docker_compose_base_dir }}/bin"
state: directory
- name: install binaries
template:
dest: "{{ docker_compose_base_dir }}/bin/{{ item.path }}"
src: "bin/{{ item.path }}"
owner: root
group: root
mode: 0550
with_filetree: templates/bin
when: item.state == "file" and not item.path.endswith("~")
tags: test
# config nextcloud
# hide pg password