change from systemd to cron
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
5a5155d8e2
commit
e24b51e3da
@ -1,9 +0,0 @@
|
||||
[Unit]
|
||||
Description=Backup application data
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/bash /opt/backupscript.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=backup.target
|
@ -1,5 +0,0 @@
|
||||
[Unit]
|
||||
Description=Script based backup for VMs
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
@ -1,10 +0,0 @@
|
||||
[Unit]
|
||||
Description=Backup VMs
|
||||
|
||||
[Timer]
|
||||
OnBootSec=10min
|
||||
OnCalendar=Sun *-*-* 00:00:00
|
||||
Unit=backup.target
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -2,54 +2,11 @@
|
||||
- name: "Generate backupscript"
|
||||
ansible.builtin.template:
|
||||
src: backupscript.sh
|
||||
dest: /opt/backupscript.sh
|
||||
dest: /etc/cron.weekly/backupscript.sh
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0700'
|
||||
|
||||
- name: Copy backup-script.service to target
|
||||
copy:
|
||||
src: backup-script.service
|
||||
dest: /usr/lib/systemd/system/backup-script.service
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Copy backup.target to target
|
||||
copy:
|
||||
src: backup.target
|
||||
dest: /usr/lib/systemd/system/backup.target
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Copy backup.timer to target
|
||||
copy:
|
||||
src: backup.timer
|
||||
dest: /usr/lib/systemd/system/backup.timer
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Enable backup-script.service and reload systemd daemon
|
||||
when: ansible_service_mgr == "systemd"
|
||||
ansible.builtin.systemd:
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
name: backup-script.service
|
||||
|
||||
- name: Enable backup.target
|
||||
when: ansible_service_mgr == "systemd"
|
||||
ansible.builtin.systemd:
|
||||
enabled: yes
|
||||
name: backup.target
|
||||
|
||||
- name: Enable backup.timer
|
||||
when: ansible_service_mgr == "systemd"
|
||||
ansible.builtin.systemd:
|
||||
enabled: yes
|
||||
name: backup.timer
|
||||
|
||||
- name: Create .ssh directory of root user
|
||||
file:
|
||||
path: /root/.ssh
|
||||
|
@ -1,9 +0,0 @@
|
||||
[Unit]
|
||||
Description=Renew certificates with certbot
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/bash /opt/certbot.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=certbot.target
|
@ -1,5 +0,0 @@
|
||||
[Unit]
|
||||
Description=Script based certificate renewal via certbot
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
@ -1,10 +0,0 @@
|
||||
[Unit]
|
||||
Description=Periodic certificate renewal
|
||||
|
||||
[Timer]
|
||||
OnBootSec=10min
|
||||
OnCalendar=Sun *-*-* 00:00:00
|
||||
Unit=certbot.target
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -50,51 +50,11 @@
|
||||
- name: "Generate certbot script"
|
||||
ansible.builtin.template:
|
||||
src: certbot.sh
|
||||
dest: /opt/certbot.sh
|
||||
dest: /etc/cron.weekly/certbot.sh
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0700'
|
||||
|
||||
- name: Copy certbot-script.service to target
|
||||
copy:
|
||||
src: certbot-script.service
|
||||
dest: /usr/lib/systemd/system/certbot-script.service
|
||||
mode: 644
|
||||
owner: root
|
||||
|
||||
- name: Copy certbot.target to target
|
||||
copy:
|
||||
src: certbot.target
|
||||
dest: /usr/lib/systemd/system/certbot.target
|
||||
mode: 644
|
||||
owner: root
|
||||
|
||||
- name: Copy certbot.timer to target
|
||||
copy:
|
||||
src: certbot.timer
|
||||
dest: /usr/lib/systemd/system/certbot.timer
|
||||
mode: 644
|
||||
owner: root
|
||||
|
||||
- name: Enable certbot-script.service and reload systemd daemon
|
||||
when: ansible_service_mgr == "systemd"
|
||||
ansible.builtin.systemd:
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
name: certbot-script.service
|
||||
|
||||
- name: Enable certbot.target
|
||||
when: ansible_service_mgr == "systemd"
|
||||
ansible.builtin.systemd:
|
||||
enabled: yes
|
||||
name: certbot.target
|
||||
|
||||
- name: Enable certbot.timer
|
||||
when: ansible_service_mgr == "systemd"
|
||||
ansible.builtin.systemd:
|
||||
enabled: yes
|
||||
name: certbot.timer
|
||||
|
||||
- name: "Generate nginx configuration"
|
||||
ansible.builtin.template:
|
||||
src: nginx.conf
|
||||
|
Loading…
Reference in New Issue
Block a user