added array of config files

pull/5/head
Cian Hatton 3 years ago
parent 0043041c81
commit 37d74c1586

@ -13,6 +13,8 @@ services:
volumes: ["nextcloud_data"] volumes: ["nextcloud_data"]
- name: dashboards - name: dashboards
volumes: [] volumes: []
- name: nginx-proxy-manager
volumes: ["nginx-proxy-manager_data"]
docker_networks: docker_networks:
- nextcloud_net - nextcloud_net
@ -23,6 +25,12 @@ aws_s3:
region: "us-east-1" region: "us-east-1"
bucket: "backups" bucket: "backups"
dashy: # any files to be copied which are required in the docker compose files
config_directory: /etc/config/dashy # as volume mounts.
config_file: dashy-config.yml config_files:
- destination_directory: /etc/config/dashy
destination_file: dashy-config.yml
source_file: dashboards/dashy-config.yml
- destination_directory: /etc/config/olivetin
destination_file: config.yml
source_file: olivetin/config.yml

@ -0,0 +1,16 @@
version: "3"
services:
nginx-proxy-manager:
labels:
ie.cianhatton.backup.enabled: "true"
image: jlesage/nginx-proxy-manager
container_name: nginx-proxy-manager
restart: unless-stopped
ports:
- 8181:8181
- 80:8080
- 443:4443
volumes:
- "data:/config:rw"
volumes:
data:

@ -0,0 +1,19 @@
# Listen on all addresses available, port 1337
listenAddressSingleHTTPFrontend: 0.0.0.0:1337
# Choose from INFO (default), WARN and DEBUG
logLevel: "INFO"
# Actions (buttons) to show up on the WebUI:
actions:
# Docs: https://docs.olivetin.app/action-container-control.html
- title: Restart Plex
icon: plex
shell: docker restart plex
timeout: 30
- title: Restart Dashy
icon: restart
shell: docker restart dashy
timeout: 30
- title: Restart Olivetin
icon: restart
shell: docker restart olivetin
timeout: 30

@ -0,0 +1,12 @@
version: "3.8"
services:
olivetin:
container_name: olivetin
image: jamesread/olivetin
user: root
volumes:
- /etc/config/olivetin:/config
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "1337:1337"
restart: unless-stopped

@ -1,32 +1,34 @@
- name: Create a directory if it does not exist - name: Docker Compose | Create a directory if it does not exist
ansible.builtin.file: file:
path: "{{docker_compose_directory}}/{{item.name}}" path: "{{docker_compose_directory}}/{{item.name}}"
state: directory state: directory
mode: '0755' mode: '0755'
with_items: "{{services}}" with_items: "{{services}}"
- name: Copy Docker Compose Files - name: Docker Compose | Copy Docker Compose Files
copy: copy:
src: "{{item.name}}/docker-compose.yml" src: "{{item.name}}/docker-compose.yml"
dest: "{{docker_compose_directory}}/{{item.name}}/docker-compose.yml" dest: "{{docker_compose_directory}}/{{item.name}}/docker-compose.yml"
with_items: "{{services}}" with_items: "{{services}}"
- name: Dashy | Create a directory if it does not exist - name: Config Files | Create a directory if it does not exist
ansible.builtin.file: file:
path: "{{dashy.config_directory}}" path: "{{item.destination_directory}}"
state: directory state: directory
mode: '0755' mode: '0755'
with_items: "{{config_files}}"
- name: Dashy | Copy config file - name: Config Files | Copy config file
copy: copy:
src: "dashboards/dashy-config.yml" src: "{{item.source_file}}"
dest: "{{dashy.config_directory}}/{{dashy.config_file}}" dest: "{{item.destination_directory}}/{{item.destination_file}}"
with_items: "{{config_files}}"
- name: Install python dependencies (requests) - name: Install python dependencies (requests)
ansible.builtin.pip: ansible.builtin.pip:
name: requests name: requests
- name: Find docker volumes - name: Docker | Find docker volumes
shell: docker volume ls -f name={{item.name}} --format '{{ '{{' }} .Name {{ '}}' }}' shell: docker volume ls -f name={{item.name}} --format '{{ '{{' }} .Name {{ '}}' }}'
with_items: "{{services}}" with_items: "{{services}}"
register: find_volumes register: find_volumes
@ -34,7 +36,7 @@
- debug: msg="{{find_volumes.results | map(attribute='stdout_lines') | list | flatten }}" - debug: msg="{{find_volumes.results | map(attribute='stdout_lines') | list | flatten }}"
- name: Find volumes that need to be restored - name: Docker | Find volumes that need to be restored
script: scripts/find-volumes-to-restore.py script: scripts/find-volumes-to-restore.py
environment: environment:
EXISTING_VOLUMES: "{{ find_volumes.results | map(attribute='stdout_lines') | list | flatten }}" EXISTING_VOLUMES: "{{ find_volumes.results | map(attribute='stdout_lines') | list | flatten }}"
@ -46,7 +48,7 @@
- debug: msg="{{python_output.stdout_lines | list }}" - debug: msg="{{python_output.stdout_lines | list }}"
- name: Restore any missing backups from S3 - name: Docker Volume Backup | Restore any missing backups from S3
docker_container: docker_container:
command: "restore-volume --s3 --volume {{item}}" command: "restore-volume --s3 --volume {{item}}"
image: "ghcr.io/chatton/docker-volume-backup:v0.3.0" image: "ghcr.io/chatton/docker-volume-backup:v0.3.0"
@ -65,12 +67,12 @@
AWS_ENDPOINT: "{{aws_s3.s3_url}}" AWS_ENDPOINT: "{{aws_s3.s3_url}}"
with_items: "{{ python_output.stdout_lines }}" with_items: "{{ python_output.stdout_lines }}"
- name: Create required docker networks - name: Docker | Create required docker networks
docker_network: docker_network:
name: "{{item}}" name: "{{item}}"
with_items: "{{ docker_networks }}" with_items: "{{ docker_networks }}"
- name: Update Portainer Stack - name: Portainer | Update Stack
portainer: portainer:
username: admin username: admin
password: "{{portainer.password}}" password: "{{portainer.password}}"

Loading…
Cancel
Save