mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-25 22:21:04 +01:00
Compare commits
3 Commits
9f50c9e5b9
...
d8f14a9c36
Author | SHA1 | Date | |
---|---|---|---|
d8f14a9c36 | |||
b7e3a7f838 | |||
f3ce00dca7 |
@ -1,5 +1,5 @@
|
|||||||
- name: "reload backup-data-to-usb.service"
|
- name: "reload backup-data-to-usb.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: backup-data-to-usb.service
|
name: backup-data-to-usb.cymais.service
|
||||||
state: reloaded
|
state: reloaded
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
- name: Copy systemd service to systemd directory
|
- name: Copy systemd service to systemd directory
|
||||||
template:
|
template:
|
||||||
src: backup-data-to-usb.service.j2
|
src: backup-data-to-usb.service.j2
|
||||||
dest: /etc/systemd/system/backup-data-to-usb.service
|
dest: /etc/systemd/system/backup-data-to-usb.cymais.service
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
notify: reload backup-data-to-usb.service
|
notify: reload backup-data-to-usb.cymais.service
|
@ -1,11 +1,11 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Backup to USB when mounted to {{ backup_to_usb_mount }}
|
Description=Backup to USB when mounted to {{ backup_to_usb_mount }}
|
||||||
Wants={{systemctl_mount_service_name}}
|
Wants={{systemctl_mount_service_name}}
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/bin/python {{ backup_to_usb_script_path }} {{backup_to_usb_source}} {{backup_to_usb_destination}}
|
ExecStart=/bin/python {{ backup_to_usb_script_path }} {{backup_to_usb_source}} {{backup_to_usb_destination}}
|
||||||
ExecStartPost=/bin/systemctl start cleanup-backups.service
|
ExecStartPost=/bin/systemctl start cleanup-backups.cymais.service
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
@ -1,4 +1,4 @@
|
|||||||
- name: "reload backup-docker-to-local.service"
|
- name: "reload backup-docker-to-local.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: backup-docker-to-local.service
|
name: backup-docker-to-local.cymais.service
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
@ -14,18 +14,18 @@
|
|||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
when: run_once_backup_docker_to_local is not defined
|
when: run_once_backup_docker_to_local is not defined
|
||||||
|
|
||||||
- name: configure backup-docker-to-local-everything.service
|
- name: configure backup-docker-to-local-everything.cymais.service
|
||||||
template:
|
template:
|
||||||
src: backup-docker-to-local-everything.service.j2
|
src: backup-docker-to-local-everything.service.j2
|
||||||
dest: /etc/systemd/system/backup-docker-to-local-everything.service
|
dest: /etc/systemd/system/backup-docker-to-local-everything.cymais.service
|
||||||
notify: reload backup-docker-to-local-everything.service
|
notify: reload backup-docker-to-local-everything.cymais.service
|
||||||
when: run_once_backup_docker_to_local is not defined
|
when: run_once_backup_docker_to_local is not defined
|
||||||
|
|
||||||
- name: configure backup-docker-to-local.service
|
- name: configure backup-docker-to-local.cymais.service
|
||||||
template:
|
template:
|
||||||
src: backup-docker-to-local.service.j2
|
src: backup-docker-to-local.service.j2
|
||||||
dest: /etc/systemd/system/backup-docker-to-local.service
|
dest: /etc/systemd/system/backup-docker-to-local.cymais.service
|
||||||
notify: reload backup-docker-to-local.service
|
notify: reload backup-docker-to-local.cymais.service
|
||||||
when: run_once_backup_docker_to_local is not defined
|
when: run_once_backup_docker_to_local is not defined
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=backup docker volumes to local folder
|
Description=backup docker volumes to local folder
|
||||||
OnFailure=systemd-notifier@%n.service cleanup-failed-docker-backups.service
|
OnFailure=systemd-notifier.cymais@%n.service cleanup-failed-docker-backups.cymais.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=backup docker volumes to local folder
|
Description=backup docker volumes to local folder
|
||||||
OnFailure=systemd-notifier@%n.service cleanup-failed-docker-backups.service
|
OnFailure=systemd-notifier.cymais@%n.service cleanup-failed-docker-backups.cymais.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -15,12 +15,12 @@ To track what the service is doing execute one of the following commands:
|
|||||||
|
|
||||||
#### systemctl
|
#### systemctl
|
||||||
```bash
|
```bash
|
||||||
watch -n2 "systemctl status backup-remote-to-local.service"
|
watch -n2 "systemctl status backup-remote-to-local.cymais.service"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### journalctl
|
#### journalctl
|
||||||
```bash
|
```bash
|
||||||
journalctl -fu backup-remote-to-local.service
|
journalctl -fu backup-remote-to-local.cymais.service
|
||||||
```
|
```
|
||||||
|
|
||||||
### history
|
### history
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
- name: "reload backup-remote-to-local service"
|
- name: "reload backup-remote-to-local service"
|
||||||
systemd:
|
systemd:
|
||||||
name: backup-remote-to-local.service
|
name: backup-remote-to-local.cymais.service
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
|
||||||
- name: "restart backup-remote-to-local timer"
|
- name: "restart backup-remote-to-local timer"
|
||||||
systemd:
|
systemd:
|
||||||
name: backup-remote-to-local.timer
|
name: backup-remote-to-local.cymais.timer
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@ -10,8 +10,10 @@
|
|||||||
dest: "{{docker_backup_remote_to_local_folder}}backup-remote-to-local.sh"
|
dest: "{{docker_backup_remote_to_local_folder}}backup-remote-to-local.sh"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: create backup-remote-to-local.service
|
- name: create backup-remote-to-local.cymais.service
|
||||||
template: src=backup-remote-to-local.service.j2 dest=/etc/systemd/system/backup-remote-to-local.service
|
template:
|
||||||
|
src: backup-remote-to-local.service.j2
|
||||||
|
dest: /etc/systemd/system/backup-remote-to-local.cymais.service
|
||||||
notify: reload backup-remote-to-local service
|
notify: reload backup-remote-to-local service
|
||||||
|
|
||||||
- name: create backups-remote-to-local.sh
|
- name: create backups-remote-to-local.sh
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=pull remote backups
|
Description=pull remote backups
|
||||||
OnFailure=systemd-notifier@%n.service cleanup-failed-docker-backups.service
|
OnFailure=systemd-notifier.cymais@%n.service cleanup-failed-docker-backups.cymais.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
- name: "reload cleanup-backups.service"
|
- name: "reload cleanup-backups.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: cleanup-backups.service
|
name: cleanup-backups.cymais.service
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@ -19,11 +19,11 @@
|
|||||||
dest: "{{docker_cleanup_backups}}cleanup-backups.py"
|
dest: "{{docker_cleanup_backups}}cleanup-backups.py"
|
||||||
when: run_once_cleanup_backups_service is not defined
|
when: run_once_cleanup_backups_service is not defined
|
||||||
|
|
||||||
- name: create cleanup-backups.service
|
- name: create cleanup-backups.cymais.service
|
||||||
template:
|
template:
|
||||||
src: "cleanup-backups.service.j2"
|
src: "cleanup-backups.service.j2"
|
||||||
dest: "/etc/systemd/system/cleanup-backups.service"
|
dest: "/etc/systemd/system/cleanup-backups.cymais.service"
|
||||||
notify: reload cleanup-backups.service
|
notify: reload cleanup-backups.cymais.service
|
||||||
when: run_once_cleanup_backups_service is not defined
|
when: run_once_cleanup_backups_service is not defined
|
||||||
|
|
||||||
- name: run the cleanup_backups_service tasks once
|
- name: run the cleanup_backups_service tasks once
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=delete old backups
|
Description=delete old backups
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
- name: "reload cleanup-disc-space.service"
|
- name: "reload cleanup-disc-space.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: cleanup-disc-space.service
|
name: cleanup-disc-space.cymais.service
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@ -9,11 +9,11 @@
|
|||||||
src: cleanup-disc-space.sh.j2
|
src: cleanup-disc-space.sh.j2
|
||||||
dest: "{{cleanup_disc_space_folder}}cleanup-disc-space.sh"
|
dest: "{{cleanup_disc_space_folder}}cleanup-disc-space.sh"
|
||||||
|
|
||||||
- name: create cleanup-disc-space.service
|
- name: create cleanup-disc-space.cymais.service
|
||||||
template:
|
template:
|
||||||
src: cleanup-disc-space.service.j2
|
src: cleanup-disc-space.service.j2
|
||||||
dest: /etc/systemd/system/cleanup-disc-space.service
|
dest: /etc/systemd/system/cleanup-disc-space.cymais.service
|
||||||
notify: reload cleanup-disc-space.service
|
notify: reload cleanup-disc-space.cymais.service
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=freeing disc space
|
Description=freeing disc space
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
- name: "reload cleanup-failed-docker-backups.service daemon"
|
- name: "reload cleanup-failed-docker-backups.cymais.service daemon"
|
||||||
systemd:
|
systemd:
|
||||||
name: cleanup-failed-docker-backups.service
|
name: cleanup-failed-docker-backups.cymais.service
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
@ -6,11 +6,11 @@
|
|||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
when: run_once_cleanup_failed_docker_backups is not defined
|
when: run_once_cleanup_failed_docker_backups is not defined
|
||||||
|
|
||||||
- name: configure cleanup-failed-docker-backups.service
|
- name: configure cleanup-failed-docker-backups.cymais.service
|
||||||
template:
|
template:
|
||||||
src: cleanup-failed-docker-backups.service.j2
|
src: cleanup-failed-docker-backups.service.j2
|
||||||
dest: /etc/systemd/system/cleanup-failed-docker-backups.service
|
dest: /etc/systemd/system/cleanup-failed-docker-backups.cymais.service
|
||||||
notify: reload cleanup-failed-docker-backups.service daemon
|
notify: reload cleanup-failed-docker-backups.cymais.service daemon
|
||||||
when: run_once_cleanup_failed_docker_backups is not defined
|
when: run_once_cleanup_failed_docker_backups is not defined
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Cleaning up failed docker volume backups
|
Description=Cleaning up failed docker volume backups
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=set MTU
|
Description=set MTU
|
||||||
Before=wg-quick@wg0.service
|
Before=wg-quick@wg0.cymais.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=bash /usr/local/bin/set-mtu.sh
|
ExecStart=bash /usr/local/bin/set-mtu.sh
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
RequiredBy=wg-quick@wg0.service
|
RequiredBy=wg-quick@wg0.cymais.service
|
@ -1,6 +1,6 @@
|
|||||||
- name: "restart set-mtu.service"
|
- name: "restart set-mtu.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: set-mtu.service
|
name: set-mtu.cymais.service
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
@ -1,11 +1,11 @@
|
|||||||
- name: create set-mtu.service
|
- name: create set-mtu.cymais.service
|
||||||
copy:
|
copy:
|
||||||
src: set-mtu.service
|
src: set-mtu.service
|
||||||
dest: /etc/systemd/system/set-mtu.service
|
dest: /etc/systemd/system/set-mtu.cymais.service
|
||||||
notify: restart set-mtu.service
|
notify: restart set-mtu.cymais.service
|
||||||
|
|
||||||
- name: create set-mtu.sh
|
- name: create set-mtu.sh
|
||||||
template:
|
template:
|
||||||
src: set-mtu.sh.j2
|
src: set-mtu.sh.j2
|
||||||
dest: /usr/local/bin/set-mtu.sh
|
dest: /usr/local/bin/set-mtu.sh
|
||||||
notify: restart set-mtu.service
|
notify: restart set-mtu.cymais.service
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: "restart deploy-letsencrypt-mailu.service"
|
- name: "restart deploy-letsencrypt-mailu.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: deploy-letsencrypt-mailu.service
|
name: deploy-letsencrypt-mailu.cymais.service
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
@ -48,11 +48,11 @@
|
|||||||
src: "deploy-letsencrypt-mailu.sh.j2"
|
src: "deploy-letsencrypt-mailu.sh.j2"
|
||||||
dest: "{{path_administrator_scripts}}mailu/deploy-letsencrypt-mailu.sh"
|
dest: "{{path_administrator_scripts}}mailu/deploy-letsencrypt-mailu.sh"
|
||||||
|
|
||||||
- name: configure deploy-letsencrypt-mailu.service
|
- name: configure deploy-letsencrypt-mailu.cymais.service
|
||||||
template:
|
template:
|
||||||
src: "deploy-letsencrypt-mailu.service.j2"
|
src: "deploy-letsencrypt-mailu.service.j2"
|
||||||
dest: "/etc/systemd/system/deploy-letsencrypt-mailu.service"
|
dest: "/etc/systemd/system/deploy-letsencrypt-mailu.cymais.service"
|
||||||
notify: restart deploy-letsencrypt-mailu.service
|
notify: restart deploy-letsencrypt-mailu.cymais.service
|
||||||
|
|
||||||
- name: "include role for systemd-timer for {{service_name}}"
|
- name: "include role for systemd-timer for {{service_name}}"
|
||||||
include_role:
|
include_role:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Let's Encrypt Mailu Deploy
|
Description=Let's Encrypt Mailu Deploy
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
---
|
---
|
||||||
- name: Copy keyboard-color.timer file
|
- name: Copy keyboard-color.cymais.timer file
|
||||||
template:
|
template:
|
||||||
src: keyboard-color.timer.j2
|
src: keyboard-color.timer.j2
|
||||||
dest: /etc/systemd/system/keyboard-color.timer
|
dest: /etc/systemd/system/keyboard-color.cymais.timer
|
||||||
mode: 0644
|
mode: 0644
|
||||||
tags:
|
tags:
|
||||||
- keyboard-color
|
- keyboard-color
|
||||||
|
|
||||||
- name: Copy keyboard-color.service file
|
- name: Copy keyboard-color.cymais.service file
|
||||||
template:
|
template:
|
||||||
src: keyboard-color.service.j2
|
src: keyboard-color.service.j2
|
||||||
dest: /etc/systemd/system/keyboard-color.service
|
dest: /etc/systemd/system/keyboard-color.cymais.service
|
||||||
mode: 0644
|
mode: 0644
|
||||||
tags:
|
tags:
|
||||||
- keyboard-color
|
- keyboard-color
|
||||||
@ -21,9 +21,9 @@
|
|||||||
tags:
|
tags:
|
||||||
- keyboard-color
|
- keyboard-color
|
||||||
|
|
||||||
- name: Enable and start keyboard-color.timer
|
- name: Enable and start keyboard-color.cymais.timer
|
||||||
systemd:
|
systemd:
|
||||||
name: keyboard-color.timer
|
name: keyboard-color.cymais.timer
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: yes
|
enabled: yes
|
||||||
tags:
|
tags:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Keyboard Color Service
|
Description=Keyboard Color Service
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -40,8 +40,8 @@ waiting_time=600
|
|||||||
blocker_running=True
|
blocker_running=True
|
||||||
while blocker_running:
|
while blocker_running:
|
||||||
try:
|
try:
|
||||||
bash("systemctl is-active --quiet backup-docker-to-local.service")
|
bash("systemctl is-active --quiet backup-docker-to-local.cymais.service")
|
||||||
bash("systemctl is-active --quiet update-docker.service")
|
bash("systemctl is-active --quiet update-docker.cymais.service")
|
||||||
print("backup is running.")
|
print("backup is running.")
|
||||||
print("trying again in " + str(waiting_time) + " seconds.")
|
print("trying again in " + str(waiting_time) + " seconds.")
|
||||||
time.sleep(waiting_time)
|
time.sleep(waiting_time)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
- name: "reload heal-docker.service"
|
- name: "reload heal-docker.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: heal-docker.service
|
name: heal-docker.cymais.service
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
dest: "{{heal_docker}}heal-docker.py"
|
dest: "{{heal_docker}}heal-docker.py"
|
||||||
when: run_once_heal_docker is not defined
|
when: run_once_heal_docker is not defined
|
||||||
|
|
||||||
- name: create heal-docker.service
|
- name: create heal-docker.cymais.service
|
||||||
template:
|
template:
|
||||||
src: heal-docker.service.j2
|
src: heal-docker.service.j2
|
||||||
dest: /etc/systemd/system/heal-docker.service
|
dest: /etc/systemd/system/heal-docker.cymais.service
|
||||||
notify: reload heal-docker.service
|
notify: reload heal-docker.cymais.service
|
||||||
when: run_once_heal_docker is not defined
|
when: run_once_heal_docker is not defined
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=restart unhealthy docker containers
|
Description=restart unhealthy docker containers
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
- name: "reload health-btrfs.service"
|
- name: "reload health-btrfs.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: health-btrfs.service
|
name: health-btrfs.cymais.service
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
@ -9,11 +9,11 @@
|
|||||||
src: health-btrfs.sh
|
src: health-btrfs.sh
|
||||||
dest: "{{docker_health_btrfs_folder}}health-btrfs.sh"
|
dest: "{{docker_health_btrfs_folder}}health-btrfs.sh"
|
||||||
|
|
||||||
- name: create health-btrfs.service
|
- name: create health-btrfs.cymais.service
|
||||||
template:
|
template:
|
||||||
src: health-btrfs.service.j2
|
src: health-btrfs.service.j2
|
||||||
dest: /etc/systemd/system/health-btrfs.service
|
dest: /etc/systemd/system/health-btrfs.cymais.service
|
||||||
notify: reload health-btrfs.service
|
notify: reload health-btrfs.cymais.service
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Check btrfs status
|
Description=Check btrfs status
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
- name: "reload health-disc-space.service"
|
- name: "reload health-disc-space.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: health-disc-space.service
|
name: health-disc-space.cymais.service
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@ -9,11 +9,11 @@
|
|||||||
src: health-disc-space.sh
|
src: health-disc-space.sh
|
||||||
dest: "{{health_disc_space_folder}}health-disc-space.sh"
|
dest: "{{health_disc_space_folder}}health-disc-space.sh"
|
||||||
|
|
||||||
- name: create health-disc-space.service
|
- name: create health-disc-space.cymais.service
|
||||||
template:
|
template:
|
||||||
src: health-disc-space.service.j2
|
src: health-disc-space.service.j2
|
||||||
dest: /etc/systemd/system/health-disc-space.service
|
dest: /etc/systemd/system/health-disc-space.cymais.service
|
||||||
notify: reload health-disc-space.service
|
notify: reload health-disc-space.cymais.service
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=checking disc space
|
Description=checking disc space
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -10,8 +10,8 @@ This Ansible role is designed to ensure the health of Docker containers running
|
|||||||
- `handlers/main.yml`: Handlers to reload and restart the systemd service and timer.
|
- `handlers/main.yml`: Handlers to reload and restart the systemd service and timer.
|
||||||
- `files/health-docker-container.sh`: The script that checks the container health.
|
- `files/health-docker-container.sh`: The script that checks the container health.
|
||||||
- `tasks/main.yml`: Tasks to create necessary directories, copy scripts, and create systemd service and timer.
|
- `tasks/main.yml`: Tasks to create necessary directories, copy scripts, and create systemd service and timer.
|
||||||
- `templates/health-docker-container.service.j2`: Systemd service template.
|
- `templates/health-docker-container.cymais.service.j2`: Systemd service template.
|
||||||
- `templates/health-docker-container.timer.j2`: Systemd timer template.
|
- `templates/health-docker-container.cymais.timer.j2`: Systemd timer template.
|
||||||
- `meta/main.yml`: Meta information declaring dependencies for the role.
|
- `meta/main.yml`: Meta information declaring dependencies for the role.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
- name: "reload health-docker-container.service"
|
- name: "reload health-docker-container.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: health-docker-container.service
|
name: health-docker-container.cymais.service
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@ -11,9 +11,11 @@
|
|||||||
dest: "{{health_docker_container_folder}}health-docker-container.sh"
|
dest: "{{health_docker_container_folder}}health-docker-container.sh"
|
||||||
when: run_once_health_docker_container is not defined
|
when: run_once_health_docker_container is not defined
|
||||||
|
|
||||||
- name: create health-docker-container.service
|
- name: create health-docker-container.cymais.service
|
||||||
template: src=health-docker-container.service.j2 dest=/etc/systemd/system/health-docker-container.service
|
template:
|
||||||
notify: reload health-docker-container.service
|
src: health-docker-container.service.j2
|
||||||
|
dest: /etc/systemd/system/health-docker-container.cymais.service
|
||||||
|
notify: reload health-docker-container.cymais.service
|
||||||
when: run_once_health_docker_container is not defined
|
when: run_once_health_docker_container is not defined
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Checking docker health
|
Description=Checking docker health
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -10,8 +10,8 @@ This role checks for anonymous Docker volumes that are not bound to a container
|
|||||||
- `handlers/main.yml`: Handlers to reload and restart the systemd service and timer.
|
- `handlers/main.yml`: Handlers to reload and restart the systemd service and timer.
|
||||||
- `files/health-docker-volumes.sh`: The script that checks for anonymous Docker volumes and excludes whitelisted volumes.
|
- `files/health-docker-volumes.sh`: The script that checks for anonymous Docker volumes and excludes whitelisted volumes.
|
||||||
- `tasks/main.yml`: Tasks to create necessary directories, copy scripts, and create systemd service and timer.
|
- `tasks/main.yml`: Tasks to create necessary directories, copy scripts, and create systemd service and timer.
|
||||||
- `templates/health-docker-volumes.service.j2`: Systemd service template, including the whitelisted volumes as a parameter.
|
- `templates/health-docker-volumes.cymais.service.j2`: Systemd service template, including the whitelisted volumes as a parameter.
|
||||||
- `templates/health-docker-volumes.timer.j2`: Systemd timer template.
|
- `templates/health-docker-volumes.cymais.timer.j2`: Systemd timer template.
|
||||||
- `meta/main.yml`: Meta information declaring dependencies for the role.
|
- `meta/main.yml`: Meta information declaring dependencies for the role.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
- name: "reload health-docker-volumes.service"
|
- name: "reload health-docker-volumes.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: health-docker-volumes.service
|
name: health-docker-volumes.cymais.service
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@ -11,9 +11,11 @@
|
|||||||
dest: "{{health_docker_volumes_folder}}health-docker-volumes.sh"
|
dest: "{{health_docker_volumes_folder}}health-docker-volumes.sh"
|
||||||
when: run_once_health_docker_volumes is not defined
|
when: run_once_health_docker_volumes is not defined
|
||||||
|
|
||||||
- name: create health-docker-volumes.service
|
- name: create health-docker-volumes.cymais.service
|
||||||
template: src=health-docker-volumes.service.j2 dest=/etc/systemd/system/health-docker-volumes.service
|
template:
|
||||||
notify: reload health-docker-volumes.service
|
src: health-docker-volumes.service.j2
|
||||||
|
dest: /etc/systemd/system/health-docker-volumes.cymais.service
|
||||||
|
notify: reload health-docker-volumes.cymais.service
|
||||||
when: run_once_health_docker_volumes is not defined
|
when: run_once_health_docker_volumes is not defined
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Checking docker health
|
Description=Checking docker health
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
- name: "reload health-journalctl.service"
|
- name: "reload health-journalctl.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: health-journalctl.service
|
name: health-journalctl.cymais.service
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
dest: "{{health_journalctl_folder}}health-journalctl.sh"
|
dest: "{{health_journalctl_folder}}health-journalctl.sh"
|
||||||
when: run_once_health_journalctl is not defined
|
when: run_once_health_journalctl is not defined
|
||||||
|
|
||||||
- name: create health-journalctl.service
|
- name: create health-journalctl.cymais.service
|
||||||
template:
|
template:
|
||||||
src: health-journalctl.service.j2
|
src: health-journalctl.service.j2
|
||||||
dest: /etc/systemd/system/health-journalctl.service
|
dest: /etc/systemd/system/health-journalctl.cymais.service
|
||||||
notify: reload health-journalctl.service
|
notify: reload health-journalctl.cymais.service
|
||||||
when: run_once_health_journalctl is not defined
|
when: run_once_health_journalctl is not defined
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=checking journalctl health
|
Description=checking journalctl health
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -26,12 +26,12 @@ This role depends on:
|
|||||||
## Usage
|
## Usage
|
||||||
1. **Installation of Python Modules**: The role installs the required Python `requests` module.
|
1. **Installation of Python Modules**: The role installs the required Python `requests` module.
|
||||||
2. **File and Directory Management**: It creates the necessary directories and files, including the `health-nginx.py` script.
|
2. **File and Directory Management**: It creates the necessary directories and files, including the `health-nginx.py` script.
|
||||||
3. **Service and Timer Templates**: Templates for `health-nginx.service` and `health-nginx.timer` are set up to automate the health checks.
|
3. **Service and Timer Templates**: Templates for `health-nginx.cymais.service` and `health-nginx.cymais.timer` are set up to automate the health checks.
|
||||||
4. **Running the Health Check**: The `health-nginx.py` script is executed to perform the health check. It iterates over nginx configuration files and sends a HEAD request to each domain/subdomain to verify its status. The script considers different expected status codes based on the domain or subdomain.
|
4. **Running the Health Check**: The `health-nginx.py` script is executed to perform the health check. It iterates over nginx configuration files and sends a HEAD request to each domain/subdomain to verify its status. The script considers different expected status codes based on the domain or subdomain.
|
||||||
|
|
||||||
## Handler Details
|
## Handler Details
|
||||||
- **reload health-nginx.service**: Reloads the `health-nginx.service` if there are any changes to the service file.
|
- **reload health-nginx.cymais.service**: Reloads the `health-nginx.cymais.service` if there are any changes to the service file.
|
||||||
- **restart health-nginx.timer**: Restarts and enables the `health-nginx.timer` to schedule regular health checks.
|
- **restart health-nginx.cymais.timer**: Restarts and enables the `health-nginx.cymais.timer` to schedule regular health checks.
|
||||||
|
|
||||||
## Additional Information
|
## Additional Information
|
||||||
- For more details on nginx configurations, visit [nginx documentation](https://nginx.org/en/docs/).
|
- For more details on nginx configurations, visit [nginx documentation](https://nginx.org/en/docs/).
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
- name: "reload health-nginx.service"
|
- name: "reload health-nginx.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: health-nginx.service
|
name: health-nginx.cymais.service
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@ -17,11 +17,11 @@
|
|||||||
dest: "{{ health_nginx_folder }}health-nginx.py"
|
dest: "{{ health_nginx_folder }}health-nginx.py"
|
||||||
when: run_once_health_nginx is not defined
|
when: run_once_health_nginx is not defined
|
||||||
|
|
||||||
- name: create health-nginx.service
|
- name: create health-nginx.cymais.service
|
||||||
template:
|
template:
|
||||||
src: health-nginx.service.j2
|
src: health-nginx.service.j2
|
||||||
dest: /etc/systemd/system/health-nginx.service
|
dest: /etc/systemd/system/health-nginx.cymais.service
|
||||||
notify: reload health-nginx.service
|
notify: reload health-nginx.cymais.service
|
||||||
when: run_once_health_nginx is not defined
|
when: run_once_health_nginx is not defined
|
||||||
|
|
||||||
- name: set service_name to the name of the current role
|
- name: set service_name to the name of the current role
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Check nginx configuration status
|
Description=Check nginx configuration status
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
- name: "reload certbot service"
|
- name: "reload certbot service"
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx-certbot.service
|
name: nginx-certbot.cymais.service
|
||||||
state: reloaded
|
state: reloaded
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
state: present
|
state: present
|
||||||
when: run_once_nginx_certbot is not defined
|
when: run_once_nginx_certbot is not defined
|
||||||
|
|
||||||
- name: configure nginx-certbot.service
|
- name: configure nginx-certbot.cymais.service
|
||||||
template:
|
template:
|
||||||
src: nginx-certbot.service.j2
|
src: nginx-certbot.service.j2
|
||||||
dest: /etc/systemd/system/nginx-certbot.service
|
dest: /etc/systemd/system/nginx-certbot.cymais.service
|
||||||
notify: reload certbot service
|
notify: reload certbot service
|
||||||
when: run_once_nginx_certbot is not defined
|
when: run_once_nginx_certbot is not defined
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Let's Encrypt renewal
|
Description=Let's Encrypt renewal
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -59,15 +59,15 @@ def has_container_with_database(containers):
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# Argument parser setup
|
# Argument parser setup
|
||||||
parser = argparse.ArgumentParser(description='Migrate Docker volumes to SSD or HDD based on container image.')
|
parser = argparse.ArgumentParser(description='Migrate Docker volumes to SSD or HDD based on container image.')
|
||||||
parser.add_argument('--ssd_path', type=str, required=True, help='Path to the SSD storage')
|
parser.add_argument('--rapid-storage-path', type=str, required=True, help='Path to the SSD storage')
|
||||||
parser.add_argument('--hdd_path', type=str, required=True, help='Path to the HDD storage')
|
parser.add_argument('--mass-storage-path', type=str, required=True, help='Path to the HDD storage')
|
||||||
|
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Set paths from arguments
|
# Set paths from arguments
|
||||||
ssd_path = args.ssd_path
|
rapid_storage_path = args.rapid_storage_path
|
||||||
hdd_path = args.hdd_path
|
mass_storage_path = args.mass_storage_path
|
||||||
|
|
||||||
# List all Docker volumes
|
# List all Docker volumes
|
||||||
volumes = run_command("docker volume ls -q").splitlines()
|
volumes = run_command("docker volume ls -q").splitlines()
|
||||||
@ -79,10 +79,10 @@ if __name__ == "__main__":
|
|||||||
print(f"Skipped Volume {volume}. The storage path {volume_path} is a symbolic link.")
|
print(f"Skipped Volume {volume}. The storage path {volume_path} is a symbolic link.")
|
||||||
elif has_container_with_database(containers):
|
elif has_container_with_database(containers):
|
||||||
print(f"Safing volume {volume} on SSD.")
|
print(f"Safing volume {volume} on SSD.")
|
||||||
pause_and_move(ssd_path, volume, volume_path, containers)
|
pause_and_move(rapid_storage_path, volume, volume_path, containers)
|
||||||
else:
|
else:
|
||||||
print(f"Safing volume {volume} on HDD.")
|
print(f"Safing volume {volume} on HDD.")
|
||||||
pause_and_move(hdd_path, volume, volume_path, containers)
|
pause_and_move(mass_storage_path, volume, volume_path, containers)
|
||||||
|
|
||||||
print("Operation completed.")
|
print("Operation completed.")
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
- name: "restart systemd-notifier-email service"
|
- name: "restart systemd-notifier-email service"
|
||||||
systemd:
|
systemd:
|
||||||
name: systemd-notifier-email.service
|
name: systemd-notifier-email.cymais.service
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
when: run_once_systemd_notifier_email is not defined
|
when: run_once_systemd_notifier_email is not defined
|
||||||
|
|
||||||
- name: configure msmtprc.conf.j2
|
- name: configure msmtprc.conf.j2
|
||||||
template: src=msmtprc.conf.j2 dest=/root/.msmtprc
|
template:
|
||||||
|
src: "msmtprc.conf.j2"
|
||||||
|
dest: "/root/.msmtprc"
|
||||||
when: run_once_systemd_notifier_email is not defined
|
when: run_once_systemd_notifier_email is not defined
|
||||||
|
|
||||||
- name: "create {{systemd_notifier_email_folder}}"
|
- name: "create {{systemd_notifier_email_folder}}"
|
||||||
@ -14,11 +16,15 @@
|
|||||||
when: run_once_systemd_notifier_email is not defined
|
when: run_once_systemd_notifier_email is not defined
|
||||||
|
|
||||||
- name: configure systemd-notifier-email.sh
|
- name: configure systemd-notifier-email.sh
|
||||||
template: src=systemd-notifier-email.sh.j2 dest={{systemd_notifier_email_folder}}systemd-notifier-email.sh
|
template:
|
||||||
|
src: systemd-notifier-email.sh.j2
|
||||||
|
dest: "{{systemd_notifier_email_folder}}systemd-notifier-email.sh"
|
||||||
when: run_once_systemd_notifier_email is not defined
|
when: run_once_systemd_notifier_email is not defined
|
||||||
|
|
||||||
- name: configure systemd-notifier-email.service
|
- name: configure systemd-notifier-email.cymais.service
|
||||||
template: src=systemd-notifier-email@.service.j2 dest=/etc/systemd/system/systemd-notifier-email@.service
|
template:
|
||||||
|
src: systemd-notifier-email@.service.j2
|
||||||
|
dest: /etc/systemd/system/systemd-notifier-email.cymais@.service
|
||||||
notify: restart systemd-notifier-email service
|
notify: restart systemd-notifier-email service
|
||||||
when: run_once_systemd_notifier_email is not defined
|
when: run_once_systemd_notifier_email is not defined
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
- name: "restart systemd-notifier-telegram service"
|
- name: "restart systemd-notifier-telegram service"
|
||||||
systemd:
|
systemd:
|
||||||
name: systemd-notifier-telegram.service
|
name: systemd-notifier-telegram.cymais.service
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
dest: "{{ systemd_telegram_script }}"
|
dest: "{{ systemd_telegram_script }}"
|
||||||
when: run_once_systemd_notifier_telegram is not defined
|
when: run_once_systemd_notifier_telegram is not defined
|
||||||
|
|
||||||
- name: configure systemd-notifier-telegram.service
|
- name: configure systemd-notifier-telegram.cymais.service
|
||||||
template:
|
template:
|
||||||
src: systemd-notifier-telegram@.service.j2
|
src: systemd-notifier-telegram@.service.j2
|
||||||
dest: "/etc/systemd/system/systemd-notifier-telegram@.service"
|
dest: "/etc/systemd/system/systemd-notifier-telegram.cymais@.service"
|
||||||
notify: "restart systemd-notifier-telegram service"
|
notify: "restart systemd-notifier-telegram service"
|
||||||
when: run_once_systemd_notifier_telegram is not defined
|
when: run_once_systemd_notifier_telegram is not defined
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
- name: "restart systemd-notifier service"
|
- name: "restart systemd-notifier service"
|
||||||
systemd:
|
systemd:
|
||||||
name: systemd-notifier.service
|
name: systemd-notifier.cymais.service
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
when: run_once_systemd_notifier_service is not defined
|
when: run_once_systemd_notifier_service is not defined
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
- name: configure systemd-notifier@.service
|
- name: configure systemd-notifier.cymais@.service
|
||||||
template:
|
template:
|
||||||
src: systemd-notifier@.service.j2
|
src: systemd-notifier@.service.j2
|
||||||
dest: "/etc/systemd/system/systemd-notifier@.service"
|
dest: "/etc/systemd/system/systemd-notifier.cymais@.service"
|
||||||
notify: "restart systemd-notifier service"
|
notify: "restart systemd-notifier service"
|
||||||
when: run_once_systemd_notifier_service is not defined
|
when: run_once_systemd_notifier_service is not defined
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@ Description=Notifier for %i
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/bin/systemctl start systemd-notifier-telegram@%i.service systemd-notifier-email@%i.service
|
ExecStart=/usr/bin/systemctl start systemd-notifier-telegram.cymais@%i.service systemd-notifier-email.cymais@%i.service
|
||||||
User=root
|
User=root
|
||||||
Group=systemd-journal
|
Group=systemd-journal
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
- name: "restart timer"
|
- name: "restart timer"
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{service_name}}.timer"
|
name: "{{service_name}}.cymais.timer"
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
@ -1,7 +1,7 @@
|
|||||||
- name: create {{service_name}}.timer
|
- name: create {{service_name}}.cymais.timer
|
||||||
template:
|
template:
|
||||||
src: dummy.timer.j2
|
src: dummy.timer.j2
|
||||||
dest: "/etc/systemd/system/{{service_name}}.timer"
|
dest: "/etc/systemd/system/{{service_name}}.cymais.timer"
|
||||||
register: dummy_timer
|
register: dummy_timer
|
||||||
changed_when: dummy_timer.changed or activate_all_timers | bool
|
changed_when: dummy_timer.changed or activate_all_timers | bool
|
||||||
notify: restart timer
|
notify: restart timer
|
@ -1,5 +1,5 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Timer to start {{service_name}}.service
|
Description=Timer to start {{service_name}}.cymais.service
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar={{on_calendar}}
|
OnCalendar={{on_calendar}}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
- name: "start backup-docker-to-local-everything.service"
|
- name: "start backup-docker-to-local-everything.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: backup-docker-to-local-everything.service
|
name: backup-docker-to-local-everything.cymais.service
|
||||||
state: started
|
state: started
|
||||||
when: mode_backup | bool
|
when: mode_backup | bool
|
||||||
|
|
||||||
@ -9,14 +9,14 @@
|
|||||||
src: update-docker.py
|
src: update-docker.py
|
||||||
dest: "{{update_docker_script}}"
|
dest: "{{update_docker_script}}"
|
||||||
|
|
||||||
- name: configure update-docker.service
|
- name: configure update-docker.cymais.service
|
||||||
template:
|
template:
|
||||||
src: update-docker.service.j2
|
src: update-docker.service.j2
|
||||||
dest: /etc/systemd/system/update-docker.service
|
dest: /etc/systemd/system/update-docker.cymais.service
|
||||||
|
|
||||||
- name: "reload update-docker.service"
|
- name: "reload update-docker.cymais.service"
|
||||||
systemd:
|
systemd:
|
||||||
name: update-docker.service
|
name: update-docker.cymais.service
|
||||||
state: reloaded
|
state: reloaded
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Updates Docker Instances
|
Description=Updates Docker Instances
|
||||||
OnFailure=systemd-notifier@%n.service
|
OnFailure=systemd-notifier.cymais@%n.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -19,12 +19,12 @@ Manages wireguard on host.
|
|||||||
### Activate Configuration
|
### Activate Configuration
|
||||||
```bash
|
```bash
|
||||||
cp /path/to/wg0.conf /etc/wireguard/wg0.conf
|
cp /path/to/wg0.conf /etc/wireguard/wg0.conf
|
||||||
systemctl enable wg-quick@wg0.service --now
|
systemctl enable wg-quick@wg0.cymais.service --now
|
||||||
```
|
```
|
||||||
|
|
||||||
### Check status
|
### Check status
|
||||||
```bash
|
```bash
|
||||||
systemctl status wg-quick@wg0.service
|
systemctl status wg-quick@wg0.cymais.service
|
||||||
```
|
```
|
||||||
|
|
||||||
## See
|
## See
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
- name: "restart wireguard"
|
- name: "restart wireguard"
|
||||||
systemd:
|
systemd:
|
||||||
name: wg-quick@wg0.service
|
name: wg-quick.cymais@wg0.service
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
Loading…
Reference in New Issue
Block a user