Fix stuff

This commit is contained in:
Sam A. 2022-12-23 16:57:37 +01:00
parent 5087174b78
commit a285034ca5
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
5 changed files with 20 additions and 10 deletions

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: keys.openpgp.org
id: 0x8D81803C0EBFCD88 id: '0x8D81803C0EBFCD88'
state: present state: present
- name: Add Docker apt repository - name: Add Docker apt repository
@ -22,8 +22,8 @@
- name: Create docker-compose symlink - name: Create docker-compose symlink
file: file:
src: /usr/libexec/docker/cli-plugins/docker-compose
name: /usr/local/bin/docker-compose name: /usr/local/bin/docker-compose
src: /usr/libexec/docker/cli-plugins/docker-compose
state: link state: link
- name: Install Python bindings for Docker - name: Install Python bindings for Docker

View file

@ -12,7 +12,7 @@
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 30 3 * * *' BACKUP_CRON: '0 30 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 }}"
@ -38,7 +38,7 @@
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 }}"
@ -52,7 +52,7 @@
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 30 4 * * *' CHECK_CRON: '0 30 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 }}"

View file

@ -6,6 +6,6 @@
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'
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock:rw - /var/run/docker.sock:/var/run/docker.sock:rw

View file

@ -27,21 +27,30 @@
src: "/dev/disk/by-uuid/{{ item.uuid }}" src: "/dev/disk/by-uuid/{{ item.uuid }}"
path: "{{ item.path }}" path: "{{ item.path }}"
fstype: ext4 fstype: ext4
state: ephemeral fstab: /dev/null
state: present
loop: loop:
- uuid: "{{ secrets.hdd.uuid }}" - uuid: "{{ secrets.hdd.uuid }}"
path: "{{ hdd_mount_point }}" path: "{{ hdd_mount_point }}"
- uuid: "{{ secrets.ssd.uuid }}" - uuid: "{{ secrets.ssd.uuid }}"
path: "{{ ssd_mount_point }}" path: "{{ ssd_mount_point }}"
- name: Check if swapfile is mounted
shell: "swapon | grep -q '{{ ssd_mount_point }}/swapfile'"
ignore_errors: true
register: swap_mounted
- name: Create swapfile - name: Create swapfile
community.general.filesize: community.general.filesize:
path: "{{ ssd_mount_point }}/swapfile" path: "{{ ssd_mount_point }}/swapfile"
size: 8G size: 2G
blocksize: 512B
owner: root owner: root
mode: 0600 mode: u=rw,go=
when: swap_mounted is undefined
- name: Mount swapfile - name: Mount swapfile
shell: | shell: |
mkswap {{ ssd_mount_point }}/swapfile mkswap {{ ssd_mount_point }}/swapfile
swapon {{ ssd_mount_point }}/swapfile swapon {{ ssd_mount_point }}/swapfile
when: swap_mounted is undefined

View file

@ -11,7 +11,8 @@
state: present state: present
vars: vars:
pkgs: pkgs:
- python3-pip
- apparmor - apparmor
- haveged - haveged
- needrestart
- python3-pip
- ufw - ufw