Fixed taging for disabled host

This commit is contained in:
ladislav.dusa
2025-04-09 12:08:02 +02:00
parent 9eb9fb6190
commit 5fd82279f1
8 changed files with 8 additions and 48 deletions

0
roles/fail2ban/files/action.d/banan.conf Normal file → Executable file
View File

0
roles/fail2ban/files/filter.d/bad-auth.conf Normal file → Executable file
View File

0
roles/fail2ban/files/filter.d/nextcloud.conf Normal file → Executable file
View File

0
roles/fail2ban/files/filter.d/sshd.conf Normal file → Executable file
View File

0
roles/fail2ban/files/jail.d/bad-auth.conf Normal file → Executable file
View File

0
roles/fail2ban/files/jail.d/nextcloud.conf Normal file → Executable file
View File

0
roles/fail2ban/files/jail.d/sshd.conf Normal file → Executable file
View File

View File

@ -27,31 +27,14 @@
- name: Upload script
ansible.builtin.copy:
src: "{{ dest_folder }}/omv_backup_v3.py"
src: "{{ dest_folder }}/omv_backup_v4.py"
dest: /myapps/omv_backup.py
remote_src: true
mode: '0755'
owner: root
group: root
when: inventory_hostname != 'nas.home.lan'
- name: Upload script
ansible.builtin.copy:
src: "{{ dest_folder }}/omv_backup_v3.py"
dest: /myapps/omv_backup.py
remote_src: true
mode: '0755'
owner: root
group: root
when: inventory_hostname != 'nas.home.lan'
- name: Upload script
ansible.builtin.copy:
src: "{{ dest_folder }}/docker_backups.py"
dest: /myapps/docker_backups.py
remote_src: true
mode: '0755'
owner: root
group: root
when: inventory_hostname != 'nas.home.lan'
- name: Upload requirements
ansible.builtin.copy:
src: "{{ dest_folder }}/requirements.txt"
@ -74,36 +57,13 @@
name: "omv_backup"
state: absent
# - name: Ensure a job that runs at 2 and 5 exists. Creates an entry like "0 5,2 * * ls -alh > /dev/null"
# ansible.builtin.cron:
# name: "omv_backup"
# minute: "0"
# hour: "8"
# job: "/myapps/venv/bin/python3 /myapps/omv_backup.py -b > /dev/null 2>&1 &"
- name: Ensure a job that runs at 2 and 5 exists. Creates an entry like "0 5,2 * * ls -alh > /dev/null"
ansible.builtin.cron:
name: "omv_backup"
minute: "0"
hour: "8"
job: "/myapps/venv/bin/python3 /myapps/omv_backup.py -b > /dev/null 2>&1 &"
- name: Creating config
ansible.builtin.copy:
dest: "/etc/systemd/system/omv_backup.service"
content: |
[Unit]
Description=Enable OMV backup
[Service]
ExecStart = nohup /myapps/venv/bin/python3 /myapps/omv_backup.py -b > /dev/null 2>&1 &
[Install]
WantedBy=basic.target
owner: root
mode: '0744'
when: inventory_hostname == 'amd.home.lan'
- name: Restart service omv_backup, in all cases
ansible.builtin.service:
name: omv_backup
state: restarted
enabled: true
# async:
# poll: 0
# ignore_errors: true
when: inventory_hostname == 'amd.home.lan'
become: true