FQCN eingeführt (#70)

* template --> ansible.builtin.template

* apt --> ansible.builtin.apt

* lineinfile --> ansible.builtin.lineinfile

* file --> ansible.builtin.file

* blockinfile --> ansible.builtin.blockinfile

* cron --> ansible.builtin.cron

* timezone --> ansible.builtin.timezone

* get_url --> ansible.builtin.get_url

* group --> ansible.builtin.group

* user --> ansible.builtin.user

* unarchive --> ansible.builtin.unarchive

* service --> ansible.builtin.service

* apache2_module --> ansible.builtin.apache2_module

* package --> ansible.builtin.apt

* template --> ansible.builtin.template 2
This commit is contained in:
Quotengrote 2020-11-21 19:41:19 +01:00 committed by GitHub
parent aab871d86b
commit 15d783de86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 129 additions and 129 deletions

View file

@ -6,5 +6,5 @@
tasks:
- name: apt autoremove
become: yes
apt:
ansible.builtin.apt:
autoremove: yes

View file

@ -6,5 +6,5 @@
tasks:
- name: update apt cache
become: yes
apt:
ansible.builtin.apt:
update_cache: yes

View file

@ -3,6 +3,6 @@
tasks:
- name: cowsay deinstallieren
become: yes
apt:
ansible.builtin.apt:
name: cowsay
state: absent

View file

@ -3,7 +3,7 @@
tasks:
- name: telegraf deinstallieren
become: yes
apt:
ansible.builtin.apt:
name: telegraf
state: absent
- name: telegraf-repository entfernen

View file

@ -4,21 +4,21 @@
tasks:
- name: delete /home/mg/dotfiles-repo
become: yes
file:
ansible.builtin.file:
path: /home/mg/dotfiles-repo
state: absent
- name: delete /home/mg/.bash_aliases
become: yes
file:
ansible.builtin.file:
path: /home/mg/.bash_aliases
state: absent
- name: delete /home/mg/.tmux.conf
become: yes
file:
ansible.builtin.file:
path: /home/mg/.tmux.conf
state: absent
- name: delete /home/mg/.gitconfig
become: yes
file:
ansible.builtin.file:
path: /home/mg/.gitconfig
state: absent

View file

@ -5,7 +5,7 @@
tasks:
- name: remove Packages
become: yes
apt:
ansible.builtin.apt:
name:
- hddtemp
- ipmitool

View file

@ -4,7 +4,7 @@
tasks:
- name: Setze DNS-Resolver fuer pihole-*
lineinfile:
ansible.builtin.lineinfile:
path: /etc/resolv.conf.head
line: nameserver 192.168.2.2
create: yes

View file

@ -1,12 +1,12 @@
- name: apt-cacher-ng installieren
become: yes
apt:
ansible.builtin.apt:
name: apt-cacher-ng
state: present
- name: acng.conf kopieren
become: yes
template:
ansible.builtin.template:
src: "acng.conf"
dest: "/etc/apt-cacher-ng/acng.conf"
mode: 0664

View file

@ -2,13 +2,13 @@
# https://github.com/viczem/ansible-keepass#readme
- name: create ~/.ansible/plugins/lookup
become: yes
file:
ansible.builtin.file:
path: /home/mg/.ansible/plugins/lookup
state: directory
- name: Download keepass.py
become: yes
get_url:
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/viczem/ansible-keepass/master/keepass.py
dest: /home/mg/.ansible/plugins/lookup/keepass.py
backup: yes

View file

@ -1,5 +1,5 @@
- name: apcupsd installieren
apt:
ansible.builtin.apt:
name:
- apcupsd
- apcupsd-cgi
@ -10,13 +10,13 @@
- name: apcupsd kopieren
become: yes
template:
ansible.builtin.template:
src: "apcupsd"
dest: "/etc/default/apcupsd"
- name: empfaenger_mail_setzen
become: yes
lineinfile:
ansible.builtin.lineinfile:
path: /etc/apcupsd/apccontrol #wo
regexp: export SYSADMIN=root #suche nach
line: export SYSADMIN={{ empfaenger_mail }} #ersetze durch...
@ -24,7 +24,7 @@
- name: apcupsd.conf_kopieren
become: yes
template:
ansible.builtin.template:
src: "apcupsd.conf"
dest: "/etc/apcupsd/apcupsd.conf"
notify: restart_apcupsd #benachrchtigt handlers/main.yml-restart-apcupsd_restart um den dient neuzustarten, nur wenn hier status "changed" ausgeworfen wird"

View file

@ -1,6 +1,6 @@
- name: Erstelle Nutzer
become: yes
user:
ansible.builtin.user:
name: "{{ create_user_name }}"
groups: "{{ create_user_groups }}"
state: present
@ -14,7 +14,7 @@
- name: touch ".sudo_as_admin_successful"
become: yes
# when: sudo_as_admin_successful_existiert.stat.exists == False
file:
ansible.builtin.file:
path: /home/{{ create_user_name }}/.sudo_as_admin_successful
state: touch
access_time: preserve
@ -27,7 +27,7 @@
- name: create .selected_editor
become: yes
template:
ansible.builtin.template:
src: ".selected_editor"
dest: "/home/{{ create_user_name }}/.selected_editor"
# no_log: true
@ -35,7 +35,7 @@
# Validate the sudoers file before saving
- name: set sudo without password
become: yes
template:
ansible.builtin.template:
src: sudoers
dest: /etc/sudoers.d/{{ create_user_name }}
validate: /usr/sbin/visudo -cf %s

View file

@ -1,7 +1,7 @@
---
- name: create directories
become: yes
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
loop:
@ -10,14 +10,14 @@
- name: download archives
become: yes
get_url: ## hier variable für version
ansible.builtin.get_url: ## hier variable für version
url: https://github.com/Corsinvest/cv4pve-autosnap/releases/download/{{ cv4pve_version }}/cv4pve-autosnap-linux-x64.zip
dest: /tmp/cv4pve/cv4pve-autosnap-linux-x64.zip
mode: '0775'
- name: Extract archives
become: yes
unarchive:
ansible.builtin.unarchive:
src: /tmp/cv4pve/cv4pve-autosnap-linux-x64.zip
dest: /usr/local/bin/cv4pve
remote_src: yes
@ -25,14 +25,14 @@
- name: copy bash-script
become: yes
template:
ansible.builtin.template:
src: "cv4pve-script.sh"
dest: "/usr/local/bin/cv4pve/cv4pve-script.sh"
mode: a+x
- name: create cronjob
become: yes
cron:
ansible.builtin.cron:
name: cv4pve-autosnap
state: present
job: "/usr/local/bin/cv4pve/cv4pve-script.sh"
@ -41,7 +41,7 @@
- name: Create log
become: true
file:
ansible.builtin.file:
path: /var/log/cv4pve-autosnap.log
state: touch
owner: root
@ -52,7 +52,7 @@
- name: Add Log to be Rotated
become: true
blockinfile:
ansible.builtin.blockinfile:
path: /etc/logrotate.d/cv4pve-autosnap
state: present
create: yes

View file

@ -1,7 +1,7 @@
---
- name: prohibit ssh login with password
become: yes
lineinfile:
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: '#PasswordAuthentication yes'
line: 'PasswordAuthentication no'

View file

@ -1,6 +1,6 @@
- name: install packages
become: yes
apt:
ansible.builtin.apt:
name:
- php
- php-mbstring
@ -14,20 +14,20 @@
# aktiviert das module rewrite = a2enmod rewrite
- name: activate a2enmod rewrite
become: yes
apache2_module:
ansible.builtin.apache2_module:
state: present
name: rewrite
- name: Download latest dokuwiki
become: yes
get_url:
ansible.builtin.get_url:
url: https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
dest: /tmp/dokuwiki-stable.tgz
when: dokuwiki_update # noqa 601 # entspricht when: dokuwiki_update == true; noqa sorgt dafür dass das beispiel nicht "gemeldet" wird
- name: create dokuwiki install path
become: yes
file:
ansible.builtin.file:
path: "{{ dokuwiki_install_path }}"
state: directory
owner: www-data
@ -35,7 +35,7 @@
- name: Unarchive dokuwiki-stable.tgz to {{ dokuwiki_install_path }}
become: yes
unarchive:
ansible.builtin.unarchive:
src: /tmp/dokuwiki-stable.tgz
dest: "{{ dokuwiki_install_path }}"
owner: www-data
@ -46,7 +46,7 @@
- name: Remove default plugins
become: yes
file:
ansible.builtin.file:
path: '{{ dokuwiki_install_path }}/lib/plugins/{{ item }}'
state: absent
with_items:
@ -58,34 +58,34 @@
- name: Change file ownership, group and permissions
become: yes
file:
ansible.builtin.file:
path: "{{ dokuwiki_install_path }}"
owner: www-data
group: www-data
- name: copy apache2.conf
become: yes
template:
ansible.builtin.template:
src: "apache2.conf"
dest: "/etc/apache2/apache2.conf"
notify: restart_apache2
- name: copy 000-default.conf
become: yes
template:
ansible.builtin.template:
src: "000-default.conf"
dest: "/etc/apache2/sites-enabled/000-default.conf"
notify: restart_apache2
- name: remove tmp files
become: yes
file:
ansible.builtin.file:
path: /tmp/dokuwiki-stable.tgz
state: absent
- name: remove install.php
become: yes
file:
ansible.builtin.file:
path: '{{ dokuwiki_install_path }}/install.php'
state: absent
when: not dokuwiki_install # noqa 601 # entspricht when: dokuwiki_update == true; noqa sorgt dafür dass das beispiel nicht "gemeldet" wird # entspricht == false

View file

@ -1,6 +1,6 @@
- name: Install rasdaemon
become: true
package:
ansible.builtin.apt:
name:
- rasdaemon
- logrotate
@ -9,19 +9,19 @@
- name: Enable rasdaemon service
become: true
service:
ansible.builtin.service:
name: rasdaemon
enabled: true
- name: Start rasdaemon service
become: true
service:
ansible.builtin.service:
name: rasdaemon
state: started
- name: Create rasdaemon log
become: true
file:
ansible.builtin.file:
path: /var/log/rasdaemon.log
state: touch
access_time: preserve
@ -29,7 +29,7 @@
- name: Add rasdaemon Log to be Rotated
become: true
blockinfile:
ansible.builtin.blockinfile:
path: /etc/logrotate.d/rasdaemon
state: present
create: yes
@ -51,14 +51,14 @@
- name: rasdaemon-cron kopieren
become: yes
template:
ansible.builtin.template:
src: rasdaemon-cron.sh
dest: "/usr/local/bin/rasdaemon-cron.sh"
mode: a+x
- name: create cronjob
become: yes
cron:
ansible.builtin.cron:
name: rasdaemon-log
state: present
job: /usr/local/bin/rasdaemon-cron.sh

View file

@ -1,13 +1,13 @@
---
- name: install fail2ban-packages
become: yes
apt:
ansible.builtin.apt:
name: fail2ban
state: present
- name: copy jail.local
become: yes
template:
ansible.builtin.template:
src: jail.local
dest: /etc/fail2ban/jail.local
mode: 0750
@ -15,7 +15,7 @@
- name: copy sendmail-common.local
become: yes
template:
ansible.builtin.template:
src: sendmail-common.local
dest: /etc/fail2ban/action.d/sendmail-common.local
mode: 0750

View file

@ -1,6 +1,6 @@
- name: SAMBA installieren
become: yes
apt:
ansible.builtin.apt:
name:
- samba
- cifs-utils
@ -11,7 +11,7 @@
- name: Erstelle Linux-Gruppen # vat /etc/group #kommt aus vars im playbook
become: yes
group:
ansible.builtin.group:
name: "{{ item.groups }}"
state: present
loop: "{{ smb_nutzer }}"
@ -19,7 +19,7 @@
- name: Erstelle Linux-Nutzer #kommt aus vars im playbook
become: yes
user:
ansible.builtin.user:
name: "{{ item.name }}"
group: "{{ item.groups }}"
state: present
@ -30,14 +30,14 @@
- name: Loesche alte Linux-Nutzer #kommt aus vars im playbook
become: yes
user:
ansible.builtin.user:
name: "{{ item.name }}"
state: absent
loop: "{{ smb_nutzer_loeschen }}"
- name: Erstelle Freigabeordner
become: yes
file:
ansible.builtin.file:
path: "{{ item.ordnerpfad }}"
state: directory
mode: 0777
@ -45,7 +45,7 @@
- name: "Konfiguriere Freigaben"
become: yes
template:
ansible.builtin.template:
src: smb.conf.j2
dest: /etc/samba/smb.conf
validate: 'testparm -s %s'

View file

@ -1,32 +1,32 @@
- name: apt update
become: yes
apt:
ansible.builtin.apt:
update_cache: yes
cache_valid_time: 300
- name: install common-packages
become: yes
apt:
ansible.builtin.apt:
name: "{{ programs_common }}"
state: present
- name: install vm-packages
become: yes
apt:
ansible.builtin.apt:
name: "{{ programs_only_vms }}"
state: present
when: ansible_virtualization_role == 'guest'
- name: install physical-packages
become: yes
apt:
ansible.builtin.apt:
name: "{{ programs_only_physical }}"
state: present
when: ansible_virtualization_role != 'guest'
- name: copy hddtemps.sh
become: yes
template:
ansible.builtin.template:
src: "hddtemps.sh"
dest: "/usr/local/bin/hddtemps.sh"
mode: a+x
@ -34,7 +34,7 @@
- name: copy systemtemps.sh
become: yes
template:
ansible.builtin.template:
src: "systemtemps.sh"
dest: "/usr/local/bin/systemtemps.sh"
mode: a+x

View file

@ -1,6 +1,6 @@
- name: install fortune
become: yes
apt:
ansible.builtin.apt:
name:
- fortune
state: present
@ -8,7 +8,7 @@
- name: install packages
become: yes
apt:
ansible.builtin.apt:
name:
- update-motd
state: present
@ -16,7 +16,7 @@
##################
- name: 'Ubuntu : remove motd'
become: yes
file:
ansible.builtin.file:
path: '/etc/update-motd.d/{{ item }}'
state: absent
with_items:
@ -34,7 +34,7 @@
##################
- name: delete "Last Login" - Message
become: yes
lineinfile:
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: "#PrintLastLog yes"
line: "PrintLastLog no"
@ -43,7 +43,7 @@
- name: setup new motd
become: yes
template:
ansible.builtin.template:
src: '{{ item }}'
dest: '/etc/update-motd.d/{{ item }}'
owner: root
@ -58,7 +58,7 @@
- name: setup new motd - fortune
become: yes
template:
ansible.builtin.template:
src: '05-fortune-mgrote'
dest: '/etc/update-motd.d/05-fortune-mgrote'
owner: root
@ -69,14 +69,14 @@
- name: delete fortune
become: yes
file:
ansible.builtin.file:
path: /etc/update-motd.d/05-fortune-mgrote
state: absent
when: not motd_fortune_aktiv
- name: setup new motd - wetter
become: yes
template:
ansible.builtin.template:
src: '10-wetter-mgrote'
dest: '/etc/update-motd.d/10-wetter-mgrote'
owner: root
@ -87,7 +87,7 @@
- name: delete Wetter
become: yes
file:
ansible.builtin.file:
path: '/etc/update-motd.d/10-wetter-mgrote'
state: absent
when: not motd_wetter_aktiv

View file

@ -1,7 +1,7 @@
# für scripte
- name: create /etc/restic
become: yes
file:
ansible.builtin.file:
path: /etc/restic
state: directory
@ -11,19 +11,19 @@
- name: copy restic_backup.sh
become: yes
template:
ansible.builtin.template:
src: "restic_backup.sh"
dest: "/usr/local/bin/restic_backup.sh"
mode: a+x
- name: copy exclude.txt
become: yes
template:
ansible.builtin.template:
src: "exclude.txt"
dest: "/etc/restic/exclude.txt"
- name: Create restic log
become: true
file:
ansible.builtin.file:
path: /var/log/restic.log
state: touch
owner: root
@ -34,7 +34,7 @@
- name: Add restic Log to be Rotated
become: true
blockinfile:
ansible.builtin.blockinfile:
path: /etc/logrotate.d/restic
state: present
create: yes

View file

@ -2,7 +2,7 @@
- name: postfix + Hilfsprogramme installieren
become: yes
apt:
ansible.builtin.apt:
name:
- postfix
- mailutils
@ -11,7 +11,7 @@
- name: kopiere sasl_passwd
become: yes
template:
ansible.builtin.template:
src: sasl_passwd
dest: /etc/postfix/sasl_passwd
force: yes
@ -21,7 +21,7 @@
- name: kopiere postfix_main.cf
become: yes
template:
ansible.builtin.template:
src: main.cf
dest: /etc/postfix/main.cf
notify:
@ -31,7 +31,7 @@
- name: Mail Cronjob - Anlegen
become: yes
when: mail_nach_cronjob # ohne parameter wird auf true geprueft https://www.buildahomelab.com/2018/11/12/using-ansible-when-statements/
cron:
ansible.builtin.cron:
name: MAILTO
env: yes
job: "{{ empfaenger_mail }}"
@ -41,7 +41,7 @@
- name: Mail Cronjob - Entfernen
become: yes
when: not mail_nach_cronjob
cron:
ansible.builtin.cron:
name: MAILTO
env: yes
job: ""

View file

@ -1,6 +1,6 @@
- name: install restic-packages
become: yes
apt:
ansible.builtin.apt:
name:
- restic
- logrotate
@ -8,13 +8,13 @@
- name: create /etc/restic
become: yes
file:
ansible.builtin.file:
path: /etc/restic
state: directory
- name: create restic mount-directory
become: yes
file:
ansible.builtin.file:
path: "{{ restic_mount }}"
state: directory
owner: root
@ -23,7 +23,7 @@
- name: copy smb_password.txt
become: yes
template:
ansible.builtin.template:
src: "smb_password.txt"
dest: "/etc/restic/smb_password.txt"
owner: root
@ -32,20 +32,20 @@
- name: copy restic_backup.sh
become: yes
template:
ansible.builtin.template:
src: "restic_backup.sh"
dest: "/usr/local/bin/restic_backup.sh"
mode: a+x
- name: copy exclude.txt
become: yes
template:
ansible.builtin.template:
src: "exclude.txt"
dest: "/etc/restic/exclude.txt"
- name: copy password.txt
become: yes
template:
ansible.builtin.template:
src: "password.txt"
dest: "/etc/restic/password.txt"
owner: root
@ -54,7 +54,7 @@
- name: create restic cronjob
become: yes
cron:
ansible.builtin.cron:
name: restic
state: present
job: "/usr/local/bin/restic_backup.sh"
@ -64,7 +64,7 @@
- name: Create restic log
become: true
file:
ansible.builtin.file:
path: /var/log/restic.log
state: touch
owner: root
@ -75,7 +75,7 @@
- name: Add restic Log to be Rotated
become: true
blockinfile:
ansible.builtin.blockinfile:
path: /etc/logrotate.d/restic
state: present
create: yes

View file

@ -1,7 +1,7 @@
---
- name: Install Required Packages
become: true
apt:
ansible.builtin.apt:
name:
- ca-certificates
- apt-transport-https
@ -15,7 +15,7 @@
- name: Create Sanoid Directory
become: true
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: root
@ -27,7 +27,7 @@
- name: Install Sanoid Dependencies Packages
become: true
apt:
ansible.builtin.apt:
name:
- libconfig-inifiles-perl
force_apt_get: yes
@ -38,7 +38,7 @@
- name: Install Sanoid Binary
become: true
get_url:
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/jimsalterjrs/sanoid/master/sanoid
dest: /usr/local/bin/sanoid
owner: root
@ -47,7 +47,7 @@
- name: Install Sanoid Defaults Configuration
become: true
get_url:
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/jimsalterjrs/sanoid/master/sanoid.defaults.conf
dest: /etc/sanoid/sanoid.defaults.conf
owner: root
@ -56,7 +56,7 @@
- name: Generate Sanoid Configuration
become: true
template:
ansible.builtin.template:
src: sanoid.conf.j2
dest: /etc/sanoid/sanoid.conf
owner: root
@ -65,7 +65,7 @@
- name: Create Sanoid Log
become: true
file:
ansible.builtin.file:
path: /var/log/sanoid-cron.log
state: touch
owner: root
@ -76,7 +76,7 @@
- name: Add Sanoid Log to be Rotated
become: true
blockinfile:
ansible.builtin.blockinfile:
path: /etc/logrotate.d/sanoid
state: present
create: yes
@ -98,7 +98,7 @@
- name: Generate Sanoid Cron Scripts
become: true
template:
ansible.builtin.template:
src: sanoid-cron.sh
dest: /usr/local/bin/sanoid-cron.sh
owner: root
@ -107,7 +107,7 @@
- name: Configure Sanoid Cron Job
become: true
cron:
ansible.builtin.cron:
name: sanoid-cron
job: /usr/local/bin/sanoid-cron.sh
minute: "{{ sanoid_cron_minutes }}"

View file

@ -2,7 +2,7 @@
# deb http://{{ acng_server }}:{{ acng_server_port }}/security.ubuntu.com/ubuntu {{ansible_distribution_release}}-security multiverse
- name: sources.list kopieren
become: yes
template:
ansible.builtin.template:
src: "sources.list"
dest: "/etc/apt/sources.list"
backup: yes
@ -11,6 +11,6 @@
- name: apt_update # noqa 503 503
become: yes
apt:
ansible.builtin.apt:
update_cache: yes
when: copy_src.changed

View file

@ -1,4 +1,4 @@
- name: Setze Zeitzone auf {{ base_timezone }}
become: yes
timezone:
ansible.builtin.timezone:
name: "{{ base_timezone }}"

View file

@ -1,40 +1,40 @@
#Blockdevice/Festplatten muessen haendisch in "templates" eingetragen werden
- name: smartmontools installieren
become: yes
apt:
ansible.builtin.apt:
name: smartmontools
state: present
- name: smartmontools kopieren
become: yes
template:
ansible.builtin.template:
src: "smartmontools"
dest: "/etc/default/smartmontools"
notify: smartmontools_starten_aktivieren
- name: smartd.conf kopieren
become: yes
template:
ansible.builtin.template:
src: "smartd.conf"
dest: "/etc/smartd.conf"
notify: smartmontools_starten_aktivieren
- name: Ordner "smart" erstellen
become: yes
file:
ansible.builtin.file:
path: "/root/smart"
state: directory
- name: smartctl_mail.sh kopieren
become: yes
template:
ansible.builtin.template:
src: "smartctl_mail.sh"
dest: "/root/smart/smartctl_mail.sh"
mode: a+x
- name: smart_status.sh kopieren
become: yes
template:
ansible.builtin.template:
src: "smart_status.sh"
dest: "/usr/local/bin/smart_status.sh"
mode: a+x
@ -42,7 +42,7 @@
# smartctl output als mail
- name: cronjob fuer smartctl-mail
become: yes
cron:
ansible.builtin.cron:
name: smart-mail
state: present
job: "/root/smart/smartctl_mail.sh"

View file

@ -1,6 +1,6 @@
- name: install tmux packages
become: yes
apt:
ansible.builtin.apt:
name:
- tmux
state: present
@ -8,20 +8,20 @@
# - name: ensure homedir exists
# become: yes
# file:
# ansible.builtin.file:
# path: " {{ tmux_conf_destination }}"
# state: directory
# - name: copy .tmux.conf
# become: yes
# template:
# ansible.builtin.template:
# src: ".tmux.conf"
# dest: "{{ tmux_conf_destination }}"
# backup: true
- name: add tmux-session config to .bashrc
become: yes
blockinfile:
ansible.builtin.blockinfile:
path: "{{ tmux_bashrc_destination }}"
block: |
if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then

View file

@ -1,10 +1,10 @@
- name: update apt cache
become: yes
apt:
ansible.builtin.apt:
update_cache: yes
cache_valid_time: 30
- name: updated installed packages
become: yes
apt:
ansible.builtin.apt:
upgrade: dist

View file

@ -1,6 +1,6 @@
- name: zfs-tools installieren
become: yes
apt:
ansible.builtin.apt:
name:
- zfsutils
- zfs-initramfs
@ -9,34 +9,34 @@
- name: Limit ZFS Memory Usage
become: yes
lineinfile:
ansible.builtin.lineinfile:
path: /etc/modprobe.d/zfs.conf
line: options zfs zfs_arc_max={{ zfs_arc_max }}
create: yes
- name: remove system scrub job #https://forum.proxmox.com/threads/script-sequential-zfs-scrub-for-cron.25124/
become: true
lineinfile:
ansible.builtin.lineinfile:
path: /etc/cron.d/zfsutils-linux
state: absent
line: '24 0 8-14 * * root [ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/scrub ] && /usr/lib/zfs-linux/scrub'
- name: erstelle Ordner "root-zfs"
become: yes
file:
ansible.builtin.file:
path: /root/zfs
state: directory
- name: kopiere "zfs-health.sh"
become: yes
template:
ansible.builtin.template:
src: zfs-health.sh
dest: /usr/local/bin/zfs-health.sh
mode: "+x"
- name: lege cronjob fuer "zfs-health.sh" an
become: yes
cron:
ansible.builtin.cron:
name: zfs-health
state: present
job: "/usr/local/bin/zfs-health.sh"
@ -45,7 +45,7 @@
- name: lege cronjob fuer "zfs-scrub" an
become: yes
cron:
ansible.builtin.cron:
name: zfs-scrub - "{{ item.name }}"
state: present
job: "{{ pfad_zu_zpool }} scrub {{ item.name }}"
@ -56,7 +56,7 @@
- name: lege cronjob fuer "zfs-trim" an
become: yes
cron:
ansible.builtin.cron:
name: zfs-trim - "{{ item.name }}"
state: present
job: "{{ pfad_zu_zpool }} trim {{ item.name }}"
@ -70,7 +70,7 @@
- name: kopiere zed.rc
become: yes
template:
ansible.builtin.template:
owner: root
mode: 0600
src: zed.rc
@ -79,14 +79,14 @@
- name: copy zfs-free.sh
become: yes
template:
ansible.builtin.template:
mode: 0555
src: zfs-free.sh
dest: /usr/local/bin/zfs-free.sh
- name: Erlaube "non-root" Usern Read-Only ZFS Commands
become: yes
template:
ansible.builtin.template:
src: sudoers_zfs
dest: /etc/sudoers.d/zfs
owner: root