Remove unneeded quotes

This commit is contained in:
Sam A. 2023-01-03 22:30:22 +01:00
parent a5ccee9f10
commit dea8f23d38
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
17 changed files with 55 additions and 55 deletions

View file

@ -6,7 +6,7 @@ hostname: pi
timezone: Europe/Copenhagen timezone: Europe/Copenhagen
hdd_name: storage hdd_name: storage
hdd_mount_point: "/opt/{{ hdd_name }}" hdd_mount_point: /opt/{{ hdd_name }}
ssd_name: pi-ssd ssd_name: pi-ssd
ssd_mount_point: "/opt/{{ ssd_name }}" ssd_mount_point: /opt/{{ ssd_name }}

View file

@ -4,13 +4,13 @@
hosts: all hosts: all
gather_facts: true gather_facts: true
become: true become: true
tasks: tasks:
- name: Run OS configuration role - name: Run OS configuration role
import_role: import_role:
name: os_config name: os_config
tags: tags:
- os - os
- name: Run Docker role - name: Run Docker role
import_role: import_role:
name: docker name: docker

View file

@ -13,26 +13,26 @@ services:
restic: restic:
repo: /restic repo: /restic
version: 1.6 version: '1.6'
nextcloud: nextcloud:
domain: "cloud.{{ base_domain }}" domain: cloud.{{ base_domain }}
volume: "{{ base_volume }}/nextcloud" volume: "{{ base_volume }}/nextcloud"
version: 25-apache version: 25-apache
postgres_version: 14-alpine postgres_version: 14-alpine
redis_version: 7-alpine redis_version: 7-alpine
emby: emby:
domain: "watch.{{ base_domain }}" domain: watch.{{ base_domain }}
volume: "{{ base_volume }}/emby" volume: "{{ base_volume }}/emby"
version: latest version: latest
monerod: monerod:
domain: "xmr.{{ base_domain }}" domain: xmr.{{ base_domain }}
version: latest version: latest
wireguard: wireguard:
domain: "wg01.vpn.{{ base_domain }}" domain: wg01.vpn.{{ base_domain }}
volume: "{{ base_volume }}/wireguard" volume: "{{ base_volume }}/wireguard"
version: arm64v8-alpine version: arm64v8-alpine

View file

@ -2,7 +2,7 @@
--- ---
- name: Add Docker PGP key - name: Add Docker PGP key
apt_key: apt_key:
keyserver: keys.openpgp.org keyserver: keyserver.ubuntu.com
id: '0x8D81803C0EBFCD88' id: '0x8D81803C0EBFCD88'
state: present state: present

View file

@ -33,11 +33,11 @@
state: present state: present
- name: Deploy services - name: Deploy services
include_tasks: "services/{{ item.service }}.yml" include_tasks: services/{{ item.key }}.yml
loop: "{{ services | dict2items(key_name='service') }}" loop: "{{ services | dict2items }}"
when: single_service is not defined when: single_service is not defined
- name: Deploy single service - name: Deploy single service
include_tasks: "services/{{ single_service }}.yml" include_tasks: services/{{ single_service }}.yml
when: single_service is defined and when: single_service is defined and
single_service in services single_service in services

View file

@ -22,14 +22,14 @@
- name: Deploy Caddy Docker container - name: Deploy Caddy Docker container
docker_container: docker_container:
name: caddy name: caddy
image: "caddy:{{ services.caddy.version }}" image: caddy:{{ services.caddy.version }}
restart_policy: unless-stopped restart_policy: unless-stopped
networks: networks:
- name: services - name: services
ipv4_address: 172.16.0.2 ipv4_address: 172.16.0.2
published_ports: published_ports:
- '80:80/tcp' - 80:80/tcp
- '443:443/tcp' - 443:443/tcp
volumes: volumes:
- "{{ services.caddy.volume }}/Caddyfile:/etc/caddy/Caddyfile:ro" - "{{ services.caddy.volume }}/Caddyfile:/etc/caddy/Caddyfile:ro"
- "{{ services.caddy.volume }}/config:/config:rw" - "{{ services.caddy.volume }}/config:/config:rw"

View file

