style: make ansible-lint happier

This commit is contained in:
VC
2024-07-05 11:53:33 +02:00
parent 332dc0f60a
commit 2728bc28cd
27 changed files with 125 additions and 87 deletions

View File

@@ -1,6 +1,7 @@
--- ---
- hosts: transmission - name: Transmission
hosts: transmission
diff: true diff: true
roles: roles:
- bittorrent - bittorrent

View File

@@ -1,14 +1,17 @@
--- ---
- hosts: borgbackup - name: Borgbackup
hosts: borgbackup
diff: true diff: true
roles: roles:
- borgbackup - borgbackup
- hosts: borg_client - name: Borg clients
hosts: borg_client
diff: true diff: true
roles: roles:
- borg_client - borg_client
- hosts: borg_server - name: Borg server
hosts: borg_server
diff: true diff: true
roles: roles:
- borg_server - borg_server

View File

@@ -1,6 +1,7 @@
--- ---
- hosts: dockerservers - name: Docker
hosts: dockerservers
diff: true diff: true
roles: roles:
- docker - docker

View File

@@ -1,11 +1,14 @@
--- ---
- hosts: all:!baybay-ponay.mateu.be:!machinbox.mateu.be:!muse-HP-EliteBook-820-G2.home.arpa - name: Retrieve network info
hosts: all:!baybay-ponay.mateu.be:!machinbox.mateu.be:!muse-HP-EliteBook-820-G2.home.arpa
gather_facts: true gather_facts: true
gather_subset: gather_subset:
- network - network
tasks: [] tasks: []
- hosts: router
- name: Router
hosts: router
diff: true diff: true
roles: roles:
- firewall - firewall

View File

@@ -1,6 +1,7 @@
--- ---
- hosts: ftpservers - name: FTP
hosts: ftpservers
diff: true diff: true
roles: roles:
- ftp - ftp

View File

@@ -1,6 +1,7 @@
--- ---
- hosts: garageservers - name: Garage
hosts: garageservers
diff: true diff: true
roles: roles:
- garage - garage

View File

@@ -1,6 +1,7 @@
--- ---
- hosts: icecastservers - name: Icecast
hosts: icecastservers
diff: true diff: true
roles: roles:
- icecast2 - icecast2

View File

@@ -1,6 +1,7 @@
--- ---
- hosts: loadbalancers - name: Load balancers
hosts: loadbalancers
diff: true diff: true
roles: roles:
- haproxy - haproxy

View File

@@ -1,6 +1,7 @@
--- ---
- hosts: mailservers - name: Mail
hosts: mailservers
diff: true diff: true
roles: roles:
- postfix - postfix

View File

@@ -1,6 +1,7 @@
--- ---
- hosts: mariadbservers - name: MariaDB
hosts: mariadbservers
diff: true diff: true
roles: roles:
- mariadb - mariadb

View File

@@ -1,6 +1,7 @@
--- ---
- hosts: mastodonservers - name: Mastodon
hosts: mastodonservers
diff: true diff: true
roles: roles:
- mastodon - mastodon

View File

@@ -1,6 +1,7 @@
--- ---
- hosts: mumbleservers - name: Mumble
hosts: mumbleservers
diff: true diff: true
roles: roles:
- mumble - mumble

View File

@@ -1,11 +1,13 @@
--- ---
- hosts: all:!disabled_munin - name: Munin clients
hosts: all:!disabled_munin
diff: true diff: true
roles: roles:
- munin_client - munin_client
- hosts: muninservers - name: Munin servers
hosts: muninservers
diff: true diff: true
roles: roles:
- munin_server - munin_server

View File

@@ -1,10 +1,12 @@
--- ---
- hosts: nut_server - name: NUT server
hosts: nut_server
diff: true diff: true
roles: roles:
- nut_server - nut_server
- hosts: nut_client - name: NUT clients
hosts: nut_client
diff: true diff: true
roles: roles:
- nut_client - nut_client

View File

@@ -1,6 +1,7 @@
--- ---
- hosts: pgsqlservers - name: PostgreSQL
hosts: pgsqlservers
diff: true diff: true
roles: roles:
- postgres - postgres

View File

@@ -1,6 +1,7 @@
--- ---
- hosts: phpservers - name: PHP
hosts: phpservers
diff: true diff: true
roles: roles:
- php - php

View File

@@ -1,6 +1,7 @@
--- ---
- hosts: resticservers - name: Restic
hosts: resticservers
diff: true diff: true
roles: roles:
- restic - restic

View File

