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:
@ -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
|
||||
|
Reference in New Issue
Block a user