@ -16,7 +16,7 @@
- name: Deploy Emby Docker container - name: Deploy Emby Docker container
docker_container: docker_container:
name: emby_app name: emby_app
image: "emby/embyserver_arm64v8:{{ services.emby.version }}" image: emby/embyserver_arm64v8:{{ services.emby.version }}
restart_policy: unless-stopped restart_policy: unless-stopped
env: env:
UID: '1000' UID: '1000'
@ -30,6 +30,6 @@
- "{{ services.emby.volume }}/tvshows:/mnt/share1:rw" - "{{ services.emby.volume }}/tvshows:/mnt/share1:rw"
- "{{ services.emby.volume }}/movies:/mnt/share2:rw" - "{{ services.emby.volume }}/movies:/mnt/share2:rw"
published_ports: published_ports:
- '8096:8096' - 0.0.0.0:8096:8096/tcp
devices: devices:
- /dev/vchiq:/dev/vchiq # MMAL/OMX on Raspberry Pi - /dev/vchiq:/dev/vchiq # MMAL/OMX on Raspberry Pi

View file

@ -8,7 +8,7 @@
- name: Deploy Monero node Docker container - name: Deploy Monero node Docker container
docker_container: docker_container:
name: monerod_node name: monerod_node
image: "sethsimmons/simple-monerod:{{ services.monerod.version }}" image: sethsimmons/simple-monerod:{{ services.monerod.version }}
restart_policy: unless-stopped restart_policy: unless-stopped
networks: networks:
- name: services - name: services
@ -17,4 +17,4 @@
volumes: volumes:
- monerod-node-blockchain:/home/monero/.bitmonero:rw - monerod-node-blockchain:/home/monero/.bitmonero:rw
published_ports: published_ports:
- '18080:18080' - 18080:18080/tcp

View file

@ -17,7 +17,7 @@
- name: Copy Apache2 config files - name: Copy Apache2 config files
copy: copy:
src: "nextcloud/apache2/{{ file }}" src: nextcloud/apache2/{{ file }}
dest: "{{ services.nextcloud.volume }}/apache2/{{ file }}" dest: "{{ services.nextcloud.volume }}/apache2/{{ file }}"
owner: root owner: root
mode: u=rw,g=r,o=r mode: u=rw,g=r,o=r
@ -36,7 +36,7 @@
services: services:
postgres: postgres:
image: "postgres:{{ services.nextcloud.postgres_version }}" image: postgres:{{ services.nextcloud.postgres_version }}
restart: unless-stopped restart: unless-stopped
environment: environment:
POSTGRES_DB: nextcloud POSTGRES_DB: nextcloud
@ -46,14 +46,14 @@
- "{{ services.nextcloud.volume }}/postgres:/var/lib/postgresql/data:rw" - "{{ services.nextcloud.volume }}/postgres:/var/lib/postgresql/data:rw"
redis: redis:
image: "redis:{{ services.nextcloud.redis_version }}" image: redis:{{ services.nextcloud.redis_version }}
restart: unless-stopped restart: unless-stopped
command: "redis-server --requirepass {{ secrets.nextcloud.redis_pw }}" command: redis-server --requirepass {{ secrets.nextcloud.redis_pw }}
tmpfs: tmpfs:
- /var/lib/redis - /var/lib/redis
cron: cron:
image: "nextcloud:{{ services.nextcloud.version }}" image: nextcloud:{{ services.nextcloud.version }}
restart: unless-stopped restart: unless-stopped
entrypoint: /cron.sh entrypoint: /cron.sh
volumes: volumes:
@ -63,7 +63,7 @@
- redis - redis
app: app:
image: "nextcloud:{{ services.nextcloud.version }}" image: nextcloud:{{ services.nextcloud.version }}
restart: unless-stopped restart: unless-stopped
environment: environment:
POSTGRES_HOST: postgres POSTGRES_HOST: postgres

View file