@@ -1,14 +1,16 @@
--- ---
- name: reload transmission - name: Reload transmission
service: ansible.builtin.service:
name: transmission-daemon name: transmission-daemon
state: reloaded state: reloaded
- name: restart sonarr - name: Restart sonarr
service: ansible.builtin.service:
name: sonarr name: sonarr
state: restarted state: restarted
- name: export nfs - name: Export nfs
command: exportfs -a ansible.builtin.command:
cmd: exportfs -a
changed_when: true

View File

@@ -1,14 +1,14 @@
--- ---
- name: create Series folder - name: Create Series folder
file: ansible.builtin.file:
path: /var/lib/transmission-daemon/downloads/Series path: /var/lib/transmission-daemon/downloads/Series
recurse: true recurse: true
owner: debian-transmission owner: debian-transmission
group: debian-transmission group: debian-transmission
- name: create Movies folder - name: Create Movies folder
file: ansible.builtin.file:
path: /var/lib/transmission-daemon/downloads/Movies path: /var/lib/transmission-daemon/downloads/Movies
recurse: true recurse: true
owner: debian-transmission owner: debian-transmission

View File

@@ -1,7 +1,12 @@
--- ---
- include_tasks: transmission.yml - name: Include transmission
- include_tasks: sonarr.yml ansible.builtin.include_tasks: transmission.yml
- include_tasks: subliminal.yml - name: Include sonarr
- include_tasks: configdir.yml ansible.builtin.include_tasks: sonarr.yml
- include_tasks: nfsserver.yml - name: Include subliminal
ansible.builtin.include_tasks: subliminal.yml
- name: Include configdir
ansible.builtin.include_tasks: configdir.yml
- name: Include nfsserver
ansible.builtin.include_tasks: nfsserver.yml

View File

@@ -1,17 +1,19 @@
--- ---
- getent: - name: Get debian-transmission id
ansible.builtin.getent:
database: passwd database: passwd
key: debian-transmission key: debian-transmission
- name: install nfs server - name: Install nfs server
package: ansible.builtin.package:
name: nfs-kernel-server name: nfs-kernel-server
state: present state: present
- name: copy exports file - name: Copy exports file
template: ansible.builtin.template:
src: exports.j2 src: exports.j2
dest: /etc/exports dest: /etc/exports
mode: 0644
notify: notify:
- export nfs - Export nfs

View File

@@ -1,29 +1,29 @@
--- ---
- name: install sonarr repokey - name: Install sonarr repokey
apt_key: ansible.builtin.apt_key:
keyserver: keyserver.ubuntu.com keyserver: keyserver.ubuntu.com
id: "0xa236c58f409091a18aca53cbebff6b99d9b78493" id: "0xa236c58f409091a18aca53cbebff6b99d9b78493"
- name: install sonarr repo - name: Install sonarr repo
apt_repository: ansible.builtin.apt_repository:
repo: deb http://apt.sonarr.tv/debian buster-develop main repo: deb http://apt.sonarr.tv/debian buster-develop main
state: present state: present
- name: create sonarr conf dir - name: Create sonarr conf dir
file: ansible.builtin.file:
path: /var/lib/transmission-daemon/.config/NzbDrone path: /var/lib/transmission-daemon/.config/NzbDrone
recurse: true recurse: true
owner: debian-transmission owner: debian-transmission
group: debian-transmission group: debian-transmission
mode: "a-rwx,u+rwX,g+rX" mode: "a-rwx,u+rwX,g+rX"
- name: install sonarr - name: Install sonarr
package: ansible.builtin.package:
name: sonarr name: sonarr
state: present state: present
- name: enable sonarr service - name: Enable sonarr service
service: ansible.builtin.service:
name: sonarr name: sonarr
enabled: true enabled: true

View File

@@ -1,17 +1,17 @@
--- ---
- name: install pip3 - name: Install pip3
package: ansible.builtin.package:
name: python3-pip name: python3-pip
state: present state: present
- name: install subliminal - name: Install subliminal
pip: ansible.builtin.pip:
name: subliminal name: subliminal
state: present state: present
- name: install subliminal crontab - name: Install subliminal crontab
cron: ansible.builtin.cron:
name: "Sub DL" name: "Sub DL"
user: "debian-transmission" user: "debian-transmission"
minute: "15" minute: "15"

View File

@@ -1,25 +1,25 @@
--- ---
- name: install transmission - name: Install transmission
package: ansible.builtin.package:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
loop: loop:
- transmission-daemon - transmission-daemon
- transmission-cli - transmission-cli
- name: transmission config file - name: Transmission config file
template: ansible.builtin.template:
src: settings.json.j2 src: settings.json.j2
dest: /etc/transmission-daemon/settings.json dest: /etc/transmission-daemon/settings.json
owner: debian-transmission owner: debian-transmission
group: debian-transmission group: debian-transmission
mode: "a-rwx,u+rw" mode: "a-rwx,u+rw"
notify: notify:
- reload transmission - Reload transmission
- name: Add cachedir file - name: Add cachedir file
copy: ansible.builtin.copy:
src: files/CACHEDIR.TAG src: files/CACHEDIR.TAG
dest: /var/lib/transmission-daemon/downloads/CACHEDIR.TAG dest: /var/lib/transmission-daemon/downloads/CACHEDIR.TAG
owner: debian-transmission owner: debian-transmission

