mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-26 14:41:04 +01:00
Solved multiple bugs
This commit is contained in:
parent
1276415dd0
commit
9b09e5711b
@ -1,7 +1,14 @@
|
|||||||
# role native-pull-remote-backups
|
# role native-pull-remote-backups
|
||||||
|
|
||||||
|
## debug
|
||||||
|
### live
|
||||||
To track what the service is doing execute the following command:
|
To track what the service is doing execute the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
watch -n2 "systemctl status pull-remote-backups.service"
|
watch -n2 "systemctl status pull-remote-backups.service"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### history
|
||||||
|
```bash
|
||||||
|
sudo journalctl -u pull-remote-backups
|
||||||
|
```
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=pull remote backups
|
Description=pull remote backups
|
||||||
|
OnFailure=systemd-email@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/bin/bash /usr/local/bin/pull-remote-backups.sh
|
ExecStart=/usr/bin/bash /usr/local/bin/pull-remote-backups.sh
|
||||||
OnFailure=systemd-email@%n.service
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
hosts="{{pull_remote_backups_hosts}}";
|
hosts="{{pull_remote_backups_hosts}}";
|
||||||
|
errors=0
|
||||||
for host in $hosts; do
|
for host in $hosts; do
|
||||||
bash /usr/local/bin/pull-remote-backup/pull-remote-backup.sh $host;
|
bash /usr/local/bin/pull-remote-backup/pull-remote-backup.sh $host || ((errors+=1));
|
||||||
done;
|
done;
|
||||||
|
exit $errors;
|
||||||
|
4
roles/native-systemd-email/handlers/main.yml
Normal file
4
roles/native-systemd-email/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
- name: "restart systemd-email service"
|
||||||
|
systemd:
|
||||||
|
name: systemd-email.service
|
||||||
|
daemon_reload: yes
|
@ -8,4 +8,5 @@
|
|||||||
template: src=systemd-email.sh.j2 dest=/usr/local/bin/systemd-email.sh
|
template: src=systemd-email.sh.j2 dest=/usr/local/bin/systemd-email.sh
|
||||||
|
|
||||||
- name: configure systemd-email.service
|
- name: configure systemd-email.service
|
||||||
template: src=systemd-email.service.j2 dest=/etc/systemd/system/systemd-email.service
|
template: src=systemd-email@.service.j2 dest=/etc/systemd/system/systemd-email@.service
|
||||||
|
notify: restart systemd-email service
|
||||||
|
@ -3,6 +3,6 @@ Description=status email for %i to user
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/local/bin/systemd-email.sh %i
|
ExecStart=/bin/bash /usr/local/bin/systemd-email.sh %i
|
||||||
User=nobody
|
User=root
|
||||||
Group=systemd-journal
|
Group=systemd-journal
|
Loading…
Reference in New Issue
Block a user