@ -9,12 +9,12 @@
services: services:
backup: backup:
image: "mazzolino/restic:{{ services.restic.version }}" image: mazzolino/restic:{{ services.restic.version }}
restart: unless-stopped restart: unless-stopped
environment: environment:
RUN_ON_STARTUP: 'false' RUN_ON_STARTUP: 'false'
BACKUP_CRON: '0 0 3 * * *' BACKUP_CRON: 0 0 3 * * *
RESTIC_REPOSITORY: "b2:{{ secrets.restic.b2.bucket }}:{{ services.restic.repo }}" RESTIC_REPOSITORY: b2:{{ secrets.restic.b2.bucket }}:{{ services.restic.repo }}
RESTIC_PASSWORD: "{{ secrets.restic.repo_pw }}" RESTIC_PASSWORD: "{{ secrets.restic.repo_pw }}"
RESTIC_BACKUP_SOURCES: /mnt/volumes RESTIC_BACKUP_SOURCES: /mnt/volumes
RESTIC_BACKUP_ARGS: >- RESTIC_BACKUP_ARGS: >-
@ -35,12 +35,12 @@
- "{{ services.emby.volume }}/programdata:/mnt/volumes/emby/programdata:ro" - "{{ services.emby.volume }}/programdata:/mnt/volumes/emby/programdata:ro"
prune: prune:
image: "mazzolino/restic:{{ services.restic.version }}" image: mazzolino/restic:{{ services.restic.version }}
restart: unless-stopped restart: unless-stopped
environment: environment:
RUN_ON_STARTUP: 'false' RUN_ON_STARTUP: 'false'
PRUNE_CRON: '0 0 4 * * *' PRUNE_CRON: 0 0 4 * * *
RESTIC_REPOSITORY: "b2:{{ secrets.restic.b2.bucket }}:{{ services.restic.repo }}" RESTIC_REPOSITORY: b2:{{ secrets.restic.b2.bucket }}:{{ services.restic.repo }}
RESTIC_PASSWORD: "{{ secrets.restic.repo_pw }}" RESTIC_PASSWORD: "{{ secrets.restic.repo_pw }}"
RESTIC_PRUNE_ARGS: >- RESTIC_PRUNE_ARGS: >-
--verbose --verbose
@ -49,12 +49,12 @@
TZ: "{{ timezone }}" TZ: "{{ timezone }}"
check: check:
image: "mazzolino/restic:{{ services.restic.version }}" image: mazzolino/restic:{{ services.restic.version }}
restart: unless-stopped restart: unless-stopped
environment: environment:
RUN_ON_STARTUP: 'false' RUN_ON_STARTUP: 'false'
CHECK_CRON: '0 0 5 * * *' CHECK_CRON: 0 0 5 * * *
RESTIC_REPOSITORY: "b2:{{ secrets.restic.b2.bucket }}:{{ services.restic.repo }}" RESTIC_REPOSITORY: b2:{{ secrets.restic.b2.bucket }}:{{ services.restic.repo }}
RESTIC_PASSWORD: "{{ secrets.restic.repo_pw }}" RESTIC_PASSWORD: "{{ secrets.restic.repo_pw }}"
RESTIC_CHECK_ARGS: >- RESTIC_CHECK_ARGS: >-
--verbose --verbose

View file

@ -3,6 +3,6 @@
- name: Deploy snowflake-proxy Docker container - name: Deploy snowflake-proxy Docker container
docker_container: docker_container:
name: snowflake-proxy name: snowflake-proxy
image: "thetorproject/snowflake-proxy:{{ services.snowflake.version }}" image: thetorproject/snowflake-proxy:{{ services.snowflake.version }}
restart_policy: unless-stopped restart_policy: unless-stopped
network_mode: host network_mode: host

View file

@ -3,7 +3,7 @@
- name: Deploy Watchtower Docker container - name: Deploy Watchtower Docker container
docker_container: docker_container:
name: watchtower name: watchtower
image: "containrrr/watchtower:{{ services.watchtower.version }}" image: containrrr/watchtower:{{ services.watchtower.version }}
restart_policy: unless-stopped restart_policy: unless-stopped
env: env:
WATCHTOWER_POLL_INTERVAL: '3600' WATCHTOWER_POLL_INTERVAL: '3600'

View file

@ -10,7 +10,7 @@
- name: Deploy Wireguard Docker container - name: Deploy Wireguard Docker container
docker_container: docker_container:
name: wireguard name: wireguard
image: "linuxserver/wireguard:{{ services.wireguard.version }}" image: linuxserver/wireguard:{{ services.wireguard.version }}
restart_policy: unless-stopped restart_policy: unless-stopped
env: env:
SERVERURL: "{{ services.wireguard.domain }}" SERVERURL: "{{ services.wireguard.domain }}"
@ -22,7 +22,7 @@
- "{{ services.wireguard.volume }}:/config:rw" - "{{ services.wireguard.volume }}:/config:rw"
- /lib/modules:/lib/modules:rw - /lib/modules:/lib/modules:rw
published_ports: published_ports:
- '51820:51820/udp' - 51820:51820/udp
capabilities: capabilities:
- net_admin - net_admin
- sys_module - sys_module

View file

