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:
parent
aab871d86b
commit
15d783de86
29 changed files with 129 additions and 129 deletions
|
@ -6,5 +6,5 @@
|
||||||
tasks:
|
tasks:
|
||||||
- name: apt autoremove
|
- name: apt autoremove
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
autoremove: yes
|
autoremove: yes
|
||||||
|
|
|
@ -6,5 +6,5 @@
|
||||||
tasks:
|
tasks:
|
||||||
- name: update apt cache
|
- name: update apt cache
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
tasks:
|
tasks:
|
||||||
- name: cowsay deinstallieren
|
- name: cowsay deinstallieren
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name: cowsay
|
name: cowsay
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
tasks:
|
tasks:
|
||||||
- name: telegraf deinstallieren
|
- name: telegraf deinstallieren
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name: telegraf
|
name: telegraf
|
||||||
state: absent
|
state: absent
|
||||||
- name: telegraf-repository entfernen
|
- name: telegraf-repository entfernen
|
||||||
|
|
|
@ -4,21 +4,21 @@
|
||||||
tasks:
|
tasks:
|
||||||
- name: delete /home/mg/dotfiles-repo
|
- name: delete /home/mg/dotfiles-repo
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /home/mg/dotfiles-repo
|
path: /home/mg/dotfiles-repo
|
||||||
state: absent
|
state: absent
|
||||||
- name: delete /home/mg/.bash_aliases
|
- name: delete /home/mg/.bash_aliases
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /home/mg/.bash_aliases
|
path: /home/mg/.bash_aliases
|
||||||
state: absent
|
state: absent
|
||||||
- name: delete /home/mg/.tmux.conf
|
- name: delete /home/mg/.tmux.conf
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /home/mg/.tmux.conf
|
path: /home/mg/.tmux.conf
|
||||||
state: absent
|
state: absent
|
||||||
- name: delete /home/mg/.gitconfig
|
- name: delete /home/mg/.gitconfig
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /home/mg/.gitconfig
|
path: /home/mg/.gitconfig
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
tasks:
|
tasks:
|
||||||
- name: remove Packages
|
- name: remove Packages
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- hddtemp
|
- hddtemp
|
||||||
- ipmitool
|
- ipmitool
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Setze DNS-Resolver fuer pihole-*
|
- name: Setze DNS-Resolver fuer pihole-*
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/resolv.conf.head
|
path: /etc/resolv.conf.head
|
||||||
line: nameserver 192.168.2.2
|
line: nameserver 192.168.2.2
|
||||||
create: yes
|
create: yes
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
- name: apt-cacher-ng installieren
|
- name: apt-cacher-ng installieren
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name: apt-cacher-ng
|
name: apt-cacher-ng
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: acng.conf kopieren
|
- name: acng.conf kopieren
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "acng.conf"
|
src: "acng.conf"
|
||||||
dest: "/etc/apt-cacher-ng/acng.conf"
|
dest: "/etc/apt-cacher-ng/acng.conf"
|
||||||
mode: 0664
|
mode: 0664
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
# https://github.com/viczem/ansible-keepass#readme
|
# https://github.com/viczem/ansible-keepass#readme
|
||||||
- name: create ~/.ansible/plugins/lookup
|
- name: create ~/.ansible/plugins/lookup
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /home/mg/.ansible/plugins/lookup
|
path: /home/mg/.ansible/plugins/lookup
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Download keepass.py
|
- name: Download keepass.py
|
||||||
become: yes
|
become: yes
|
||||||
get_url:
|
ansible.builtin.get_url:
|
||||||
url: https://raw.githubusercontent.com/viczem/ansible-keepass/master/keepass.py
|
url: https://raw.githubusercontent.com/viczem/ansible-keepass/master/keepass.py
|
||||||
dest: /home/mg/.ansible/plugins/lookup/keepass.py
|
dest: /home/mg/.ansible/plugins/lookup/keepass.py
|
||||||
backup: yes
|
backup: yes
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
- name: apcupsd installieren
|
- name: apcupsd installieren
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- apcupsd
|
- apcupsd
|
||||||
- apcupsd-cgi
|
- apcupsd-cgi
|
||||||
|
@ -10,13 +10,13 @@
|
||||||
|
|
||||||
- name: apcupsd kopieren
|
- name: apcupsd kopieren
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "apcupsd"
|
src: "apcupsd"
|
||||||
dest: "/etc/default/apcupsd"
|
dest: "/etc/default/apcupsd"
|
||||||
|
|
||||||
- name: empfaenger_mail_setzen
|
- name: empfaenger_mail_setzen
|
||||||
become: yes
|
become: yes
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/apcupsd/apccontrol #wo
|
path: /etc/apcupsd/apccontrol #wo
|
||||||
regexp: export SYSADMIN=root #suche nach
|
regexp: export SYSADMIN=root #suche nach
|
||||||
line: export SYSADMIN={{ empfaenger_mail }} #ersetze durch...
|
line: export SYSADMIN={{ empfaenger_mail }} #ersetze durch...
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
- name: apcupsd.conf_kopieren
|
- name: apcupsd.conf_kopieren
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "apcupsd.conf"
|
src: "apcupsd.conf"
|
||||||
dest: "/etc/apcupsd/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"
|
notify: restart_apcupsd #benachrchtigt handlers/main.yml-restart-apcupsd_restart um den dient neuzustarten, nur wenn hier status "changed" ausgeworfen wird"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
- name: Erstelle Nutzer
|
- name: Erstelle Nutzer
|
||||||
become: yes
|
become: yes
|
||||||
user:
|
ansible.builtin.user:
|
||||||
name: "{{ create_user_name }}"
|
name: "{{ create_user_name }}"
|
||||||
groups: "{{ create_user_groups }}"
|
groups: "{{ create_user_groups }}"
|
||||||
state: present
|
state: present
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
- name: touch ".sudo_as_admin_successful"
|
- name: touch ".sudo_as_admin_successful"
|
||||||
become: yes
|
become: yes
|
||||||
# when: sudo_as_admin_successful_existiert.stat.exists == False
|
# when: sudo_as_admin_successful_existiert.stat.exists == False
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /home/{{ create_user_name }}/.sudo_as_admin_successful
|
path: /home/{{ create_user_name }}/.sudo_as_admin_successful
|
||||||
state: touch
|
state: touch
|
||||||
access_time: preserve
|
access_time: preserve
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
- name: create .selected_editor
|
- name: create .selected_editor
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: ".selected_editor"
|
src: ".selected_editor"
|
||||||
dest: "/home/{{ create_user_name }}/.selected_editor"
|
dest: "/home/{{ create_user_name }}/.selected_editor"
|
||||||
# no_log: true
|
# no_log: true
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
# Validate the sudoers file before saving
|
# Validate the sudoers file before saving
|
||||||
- name: set sudo without password
|
- name: set sudo without password
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: sudoers
|
src: sudoers
|
||||||
dest: /etc/sudoers.d/{{ create_user_name }}
|
dest: /etc/sudoers.d/{{ create_user_name }}
|
||||||
validate: /usr/sbin/visudo -cf %s
|
validate: /usr/sbin/visudo -cf %s
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: create directories
|
- name: create directories
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
loop:
|
loop:
|
||||||
|
@ -10,14 +10,14 @@
|
||||||
|
|
||||||
- name: download archives
|
- name: download archives
|
||||||
become: yes
|
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
|
url: https://github.com/Corsinvest/cv4pve-autosnap/releases/download/{{ cv4pve_version }}/cv4pve-autosnap-linux-x64.zip
|
||||||
dest: /tmp/cv4pve/cv4pve-autosnap-linux-x64.zip
|
dest: /tmp/cv4pve/cv4pve-autosnap-linux-x64.zip
|
||||||
mode: '0775'
|
mode: '0775'
|
||||||
|
|
||||||
- name: Extract archives
|
- name: Extract archives
|
||||||
become: yes
|
become: yes
|
||||||
unarchive:
|
ansible.builtin.unarchive:
|
||||||
src: /tmp/cv4pve/cv4pve-autosnap-linux-x64.zip
|
src: /tmp/cv4pve/cv4pve-autosnap-linux-x64.zip
|
||||||
dest: /usr/local/bin/cv4pve
|
dest: /usr/local/bin/cv4pve
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
|
@ -25,14 +25,14 @@
|
||||||
|
|
||||||
- name: copy bash-script
|
- name: copy bash-script
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "cv4pve-script.sh"
|
src: "cv4pve-script.sh"
|
||||||
dest: "/usr/local/bin/cv4pve/cv4pve-script.sh"
|
dest: "/usr/local/bin/cv4pve/cv4pve-script.sh"
|
||||||
mode: a+x
|
mode: a+x
|
||||||
|
|
||||||
- name: create cronjob
|
- name: create cronjob
|
||||||
become: yes
|
become: yes
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: cv4pve-autosnap
|
name: cv4pve-autosnap
|
||||||
state: present
|
state: present
|
||||||
job: "/usr/local/bin/cv4pve/cv4pve-script.sh"
|
job: "/usr/local/bin/cv4pve/cv4pve-script.sh"
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
- name: Create log
|
- name: Create log
|
||||||
become: true
|
become: true
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /var/log/cv4pve-autosnap.log
|
path: /var/log/cv4pve-autosnap.log
|
||||||
state: touch
|
state: touch
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
|
|
||||||
- name: Add Log to be Rotated
|
- name: Add Log to be Rotated
|
||||||
become: true
|
become: true
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: /etc/logrotate.d/cv4pve-autosnap
|
path: /etc/logrotate.d/cv4pve-autosnap
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: yes
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: prohibit ssh login with password
|
- name: prohibit ssh login with password
|
||||||
become: yes
|
become: yes
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/ssh/sshd_config
|
path: /etc/ssh/sshd_config
|
||||||
regexp: '#PasswordAuthentication yes'
|
regexp: '#PasswordAuthentication yes'
|
||||||
line: 'PasswordAuthentication no'
|
line: 'PasswordAuthentication no'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
- name: install packages
|
- name: install packages
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- php
|
- php
|
||||||
- php-mbstring
|
- php-mbstring
|
||||||
|
@ -14,20 +14,20 @@
|
||||||
# aktiviert das module rewrite = a2enmod rewrite
|
# aktiviert das module rewrite = a2enmod rewrite
|
||||||
- name: activate a2enmod rewrite
|
- name: activate a2enmod rewrite
|
||||||
become: yes
|
become: yes
|
||||||
apache2_module:
|
ansible.builtin.apache2_module:
|
||||||
state: present
|
state: present
|
||||||
name: rewrite
|
name: rewrite
|
||||||
|
|
||||||
- name: Download latest dokuwiki
|
- name: Download latest dokuwiki
|
||||||
become: yes
|
become: yes
|
||||||
get_url:
|
ansible.builtin.get_url:
|
||||||
url: https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
|
url: https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
|
||||||
dest: /tmp/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
|
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
|
- name: create dokuwiki install path
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ dokuwiki_install_path }}"
|
path: "{{ dokuwiki_install_path }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: www-data
|
owner: www-data
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
- name: Unarchive dokuwiki-stable.tgz to {{ dokuwiki_install_path }}
|
- name: Unarchive dokuwiki-stable.tgz to {{ dokuwiki_install_path }}
|
||||||
become: yes
|
become: yes
|
||||||
unarchive:
|
ansible.builtin.unarchive:
|
||||||
src: /tmp/dokuwiki-stable.tgz
|
src: /tmp/dokuwiki-stable.tgz
|
||||||
dest: "{{ dokuwiki_install_path }}"
|
dest: "{{ dokuwiki_install_path }}"
|
||||||
owner: www-data
|
owner: www-data
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
- name: Remove default plugins
|
- name: Remove default plugins
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: '{{ dokuwiki_install_path }}/lib/plugins/{{ item }}'
|
path: '{{ dokuwiki_install_path }}/lib/plugins/{{ item }}'
|
||||||
state: absent
|
state: absent
|
||||||
with_items:
|
with_items:
|
||||||
|
@ -58,34 +58,34 @@
|
||||||
|
|
||||||
- name: Change file ownership, group and permissions
|
- name: Change file ownership, group and permissions
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ dokuwiki_install_path }}"
|
path: "{{ dokuwiki_install_path }}"
|
||||||
owner: www-data
|
owner: www-data
|
||||||
group: www-data
|
group: www-data
|
||||||
|
|
||||||
- name: copy apache2.conf
|
- name: copy apache2.conf
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "apache2.conf"
|
src: "apache2.conf"
|
||||||
dest: "/etc/apache2/apache2.conf"
|
dest: "/etc/apache2/apache2.conf"
|
||||||
notify: restart_apache2
|
notify: restart_apache2
|
||||||
|
|
||||||
- name: copy 000-default.conf
|
- name: copy 000-default.conf
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "000-default.conf"
|
src: "000-default.conf"
|
||||||
dest: "/etc/apache2/sites-enabled/000-default.conf"
|
dest: "/etc/apache2/sites-enabled/000-default.conf"
|
||||||
notify: restart_apache2
|
notify: restart_apache2
|
||||||
|
|
||||||
- name: remove tmp files
|
- name: remove tmp files
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /tmp/dokuwiki-stable.tgz
|
path: /tmp/dokuwiki-stable.tgz
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: remove install.php
|
- name: remove install.php
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: '{{ dokuwiki_install_path }}/install.php'
|
path: '{{ dokuwiki_install_path }}/install.php'
|
||||||
state: absent
|
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
|
when: not dokuwiki_install # noqa 601 # entspricht when: dokuwiki_update == true; noqa sorgt dafür dass das beispiel nicht "gemeldet" wird # entspricht == false
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
- name: Install rasdaemon
|
- name: Install rasdaemon
|
||||||
become: true
|
become: true
|
||||||
package:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- rasdaemon
|
- rasdaemon
|
||||||
- logrotate
|
- logrotate
|
||||||
|
@ -9,19 +9,19 @@
|
||||||
|
|
||||||
- name: Enable rasdaemon service
|
- name: Enable rasdaemon service
|
||||||
become: true
|
become: true
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: rasdaemon
|
name: rasdaemon
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
- name: Start rasdaemon service
|
- name: Start rasdaemon service
|
||||||
become: true
|
become: true
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: rasdaemon
|
name: rasdaemon
|
||||||
state: started
|
state: started
|
||||||
|
|
||||||
- name: Create rasdaemon log
|
- name: Create rasdaemon log
|
||||||
become: true
|
become: true
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /var/log/rasdaemon.log
|
path: /var/log/rasdaemon.log
|
||||||
state: touch
|
state: touch
|
||||||
access_time: preserve
|
access_time: preserve
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
- name: Add rasdaemon Log to be Rotated
|
- name: Add rasdaemon Log to be Rotated
|
||||||
become: true
|
become: true
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: /etc/logrotate.d/rasdaemon
|
path: /etc/logrotate.d/rasdaemon
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: yes
|
||||||
|
@ -51,14 +51,14 @@
|
||||||
|
|
||||||
- name: rasdaemon-cron kopieren
|
- name: rasdaemon-cron kopieren
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: rasdaemon-cron.sh
|
src: rasdaemon-cron.sh
|
||||||
dest: "/usr/local/bin/rasdaemon-cron.sh"
|
dest: "/usr/local/bin/rasdaemon-cron.sh"
|
||||||
mode: a+x
|
mode: a+x
|
||||||
|
|
||||||
- name: create cronjob
|
- name: create cronjob
|
||||||
become: yes
|
become: yes
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: rasdaemon-log
|
name: rasdaemon-log
|
||||||
state: present
|
state: present
|
||||||
job: /usr/local/bin/rasdaemon-cron.sh
|
job: /usr/local/bin/rasdaemon-cron.sh
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
---
|
---
|
||||||
- name: install fail2ban-packages
|
- name: install fail2ban-packages
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name: fail2ban
|
name: fail2ban
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: copy jail.local
|
- name: copy jail.local
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: jail.local
|
src: jail.local
|
||||||
dest: /etc/fail2ban/jail.local
|
dest: /etc/fail2ban/jail.local
|
||||||
mode: 0750
|
mode: 0750
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
- name: copy sendmail-common.local
|
- name: copy sendmail-common.local
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: sendmail-common.local
|
src: sendmail-common.local
|
||||||
dest: /etc/fail2ban/action.d/sendmail-common.local
|
dest: /etc/fail2ban/action.d/sendmail-common.local
|
||||||
mode: 0750
|
mode: 0750
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
- name: SAMBA installieren
|
- name: SAMBA installieren
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- samba
|
- samba
|
||||||
- cifs-utils
|
- cifs-utils
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
- name: Erstelle Linux-Gruppen # vat /etc/group #kommt aus vars im playbook
|
- name: Erstelle Linux-Gruppen # vat /etc/group #kommt aus vars im playbook
|
||||||
become: yes
|
become: yes
|
||||||
group:
|
ansible.builtin.group:
|
||||||
name: "{{ item.groups }}"
|
name: "{{ item.groups }}"
|
||||||
state: present
|
state: present
|
||||||
loop: "{{ smb_nutzer }}"
|
loop: "{{ smb_nutzer }}"
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
- name: Erstelle Linux-Nutzer #kommt aus vars im playbook
|
- name: Erstelle Linux-Nutzer #kommt aus vars im playbook
|
||||||
become: yes
|
become: yes
|
||||||
user:
|
ansible.builtin.user:
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
group: "{{ item.groups }}"
|
group: "{{ item.groups }}"
|
||||||
state: present
|
state: present
|
||||||
|
@ -30,14 +30,14 @@
|
||||||
|
|
||||||
- name: Loesche alte Linux-Nutzer #kommt aus vars im playbook
|
- name: Loesche alte Linux-Nutzer #kommt aus vars im playbook
|
||||||
become: yes
|
become: yes
|
||||||
user:
|
ansible.builtin.user:
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{{ smb_nutzer_loeschen }}"
|
loop: "{{ smb_nutzer_loeschen }}"
|
||||||
|
|
||||||
- name: Erstelle Freigabeordner
|
- name: Erstelle Freigabeordner
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item.ordnerpfad }}"
|
path: "{{ item.ordnerpfad }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0777
|
mode: 0777
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
- name: "Konfiguriere Freigaben"
|
- name: "Konfiguriere Freigaben"
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: smb.conf.j2
|
src: smb.conf.j2
|
||||||
dest: /etc/samba/smb.conf
|
dest: /etc/samba/smb.conf
|
||||||
validate: 'testparm -s %s'
|
validate: 'testparm -s %s'
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
- name: apt update
|
- name: apt update
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
cache_valid_time: 300
|
cache_valid_time: 300
|
||||||
|
|
||||||
- name: install common-packages
|
- name: install common-packages
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name: "{{ programs_common }}"
|
name: "{{ programs_common }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: install vm-packages
|
- name: install vm-packages
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name: "{{ programs_only_vms }}"
|
name: "{{ programs_only_vms }}"
|
||||||
state: present
|
state: present
|
||||||
when: ansible_virtualization_role == 'guest'
|
when: ansible_virtualization_role == 'guest'
|
||||||
|
|
||||||
- name: install physical-packages
|
- name: install physical-packages
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name: "{{ programs_only_physical }}"
|
name: "{{ programs_only_physical }}"
|
||||||
state: present
|
state: present
|
||||||
when: ansible_virtualization_role != 'guest'
|
when: ansible_virtualization_role != 'guest'
|
||||||
|
|
||||||
- name: copy hddtemps.sh
|
- name: copy hddtemps.sh
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "hddtemps.sh"
|
src: "hddtemps.sh"
|
||||||
dest: "/usr/local/bin/hddtemps.sh"
|
dest: "/usr/local/bin/hddtemps.sh"
|
||||||
mode: a+x
|
mode: a+x
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
- name: copy systemtemps.sh
|
- name: copy systemtemps.sh
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "systemtemps.sh"
|
src: "systemtemps.sh"
|
||||||
dest: "/usr/local/bin/systemtemps.sh"
|
dest: "/usr/local/bin/systemtemps.sh"
|
||||||
mode: a+x
|
mode: a+x
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
- name: install fortune
|
- name: install fortune
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- fortune
|
- fortune
|
||||||
state: present
|
state: present
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
- name: install packages
|
- name: install packages
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- update-motd
|
- update-motd
|
||||||
state: present
|
state: present
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
##################
|
##################
|
||||||
- name: 'Ubuntu : remove motd'
|
- name: 'Ubuntu : remove motd'
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: '/etc/update-motd.d/{{ item }}'
|
path: '/etc/update-motd.d/{{ item }}'
|
||||||
state: absent
|
state: absent
|
||||||
with_items:
|
with_items:
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
##################
|
##################
|
||||||
- name: delete "Last Login" - Message
|
- name: delete "Last Login" - Message
|
||||||
become: yes
|
become: yes
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/ssh/sshd_config
|
path: /etc/ssh/sshd_config
|
||||||
regexp: "#PrintLastLog yes"
|
regexp: "#PrintLastLog yes"
|
||||||
line: "PrintLastLog no"
|
line: "PrintLastLog no"
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
- name: setup new motd
|
- name: setup new motd
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: '{{ item }}'
|
src: '{{ item }}'
|
||||||
dest: '/etc/update-motd.d/{{ item }}'
|
dest: '/etc/update-motd.d/{{ item }}'
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
|
|
||||||
- name: setup new motd - fortune
|
- name: setup new motd - fortune
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: '05-fortune-mgrote'
|
src: '05-fortune-mgrote'
|
||||||
dest: '/etc/update-motd.d/05-fortune-mgrote'
|
dest: '/etc/update-motd.d/05-fortune-mgrote'
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -69,14 +69,14 @@
|
||||||
|
|
||||||
- name: delete fortune
|
- name: delete fortune
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /etc/update-motd.d/05-fortune-mgrote
|
path: /etc/update-motd.d/05-fortune-mgrote
|
||||||
state: absent
|
state: absent
|
||||||
when: not motd_fortune_aktiv
|
when: not motd_fortune_aktiv
|
||||||
|
|
||||||
- name: setup new motd - wetter
|
- name: setup new motd - wetter
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: '10-wetter-mgrote'
|
src: '10-wetter-mgrote'
|
||||||
dest: '/etc/update-motd.d/10-wetter-mgrote'
|
dest: '/etc/update-motd.d/10-wetter-mgrote'
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
|
|
||||||
- name: delete Wetter
|
- name: delete Wetter
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: '/etc/update-motd.d/10-wetter-mgrote'
|
path: '/etc/update-motd.d/10-wetter-mgrote'
|
||||||
state: absent
|
state: absent
|
||||||
when: not motd_wetter_aktiv
|
when: not motd_wetter_aktiv
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# für scripte
|
# für scripte
|
||||||
- name: create /etc/restic
|
- name: create /etc/restic
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /etc/restic
|
path: /etc/restic
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
|
@ -11,19 +11,19 @@
|
||||||
|
|
||||||
- name: copy restic_backup.sh
|
- name: copy restic_backup.sh
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "restic_backup.sh"
|
src: "restic_backup.sh"
|
||||||
dest: "/usr/local/bin/restic_backup.sh"
|
dest: "/usr/local/bin/restic_backup.sh"
|
||||||
mode: a+x
|
mode: a+x
|
||||||
- name: copy exclude.txt
|
- name: copy exclude.txt
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "exclude.txt"
|
src: "exclude.txt"
|
||||||
dest: "/etc/restic/exclude.txt"
|
dest: "/etc/restic/exclude.txt"
|
||||||
|
|
||||||
- name: Create restic log
|
- name: Create restic log
|
||||||
become: true
|
become: true
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /var/log/restic.log
|
path: /var/log/restic.log
|
||||||
state: touch
|
state: touch
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
- name: Add restic Log to be Rotated
|
- name: Add restic Log to be Rotated
|
||||||
become: true
|
become: true
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: /etc/logrotate.d/restic
|
path: /etc/logrotate.d/restic
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: yes
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
- name: postfix + Hilfsprogramme installieren
|
- name: postfix + Hilfsprogramme installieren
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- postfix
|
- postfix
|
||||||
- mailutils
|
- mailutils
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
- name: kopiere sasl_passwd
|
- name: kopiere sasl_passwd
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: sasl_passwd
|
src: sasl_passwd
|
||||||
dest: /etc/postfix/sasl_passwd
|
dest: /etc/postfix/sasl_passwd
|
||||||
force: yes
|
force: yes
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
- name: kopiere postfix_main.cf
|
- name: kopiere postfix_main.cf
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: main.cf
|
src: main.cf
|
||||||
dest: /etc/postfix/main.cf
|
dest: /etc/postfix/main.cf
|
||||||
notify:
|
notify:
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
- name: Mail Cronjob - Anlegen
|
- name: Mail Cronjob - Anlegen
|
||||||
become: yes
|
become: yes
|
||||||
when: mail_nach_cronjob # ohne parameter wird auf true geprueft https://www.buildahomelab.com/2018/11/12/using-ansible-when-statements/
|
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
|
name: MAILTO
|
||||||
env: yes
|
env: yes
|
||||||
job: "{{ empfaenger_mail }}"
|
job: "{{ empfaenger_mail }}"
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
- name: Mail Cronjob - Entfernen
|
- name: Mail Cronjob - Entfernen
|
||||||
become: yes
|
become: yes
|
||||||
when: not mail_nach_cronjob
|
when: not mail_nach_cronjob
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: MAILTO
|
name: MAILTO
|
||||||
env: yes
|
env: yes
|
||||||
job: ""
|
job: ""
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
- name: install restic-packages
|
- name: install restic-packages
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- restic
|
- restic
|
||||||
- logrotate
|
- logrotate
|
||||||
|
@ -8,13 +8,13 @@
|
||||||
|
|
||||||
- name: create /etc/restic
|
- name: create /etc/restic
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /etc/restic
|
path: /etc/restic
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: create restic mount-directory
|
- name: create restic mount-directory
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ restic_mount }}"
|
path: "{{ restic_mount }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
- name: copy smb_password.txt
|
- name: copy smb_password.txt
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "smb_password.txt"
|
src: "smb_password.txt"
|
||||||
dest: "/etc/restic/smb_password.txt"
|
dest: "/etc/restic/smb_password.txt"
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -32,20 +32,20 @@
|
||||||
|
|
||||||
- name: copy restic_backup.sh
|
- name: copy restic_backup.sh
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "restic_backup.sh"
|
src: "restic_backup.sh"
|
||||||
dest: "/usr/local/bin/restic_backup.sh"
|
dest: "/usr/local/bin/restic_backup.sh"
|
||||||
mode: a+x
|
mode: a+x
|
||||||
|
|
||||||
- name: copy exclude.txt
|
- name: copy exclude.txt
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "exclude.txt"
|
src: "exclude.txt"
|
||||||
dest: "/etc/restic/exclude.txt"
|
dest: "/etc/restic/exclude.txt"
|
||||||
|
|
||||||
- name: copy password.txt
|
- name: copy password.txt
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "password.txt"
|
src: "password.txt"
|
||||||
dest: "/etc/restic/password.txt"
|
dest: "/etc/restic/password.txt"
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
|
|
||||||
- name: create restic cronjob
|
- name: create restic cronjob
|
||||||
become: yes
|
become: yes
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: restic
|
name: restic
|
||||||
state: present
|
state: present
|
||||||
job: "/usr/local/bin/restic_backup.sh"
|
job: "/usr/local/bin/restic_backup.sh"
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
|
|
||||||
- name: Create restic log
|
- name: Create restic log
|
||||||
become: true
|
become: true
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /var/log/restic.log
|
path: /var/log/restic.log
|
||||||
state: touch
|
state: touch
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
|
|
||||||
- name: Add restic Log to be Rotated
|
- name: Add restic Log to be Rotated
|
||||||
become: true
|
become: true
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: /etc/logrotate.d/restic
|
path: /etc/logrotate.d/restic
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: yes
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: Install Required Packages
|
- name: Install Required Packages
|
||||||
become: true
|
become: true
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- ca-certificates
|
- ca-certificates
|
||||||
- apt-transport-https
|
- apt-transport-https
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
- name: Create Sanoid Directory
|
- name: Create Sanoid Directory
|
||||||
become: true
|
become: true
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
- name: Install Sanoid Dependencies Packages
|
- name: Install Sanoid Dependencies Packages
|
||||||
become: true
|
become: true
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- libconfig-inifiles-perl
|
- libconfig-inifiles-perl
|
||||||
force_apt_get: yes
|
force_apt_get: yes
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
- name: Install Sanoid Binary
|
- name: Install Sanoid Binary
|
||||||
become: true
|
become: true
|
||||||
get_url:
|
ansible.builtin.get_url:
|
||||||
url: https://raw.githubusercontent.com/jimsalterjrs/sanoid/master/sanoid
|
url: https://raw.githubusercontent.com/jimsalterjrs/sanoid/master/sanoid
|
||||||
dest: /usr/local/bin/sanoid
|
dest: /usr/local/bin/sanoid
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
- name: Install Sanoid Defaults Configuration
|
- name: Install Sanoid Defaults Configuration
|
||||||
become: true
|
become: true
|
||||||
get_url:
|
ansible.builtin.get_url:
|
||||||
url: https://raw.githubusercontent.com/jimsalterjrs/sanoid/master/sanoid.defaults.conf
|
url: https://raw.githubusercontent.com/jimsalterjrs/sanoid/master/sanoid.defaults.conf
|
||||||
dest: /etc/sanoid/sanoid.defaults.conf
|
dest: /etc/sanoid/sanoid.defaults.conf
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
|
|
||||||
- name: Generate Sanoid Configuration
|
- name: Generate Sanoid Configuration
|
||||||
become: true
|
become: true
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: sanoid.conf.j2
|
src: sanoid.conf.j2
|
||||||
dest: /etc/sanoid/sanoid.conf
|
dest: /etc/sanoid/sanoid.conf
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
|
|
||||||
- name: Create Sanoid Log
|
- name: Create Sanoid Log
|
||||||
become: true
|
become: true
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /var/log/sanoid-cron.log
|
path: /var/log/sanoid-cron.log
|
||||||
state: touch
|
state: touch
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
|
|
||||||
- name: Add Sanoid Log to be Rotated
|
- name: Add Sanoid Log to be Rotated
|
||||||
become: true
|
become: true
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: /etc/logrotate.d/sanoid
|
path: /etc/logrotate.d/sanoid
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: yes
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
|
|
||||||
- name: Generate Sanoid Cron Scripts
|
- name: Generate Sanoid Cron Scripts
|
||||||
become: true
|
become: true
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: sanoid-cron.sh
|
src: sanoid-cron.sh
|
||||||
dest: /usr/local/bin/sanoid-cron.sh
|
dest: /usr/local/bin/sanoid-cron.sh
|
||||||
owner: root
|
owner: root
|
||||||
|
@ -107,7 +107,7 @@
|
||||||
|
|
||||||
- name: Configure Sanoid Cron Job
|
- name: Configure Sanoid Cron Job
|
||||||
become: true
|
become: true
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: sanoid-cron
|
name: sanoid-cron
|
||||||
job: /usr/local/bin/sanoid-cron.sh
|
job: /usr/local/bin/sanoid-cron.sh
|
||||||
minute: "{{ sanoid_cron_minutes }}"
|
minute: "{{ sanoid_cron_minutes }}"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# deb http://{{ acng_server }}:{{ acng_server_port }}/security.ubuntu.com/ubuntu {{ansible_distribution_release}}-security multiverse
|
# deb http://{{ acng_server }}:{{ acng_server_port }}/security.ubuntu.com/ubuntu {{ansible_distribution_release}}-security multiverse
|
||||||
- name: sources.list kopieren
|
- name: sources.list kopieren
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "sources.list"
|
src: "sources.list"
|
||||||
dest: "/etc/apt/sources.list"
|
dest: "/etc/apt/sources.list"
|
||||||
backup: yes
|
backup: yes
|
||||||
|
@ -11,6 +11,6 @@
|
||||||
|
|
||||||
- name: apt_update # noqa 503 503
|
- name: apt_update # noqa 503 503
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
when: copy_src.changed
|
when: copy_src.changed
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
- name: Setze Zeitzone auf {{ base_timezone }}
|
- name: Setze Zeitzone auf {{ base_timezone }}
|
||||||
become: yes
|
become: yes
|
||||||
timezone:
|
ansible.builtin.timezone:
|
||||||
name: "{{ base_timezone }}"
|
name: "{{ base_timezone }}"
|
||||||
|
|
|
@ -1,40 +1,40 @@
|
||||||
#Blockdevice/Festplatten muessen haendisch in "templates" eingetragen werden
|
#Blockdevice/Festplatten muessen haendisch in "templates" eingetragen werden
|
||||||
- name: smartmontools installieren
|
- name: smartmontools installieren
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name: smartmontools
|
name: smartmontools
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: smartmontools kopieren
|
- name: smartmontools kopieren
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "smartmontools"
|
src: "smartmontools"
|
||||||
dest: "/etc/default/smartmontools"
|
dest: "/etc/default/smartmontools"
|
||||||
notify: smartmontools_starten_aktivieren
|
notify: smartmontools_starten_aktivieren
|
||||||
|
|
||||||
- name: smartd.conf kopieren
|
- name: smartd.conf kopieren
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "smartd.conf"
|
src: "smartd.conf"
|
||||||
dest: "/etc/smartd.conf"
|
dest: "/etc/smartd.conf"
|
||||||
notify: smartmontools_starten_aktivieren
|
notify: smartmontools_starten_aktivieren
|
||||||
|
|
||||||
- name: Ordner "smart" erstellen
|
- name: Ordner "smart" erstellen
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "/root/smart"
|
path: "/root/smart"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: smartctl_mail.sh kopieren
|
- name: smartctl_mail.sh kopieren
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "smartctl_mail.sh"
|
src: "smartctl_mail.sh"
|
||||||
dest: "/root/smart/smartctl_mail.sh"
|
dest: "/root/smart/smartctl_mail.sh"
|
||||||
mode: a+x
|
mode: a+x
|
||||||
|
|
||||||
- name: smart_status.sh kopieren
|
- name: smart_status.sh kopieren
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "smart_status.sh"
|
src: "smart_status.sh"
|
||||||
dest: "/usr/local/bin/smart_status.sh"
|
dest: "/usr/local/bin/smart_status.sh"
|
||||||
mode: a+x
|
mode: a+x
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
# smartctl output als mail
|
# smartctl output als mail
|
||||||
- name: cronjob fuer smartctl-mail
|
- name: cronjob fuer smartctl-mail
|
||||||
become: yes
|
become: yes
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: smart-mail
|
name: smart-mail
|
||||||
state: present
|
state: present
|
||||||
job: "/root/smart/smartctl_mail.sh"
|
job: "/root/smart/smartctl_mail.sh"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
- name: install tmux packages
|
- name: install tmux packages
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- tmux
|
- tmux
|
||||||
state: present
|
state: present
|
||||||
|
@ -8,20 +8,20 @@
|
||||||
|
|
||||||
# - name: ensure homedir exists
|
# - name: ensure homedir exists
|
||||||
# become: yes
|
# become: yes
|
||||||
# file:
|
# ansible.builtin.file:
|
||||||
# path: " {{ tmux_conf_destination }}"
|
# path: " {{ tmux_conf_destination }}"
|
||||||
# state: directory
|
# state: directory
|
||||||
|
|
||||||
# - name: copy .tmux.conf
|
# - name: copy .tmux.conf
|
||||||
# become: yes
|
# become: yes
|
||||||
# template:
|
# ansible.builtin.template:
|
||||||
# src: ".tmux.conf"
|
# src: ".tmux.conf"
|
||||||
# dest: "{{ tmux_conf_destination }}"
|
# dest: "{{ tmux_conf_destination }}"
|
||||||
# backup: true
|
# backup: true
|
||||||
|
|
||||||
- name: add tmux-session config to .bashrc
|
- name: add tmux-session config to .bashrc
|
||||||
become: yes
|
become: yes
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ tmux_bashrc_destination }}"
|
path: "{{ tmux_bashrc_destination }}"
|
||||||
block: |
|
block: |
|
||||||
if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
|
if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
- name: update apt cache
|
- name: update apt cache
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
cache_valid_time: 30
|
cache_valid_time: 30
|
||||||
|
|
||||||
- name: updated installed packages
|
- name: updated installed packages
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
upgrade: dist
|
upgrade: dist
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
- name: zfs-tools installieren
|
- name: zfs-tools installieren
|
||||||
become: yes
|
become: yes
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- zfsutils
|
- zfsutils
|
||||||
- zfs-initramfs
|
- zfs-initramfs
|
||||||
|
@ -9,34 +9,34 @@
|
||||||
|
|
||||||
- name: Limit ZFS Memory Usage
|
- name: Limit ZFS Memory Usage
|
||||||
become: yes
|
become: yes
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/modprobe.d/zfs.conf
|
path: /etc/modprobe.d/zfs.conf
|
||||||
line: options zfs zfs_arc_max={{ zfs_arc_max }}
|
line: options zfs zfs_arc_max={{ zfs_arc_max }}
|
||||||
create: yes
|
create: yes
|
||||||
|
|
||||||
- name: remove system scrub job #https://forum.proxmox.com/threads/script-sequential-zfs-scrub-for-cron.25124/
|
- name: remove system scrub job #https://forum.proxmox.com/threads/script-sequential-zfs-scrub-for-cron.25124/
|
||||||
become: true
|
become: true
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/cron.d/zfsutils-linux
|
path: /etc/cron.d/zfsutils-linux
|
||||||
state: absent
|
state: absent
|
||||||
line: '24 0 8-14 * * root [ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/scrub ] && /usr/lib/zfs-linux/scrub'
|
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"
|
- name: erstelle Ordner "root-zfs"
|
||||||
become: yes
|
become: yes
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: /root/zfs
|
path: /root/zfs
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: kopiere "zfs-health.sh"
|
- name: kopiere "zfs-health.sh"
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: zfs-health.sh
|
src: zfs-health.sh
|
||||||
dest: /usr/local/bin/zfs-health.sh
|
dest: /usr/local/bin/zfs-health.sh
|
||||||
mode: "+x"
|
mode: "+x"
|
||||||
|
|
||||||
- name: lege cronjob fuer "zfs-health.sh" an
|
- name: lege cronjob fuer "zfs-health.sh" an
|
||||||
become: yes
|
become: yes
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: zfs-health
|
name: zfs-health
|
||||||
state: present
|
state: present
|
||||||
job: "/usr/local/bin/zfs-health.sh"
|
job: "/usr/local/bin/zfs-health.sh"
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
- name: lege cronjob fuer "zfs-scrub" an
|
- name: lege cronjob fuer "zfs-scrub" an
|
||||||
become: yes
|
become: yes
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: zfs-scrub - "{{ item.name }}"
|
name: zfs-scrub - "{{ item.name }}"
|
||||||
state: present
|
state: present
|
||||||
job: "{{ pfad_zu_zpool }} scrub {{ item.name }}"
|
job: "{{ pfad_zu_zpool }} scrub {{ item.name }}"
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
|
|
||||||
- name: lege cronjob fuer "zfs-trim" an
|
- name: lege cronjob fuer "zfs-trim" an
|
||||||
become: yes
|
become: yes
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
name: zfs-trim - "{{ item.name }}"
|
name: zfs-trim - "{{ item.name }}"
|
||||||
state: present
|
state: present
|
||||||
job: "{{ pfad_zu_zpool }} trim {{ item.name }}"
|
job: "{{ pfad_zu_zpool }} trim {{ item.name }}"
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
|
|
||||||
- name: kopiere zed.rc
|
- name: kopiere zed.rc
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
owner: root
|
owner: root
|
||||||
mode: 0600
|
mode: 0600
|
||||||
src: zed.rc
|
src: zed.rc
|
||||||
|
@ -79,14 +79,14 @@
|
||||||
|
|
||||||
- name: copy zfs-free.sh
|
- name: copy zfs-free.sh
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
mode: 0555
|
mode: 0555
|
||||||
src: zfs-free.sh
|
src: zfs-free.sh
|
||||||
dest: /usr/local/bin/zfs-free.sh
|
dest: /usr/local/bin/zfs-free.sh
|
||||||
|
|
||||||
- name: Erlaube "non-root" Usern Read-Only ZFS Commands
|
- name: Erlaube "non-root" Usern Read-Only ZFS Commands
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: sudoers_zfs
|
src: sudoers_zfs
|
||||||
dest: /etc/sudoers.d/zfs
|
dest: /etc/sudoers.d/zfs
|
||||||
owner: root
|
owner: root
|
||||||
|
|
Loading…
Reference in a new issue