View File

@@ -1,28 +1,30 @@
--- ---
- name: create SSH key - name: Create SSH key
openssh_keypair: community.crypto.openssh_keypair:
path: ~/.ssh/id_rsa path: ~/.ssh/id_rsa
- name: get SSH pub key - name: Get SSH pub key
command: cat ~/.ssh/id_rsa.pub ansible.builtin.command:
cmd: cat ~/.ssh/id_rsa.pub
changed_when: true
register: ssh_keys register: ssh_keys
- name: put backup script - name: Put backup script
template: ansible.builtin.template:
src: borgbackup.sh.j2 src: borgbackup.sh.j2
dest: /usr/local/bin/borgbackup.sh dest: /usr/local/bin/borgbackup.sh
owner: root owner: root
group: root group: root
mode: '0750' mode: '0750'
- name: cron the backup script - name: Cron the backup script
cron: ansible.builtin.cron:
name: "borg backup script" name: "borg backup script"
hour: "{{ borg_backup_hour }}" hour: "{{ borg_backup_hour }}"
minute: "{{ borg_backup_minute }}" minute: "{{ borg_backup_minute }}"
job: /usr/local/bin/borgbackup.sh job: /usr/local/bin/borgbackup.sh
- name: warns about borg init - name: Warns about borg init
debug: ansible.builtin.debug:
msg: "Borg has been installed. Dont forget to init with: \nborg init --encryption=repokey-blake2 backup@{{ hostvars[groups['borg_server'][0]]['ansible_fqdn'] }}:home" msg: "Borg has been installed. Dont forget to init with: \nborg init --encryption=repokey-blake2 backup@{{ hostvars[groups['borg_server'][0]]['ansible_fqdn'] }}:home"

View File

@@ -1,15 +1,15 @@
--- ---
- name: mount backup disk - name: Mount backup disk
mount: ansible.posix.mount:
path: /backup path: /backup
src: LABEL=BACKUP src: LABEL=BACKUP
fstype: ext4 fstype: ext4
opts: noatime,nofail opts: noatime,nofail
state: mounted state: mounted
- name: create backup user - name: Create backup user
user: ansible.builtin.user:
name: backup name: backup
comment: Backup comment: Backup
create_home: true create_home: true
@@ -18,8 +18,8 @@
system: true system: true
state: present state: present
- name: "create directory for borg clients" - name: Create directory for borg clients
file: ansible.builtin.file:
path: "/backup/repos/{{ hostvars[item]['ansible_fqdn'] }}" path: "/backup/repos/{{ hostvars[item]['ansible_fqdn'] }}"
state: directory state: directory
mode: '0750' mode: '0750'
@@ -27,8 +27,8 @@
group: backup group: backup
loop: "{{ groups['borg_client'] }}" loop: "{{ groups['borg_client'] }}"
- name: "set authorized_keys for borg clients" - name: Set authorized_keys for borg clients
authorized_key: ansible.posix.authorized_key:
user: backup user: backup
key: "{{ hostvars[item]['ssh_keys']['stdout'] }}" key: "{{ hostvars[item]['ssh_keys']['stdout'] }}"
key_options: "command=\"cd /backup/repos/{{ hostvars[item]['ansible_fqdn'] }}; borg serve --restrict-to-path /backup/repos/{{ hostvars[item]['ansible_fqdn'] }}\"" key_options: "command=\"cd /backup/repos/{{ hostvars[item]['ansible_fqdn'] }}; borg serve --restrict-to-path /backup/repos/{{ hostvars[item]['ansible_fqdn'] }}\""

View File

@@ -1,12 +1,16 @@
--- ---
- set_fact: - name: Set borg fact
ansible.builtin.set_fact:
borgbackup: borg borgbackup: borg
when: ansible_facts['distribution'] == "Archlinux" when: ansible_facts['distribution'] == "Archlinux"
- set_fact:
- name: Set borgbackup fact
ansible.builtin.set_fact:
borgbackup: borgbackup borgbackup: borgbackup
when: ansible_facts['distribution'] == "Debian" when: ansible_facts['distribution'] == "Debian"
- name: install borg package
package: - name: Install borg package
ansible.builtin.package:
name: "{{ borgbackup }}" name: "{{ borgbackup }}"
state: present state: present