paramaterizing qnap paths

pull/10/head
Cian Hatton 3 years ago
parent 525dd4607a
commit 16223f39af

@ -1,29 +0,0 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

@ -1,33 +0,0 @@
---
# Based on ansible-lint config
extends: default
rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation: disable
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
truthy: disable

@ -1,38 +0,0 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

@ -1,2 +0,0 @@
---
# handlers file for setup_docker

@ -1,7 +0,0 @@
---
- name: Converge
hosts: all
tasks:
- name: "Include chatton.setup_docker"
include_role:
name: "chatton.setup_docker"

@ -1,29 +0,0 @@
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: instance
image: geerlingguy/docker-debian10-ansible:latest
privileged: true
pre_build_image: true
provisioner:
name: ansible
verifier:
name: ansible
scenario:
test_sequence:
# - dependency
# - lint
# - cleanup
- destroy
- syntax
- create
# - prepare
- converge
- idempotence
# - side_effect
- verify
# - cleanup
- destroy

@ -1,10 +0,0 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Example assertion
ansible.builtin.assert:
that: true

@ -42,4 +42,4 @@
- name: Ensure docker is started - name: Ensure docker is started
service: service:
name: docker name: docker
state: started state: started

@ -1,5 +0,0 @@
---
- hosts: localhost
remote_user: root
roles:
- setup_docker

@ -1,2 +0,0 @@
---
# vars file for setup_docker

@ -1,5 +1,4 @@
--- ---
docker_compose_directory: /etc/docker-compose
services: services:
- name: gitea - name: gitea
- name: mealie - name: mealie
@ -15,14 +14,31 @@ services:
- name: mariadb - name: mariadb
- name: photoprism - name: photoprism
# any additional docker networks that should be created
docker_networks: docker_networks:
- mariadb_net - mariadb_net
qnap:
# path on qnap where downloads go
downloads_dir: /mnt/ssd0/downloads
# path on qnap where plex transcoding happens
transcoding_dir: /mnt/ssd0/transcoding
# path on qnap where movies are stored
movies_dir: /mnt/test/media/movies
# path on qnap where tv shows are stored
tv_dir: /mnt/test/media/tv
# path on qnap where docker compose files are stored
docker_compose_directory: /etc/docker-compose
# path on qnap where backups are stored
backups_dir: /mnt/test/backups
# dashy related config
dashy: dashy:
destination_dir: /etc/config/dashy destination_dir: /etc/config/dashy
destination_file: dashy-config.yml destination_file: dashy-config.yml
source_file: dashboards/dashy-config.yml source_file: dashboards/dashy-config.yml
# olivetin related config
olivetin: olivetin:
destination_dir: /etc/config/olivetin destination_dir: /etc/config/olivetin
destination_file: config.yml destination_file: config.yml

@ -12,7 +12,7 @@
- name: Docker Compose | Create a directory if it does not exist - name: Docker Compose | Create a directory if it does not exist
file: file:
path: "{{docker_compose_directory}}/{{item.name}}" path: "{{qnap.docker_compose_directory}}/{{item.name}}"
state: directory state: directory
mode: '0755' mode: '0755'
with_items: "{{services}}" with_items: "{{services}}"
@ -20,7 +20,7 @@
- name: Docker Compose | Template Docker Compose Files - name: Docker Compose | Template Docker Compose Files
template: template:
src: "{{item.name}}.j2" src: "{{item.name}}.j2"
dest: "{{docker_compose_directory}}/{{item.name}}/docker-compose.yml" dest: "{{qnap.docker_compose_directory}}/{{item.name}}/docker-compose.yml"
with_items: "{{services}}" with_items: "{{services}}"
@ -64,7 +64,7 @@
environment: environment:
EXISTING_VOLUMES: "{{ find_volumes.results | map(attribute='stdout_lines') | list | flatten }}" EXISTING_VOLUMES: "{{ find_volumes.results | map(attribute='stdout_lines') | list | flatten }}"
SERVICES: "{{ services }}" SERVICES: "{{ services }}"
DOCKER_COMPOSE_DIR: "{{docker_compose_directory}}" DOCKER_COMPOSE_DIR: "{{qnap.docker_compose_directory}}"
args: args:
executable: python3 executable: python3
register: python_output register: python_output
@ -100,7 +100,7 @@
portainer: portainer:
username: admin username: admin
password: "{{portainer.password}}" password: "{{portainer.password}}"
docker_compose_file_path: "{{docker_compose_directory}}/{{ item.name }}/docker-compose.yml" docker_compose_file_path: "{{qnap.docker_compose_directory}}/{{ item.name }}/docker-compose.yml"
env_file_path: "{{docker_compose_directory}}/{{ item.name }}/stack.env" env_file_path: "{{qnap.docker_compose_directory}}/{{ item.name }}/stack.env"
stack_name: "{{ item.name }}" stack_name: "{{ item.name }}"
with_items: "{{services}}" with_items: "{{services}}"

@ -25,5 +25,5 @@ services:
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
- /mnt/hdds/backups:/backups - {{qnap.backups_dir}}:/backups
- /tmp:/tmp - /tmp:/tmp

@ -15,9 +15,9 @@ services:
- VERSION=docker - VERSION=docker
volumes: volumes:
- config:/config - config:/config
- /mnt/hdds/media/tv:/tv - {{ qnap.tv_dir }}:/tv
- /mnt/hdds/media/movies:/movies - {{ qnap.movies_dir }}:/movies
- /mnt/ssd0/transcoding:/transcoding - {{ qnap.transcoding_dir }}:/transcoding
restart: unless-stopped restart: unless-stopped
devices: devices:
- /dev/dri:/dev/dri - /dev/dri:/dev/dri

@ -46,8 +46,8 @@ services:
- TZ=Europe/London - TZ=Europe/London
- WEBUI_PORT=15000 - WEBUI_PORT=15000
volumes: volumes:
- "qbittorrent_config:/config" - qbittorrent_config:/config
- "/mnt/ssd0/downloads:/downloads" - {{ qnap.downloads_dir }}:/downloads
restart: unless-stopped restart: unless-stopped
radarr: radarr:
@ -63,9 +63,9 @@ services:
- PGID=1000 - PGID=1000
- TZ=Europe/London - TZ=Europe/London
volumes: volumes:
- "radarr_config:/config" - radarr_config:/config
- "/mnt/hdds/media/movies:/movies" - {{ qnap.movies_dir }}:/movies
- "/mnt/ssd0/downloads:/downloads" - {{ qnap.downloads_dir }}:/downloads
restart: unless-stopped restart: unless-stopped
sonarr: sonarr:
@ -81,9 +81,9 @@ services:
- PGID=1000 - PGID=1000
- TZ=Europe/London - TZ=Europe/London
volumes: volumes:
- "sonarr_config:/config" - sonarr_config:/config
- "/mnt/hdds/media/tv:/tv" - {{ qnap.tv_dir }}:/tv
- "/mnt/ssd0/downloads:/downloads" - {{ qnap.downloads_dir }}:/downloads
restart: unless-stopped restart: unless-stopped
jackett: jackett:
@ -100,8 +100,8 @@ services:
- TZ=Europe/London - TZ=Europe/London
- AUTO_UPDATE=true - AUTO_UPDATE=true
volumes: volumes:
- "jackett_config:/config" - jackett_config:/config
- "/mnt/ssd0/downloads:/downloads" - {{ qnap.downloads_dir }}:/downloads
restart: unless-stopped restart: unless-stopped
volumes: volumes:

Loading…
Cancel
Save