From 15d783de86f2851a5979f67540339589f7bf09ae Mon Sep 17 00:00:00 2001 From: Quotengrote <38253905+quotengrote@users.noreply.github.com> Date: Sat, 21 Nov 2020 19:41:19 +0100 Subject: [PATCH] =?UTF-8?q?FQCN=20eingef=C3=BChrt=20(#70)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- playbooks/on-off/apt_autoremove.yml | 2 +- playbooks/on-off/apt_update.yml | 2 +- playbooks/on-off/deinstall_cowsay.yml | 2 +- playbooks/on-off/deinstall_telegraf.yml | 2 +- playbooks/on-off/remove_dotfiles_dir.yml | 8 +++---- playbooks/on-off/remove_ipmitool.yml | 2 +- playbooks/on-off/set_dns_resolver.yml | 2 +- roles/mgrote.acng/tasks/main.yml | 4 ++-- roles/mgrote.ansible/tasks/main.yml | 4 ++-- roles/mgrote.apcupsd/tasks/main.yml | 8 +++---- roles/mgrote.create_users/tasks/main.yml | 8 +++---- roles/mgrote.cv4pve-autosnap/tasks/main.yml | 14 ++++++------ .../tasks/main.yml | 2 +- roles/mgrote.dokuwiki/tasks/main.yml | 22 +++++++++---------- roles/mgrote.ecc-rasdaemon/tasks/main.yml | 14 ++++++------ roles/mgrote.fail2ban/tasks/main.yml | 6 ++--- roles/mgrote.fileserver_smb/tasks/main.yml | 12 +++++----- roles/mgrote.install_packages/tasks/main.yml | 12 +++++----- roles/mgrote.motd/tasks/main.yml | 18 +++++++-------- roles/mgrote.musterrolle/tasks/main.yml | 10 ++++----- roles/mgrote.postfix-gmail/tasks/main.yml | 10 ++++----- roles/mgrote.restic/tasks/main.yml | 20 ++++++++--------- roles/mgrote.sanoid/tasks/main.yml | 20 ++++++++--------- roles/mgrote.set_apt_sources/tasks/main.yml | 4 ++-- roles/mgrote.set_timezone/tasks/main.yml | 2 +- roles/mgrote.smart/tasks/main.yml | 14 ++++++------ roles/mgrote.tmux/tasks/main.yml | 8 +++---- roles/mgrote.update_packages/tasks/main.yml | 4 ++-- roles/mgrote.zfs_tools/tasks/main.yml | 22 +++++++++---------- 29 files changed, 129 insertions(+), 129 deletions(-) diff --git a/playbooks/on-off/apt_autoremove.yml b/playbooks/on-off/apt_autoremove.yml index aec28428..ca36b3f8 100644 --- a/playbooks/on-off/apt_autoremove.yml +++ b/playbooks/on-off/apt_autoremove.yml @@ -6,5 +6,5 @@ tasks: - name: apt autoremove become: yes - apt: + ansible.builtin.apt: autoremove: yes diff --git a/playbooks/on-off/apt_update.yml b/playbooks/on-off/apt_update.yml index 90f00a66..5ad842a5 100644 --- a/playbooks/on-off/apt_update.yml +++ b/playbooks/on-off/apt_update.yml @@ -6,5 +6,5 @@ tasks: - name: update apt cache become: yes - apt: + ansible.builtin.apt: update_cache: yes diff --git a/playbooks/on-off/deinstall_cowsay.yml b/playbooks/on-off/deinstall_cowsay.yml index cf9b9743..60937430 100644 --- a/playbooks/on-off/deinstall_cowsay.yml +++ b/playbooks/on-off/deinstall_cowsay.yml @@ -3,6 +3,6 @@ tasks: - name: cowsay deinstallieren become: yes - apt: + ansible.builtin.apt: name: cowsay state: absent diff --git a/playbooks/on-off/deinstall_telegraf.yml b/playbooks/on-off/deinstall_telegraf.yml index 7fb5d072..cfe5e696 100644 --- a/playbooks/on-off/deinstall_telegraf.yml +++ b/playbooks/on-off/deinstall_telegraf.yml @@ -3,7 +3,7 @@ tasks: - name: telegraf deinstallieren become: yes - apt: + ansible.builtin.apt: name: telegraf state: absent - name: telegraf-repository entfernen diff --git a/playbooks/on-off/remove_dotfiles_dir.yml b/playbooks/on-off/remove_dotfiles_dir.yml index 81c1b738..b838f5dc 100644 --- a/playbooks/on-off/remove_dotfiles_dir.yml +++ b/playbooks/on-off/remove_dotfiles_dir.yml @@ -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 diff --git a/playbooks/on-off/remove_ipmitool.yml b/playbooks/on-off/remove_ipmitool.yml index 87891e01..6cea4458 100644 --- a/playbooks/on-off/remove_ipmitool.yml +++ b/playbooks/on-off/remove_ipmitool.yml @@ -5,7 +5,7 @@ tasks: - name: remove Packages become: yes - apt: + ansible.builtin.apt: name: - hddtemp - ipmitool diff --git a/playbooks/on-off/set_dns_resolver.yml b/playbooks/on-off/set_dns_resolver.yml index 85abd006..ce845a9e 100644 --- a/playbooks/on-off/set_dns_resolver.yml +++ b/playbooks/on-off/set_dns_resolver.yml @@ -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 diff --git a/roles/mgrote.acng/tasks/main.yml b/roles/mgrote.acng/tasks/main.yml index 8b2511ca..1b4228d0 100644 --- a/roles/mgrote.acng/tasks/main.yml +++ b/roles/mgrote.acng/tasks/main.yml @@ -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 diff --git a/roles/mgrote.ansible/tasks/main.yml b/roles/mgrote.ansible/tasks/main.yml index 26003e41..b1067204 100644 --- a/roles/mgrote.ansible/tasks/main.yml +++ b/roles/mgrote.ansible/tasks/main.yml @@ -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 diff --git a/roles/mgrote.apcupsd/tasks/main.yml b/roles/mgrote.apcupsd/tasks/main.yml index 60e2df75..8b92968b 100644 --- a/roles/mgrote.apcupsd/tasks/main.yml +++ b/roles/mgrote.apcupsd/tasks/main.yml @@ -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" diff --git a/roles/mgrote.create_users/tasks/main.yml b/roles/mgrote.create_users/tasks/main.yml index d3f68703..79b87d61 100644 --- a/roles/mgrote.create_users/tasks/main.yml +++ b/roles/mgrote.create_users/tasks/main.yml @@ -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 diff --git a/roles/mgrote.cv4pve-autosnap/tasks/main.yml b/roles/mgrote.cv4pve-autosnap/tasks/main.yml index ec7533fd..2ab27e05 100644 --- a/roles/mgrote.cv4pve-autosnap/tasks/main.yml +++ b/roles/mgrote.cv4pve-autosnap/tasks/main.yml @@ -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 diff --git a/roles/mgrote.deactivate_ssh_password_login/tasks/main.yml b/roles/mgrote.deactivate_ssh_password_login/tasks/main.yml index cf9b0702..2558cd8d 100644 --- a/roles/mgrote.deactivate_ssh_password_login/tasks/main.yml +++ b/roles/mgrote.deactivate_ssh_password_login/tasks/main.yml @@ -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' diff --git a/roles/mgrote.dokuwiki/tasks/main.yml b/roles/mgrote.dokuwiki/tasks/main.yml index e87de482..59eb0081 100644 --- a/roles/mgrote.dokuwiki/tasks/main.yml +++ b/roles/mgrote.dokuwiki/tasks/main.yml @@ -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 diff --git a/roles/mgrote.ecc-rasdaemon/tasks/main.yml b/roles/mgrote.ecc-rasdaemon/tasks/main.yml index 87f1e80a..373da84b 100644 --- a/roles/mgrote.ecc-rasdaemon/tasks/main.yml +++ b/roles/mgrote.ecc-rasdaemon/tasks/main.yml @@ -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 diff --git a/roles/mgrote.fail2ban/tasks/main.yml b/roles/mgrote.fail2ban/tasks/main.yml index 710d26a3..2e635e83 100644 --- a/roles/mgrote.fail2ban/tasks/main.yml +++ b/roles/mgrote.fail2ban/tasks/main.yml @@ -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 diff --git a/roles/mgrote.fileserver_smb/tasks/main.yml b/roles/mgrote.fileserver_smb/tasks/main.yml index 2a09d01e..020cc08f 100644 --- a/roles/mgrote.fileserver_smb/tasks/main.yml +++ b/roles/mgrote.fileserver_smb/tasks/main.yml @@ -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' diff --git a/roles/mgrote.install_packages/tasks/main.yml b/roles/mgrote.install_packages/tasks/main.yml index 479a90a3..8a989e46 100644 --- a/roles/mgrote.install_packages/tasks/main.yml +++ b/roles/mgrote.install_packages/tasks/main.yml @@ -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 diff --git a/roles/mgrote.motd/tasks/main.yml b/roles/mgrote.motd/tasks/main.yml index fe81297b..6e4ab24d 100644 --- a/roles/mgrote.motd/tasks/main.yml +++ b/roles/mgrote.motd/tasks/main.yml @@ -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 diff --git a/roles/mgrote.musterrolle/tasks/main.yml b/roles/mgrote.musterrolle/tasks/main.yml index 8ec5f688..9fc80561 100644 --- a/roles/mgrote.musterrolle/tasks/main.yml +++ b/roles/mgrote.musterrolle/tasks/main.yml @@ -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 diff --git a/roles/mgrote.postfix-gmail/tasks/main.yml b/roles/mgrote.postfix-gmail/tasks/main.yml index 5087a763..7c28308e 100644 --- a/roles/mgrote.postfix-gmail/tasks/main.yml +++ b/roles/mgrote.postfix-gmail/tasks/main.yml @@ -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: "" diff --git a/roles/mgrote.restic/tasks/main.yml b/roles/mgrote.restic/tasks/main.yml index 33514f20..543624ea 100644 --- a/roles/mgrote.restic/tasks/main.yml +++ b/roles/mgrote.restic/tasks/main.yml @@ -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 diff --git a/roles/mgrote.sanoid/tasks/main.yml b/roles/mgrote.sanoid/tasks/main.yml index bd295da2..461dd65a 100644 --- a/roles/mgrote.sanoid/tasks/main.yml +++ b/roles/mgrote.sanoid/tasks/main.yml @@ -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 }}" diff --git a/roles/mgrote.set_apt_sources/tasks/main.yml b/roles/mgrote.set_apt_sources/tasks/main.yml index c7cf5ff4..8b1e4d77 100644 --- a/roles/mgrote.set_apt_sources/tasks/main.yml +++ b/roles/mgrote.set_apt_sources/tasks/main.yml @@ -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 diff --git a/roles/mgrote.set_timezone/tasks/main.yml b/roles/mgrote.set_timezone/tasks/main.yml index ea082a49..4b50fcd1 100644 --- a/roles/mgrote.set_timezone/tasks/main.yml +++ b/roles/mgrote.set_timezone/tasks/main.yml @@ -1,4 +1,4 @@ - name: Setze Zeitzone auf {{ base_timezone }} become: yes - timezone: + ansible.builtin.timezone: name: "{{ base_timezone }}" diff --git a/roles/mgrote.smart/tasks/main.yml b/roles/mgrote.smart/tasks/main.yml index df9f0d4a..60cf9aca 100644 --- a/roles/mgrote.smart/tasks/main.yml +++ b/roles/mgrote.smart/tasks/main.yml @@ -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" diff --git a/roles/mgrote.tmux/tasks/main.yml b/roles/mgrote.tmux/tasks/main.yml index 5a1f2dba..47dfad6d 100644 --- a/roles/mgrote.tmux/tasks/main.yml +++ b/roles/mgrote.tmux/tasks/main.yml @@ -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 diff --git a/roles/mgrote.update_packages/tasks/main.yml b/roles/mgrote.update_packages/tasks/main.yml index ca7de357..5a1a04d5 100644 --- a/roles/mgrote.update_packages/tasks/main.yml +++ b/roles/mgrote.update_packages/tasks/main.yml @@ -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 diff --git a/roles/mgrote.zfs_tools/tasks/main.yml b/roles/mgrote.zfs_tools/tasks/main.yml index ed874bcd..9f6dc0ce 100644 --- a/roles/mgrote.zfs_tools/tasks/main.yml +++ b/roles/mgrote.zfs_tools/tasks/main.yml @@ -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