@ -3,30 +3,30 @@
- name: Create .env for apt-update-push - name: Create .env for apt-update-push
template: template:
src: env.j2 src: env.j2
dest: "/home/{{ ansible_user }}/apt-update-push/.env" dest: /home/{{ ansible_user }}/apt-update-push/.env
owner: root owner: root
mode: u=rw,go= mode: u=rw,go=
listen: apt-update-push listen: apt-update-push
- name: Install apt-update-push - name: Install apt-update-push
command: "/home/{{ ansible_user }}/apt-update-push/install.sh" command: /home/{{ ansible_user }}/apt-update-push/install.sh
listen: apt-update-push listen: apt-update-push
- name: Change GPIO_PIN - name: Change GPIO_PIN
lineinfile: lineinfile:
regexp: '^GPIO_PIN = ' regexp: '^GPIO_PIN = '
line: GPIO_PIN = 14 line: GPIO_PIN = 14
dest: "/home/{{ ansible_user }}/pi-fan-controller/fancontrol.py" dest: /home/{{ ansible_user }}/pi-fan-controller/fancontrol.py
listen: pi-fan-controller listen: pi-fan-controller
- name: Install requirements for pi-fan-controller - name: Install requirements for pi-fan-controller
pip: pip:
requirements: "/home/{{ ansible_user }}/pi-fan-controller/requirements.txt" requirements: /home/{{ ansible_user }}/pi-fan-controller/requirements.txt
executable: pip3 executable: pip3
listen: pi-fan-controller listen: pi-fan-controller
- name: Install pi-fan-controller - name: Install pi-fan-controller
command: "/home/{{ ansible_user }}/pi-fan-controller/script/install" command: /home/{{ ansible_user }}/pi-fan-controller/script/install
listen: pi-fan-controller listen: pi-fan-controller
- name: Restart sshd - name: Restart sshd

View file

@ -30,7 +30,7 @@
- name: Clone apt-update-push - name: Clone apt-update-push
git: git:
dest: "/home/{{ ansible_user }}/apt-update-push" dest: /home/{{ ansible_user }}/apt-update-push
repo: https://github.com/samsapti/apt-update-push.git repo: https://github.com/samsapti/apt-update-push.git
clone: true clone: true
update: true update: true
@ -41,7 +41,7 @@
- name: Clone pi-fan-controller - name: Clone pi-fan-controller
git: git:
dest: "/home/{{ ansible_user }}/pi-fan-controller" dest: /home/{{ ansible_user }}/pi-fan-controller
repo: https://github.com/Howchoo/pi-fan-controller.git repo: https://github.com/Howchoo/pi-fan-controller.git
clone: true clone: true
update: false update: false

View file

@ -19,8 +19,8 @@
fstype: ext4 fstype: ext4
state: present state: present
loop: loop:
- "/dev/mapper/{{ hdd_name }}" - /dev/mapper/{{ hdd_name }}
- "/dev/mapper/{{ ssd_name }}" - /dev/mapper/{{ ssd_name }}
when: ansible_mounts | selectattr('device', 'eq', item) | length == 0 when: ansible_mounts | selectattr('device', 'eq', item) | length == 0
- name: Mount filesystems - name: Mount filesystems
@ -31,9 +31,9 @@
fstab: /tmp/fstab.ansible fstab: /tmp/fstab.ansible
state: mounted state: mounted
loop: loop:
- dev: "/dev/mapper/{{ hdd_name }}" - dev: /dev/mapper/{{ hdd_name }}
path: "{{ hdd_mount_point }}" path: "{{ hdd_mount_point }}"
- dev: "/dev/mapper/{{ ssd_name }}" - dev: /dev/mapper/{{ ssd_name }}
path: "{{ ssd_mount_point }}" path: "{{ ssd_mount_point }}"
when: ansible_mounts | selectattr('device', 'eq', item.dev) | length == 0 when: ansible_mounts | selectattr('device', 'eq', item.dev) | length == 0

View file

@ -6,12 +6,12 @@
port: "{{ item.port }}" port: "{{ item.port }}"
proto: "{{ item.proto | default('tcp') }}" proto: "{{ item.proto | default('tcp') }}"
loop: loop:
- port: 22 # SSH - port: '22' # SSH
- port: 80 # HTTP - port: '80' # HTTP
- port: 443 # HTTPS - port: '443' # HTTPS
- port: 18080 # monerod P2P - port: '18080' # monerod P2P
- port: 18089 # monerod RPC - port: '18089' # monerod RPC
- port: 51820 # Wireguard - port: '51820' # Wireguard
proto: udp proto: udp
- name: Enable UFW - name: Enable UFW