add service file

This commit is contained in:
tolerryan
2024-10-27 01:36:30 -05:00
parent 7fc08ac0a2
commit 9fbedc9e5b

View File

@@ -74,9 +74,26 @@
state: present
update_cache: yes
- name: setup service
- name: start server, should be afte restore below
- name:
- name: Setup Service
copy:
dest: /etc/systemd/system/wikmd.service
content: |
[Unit]
Description=Wikmd
After=network.target
[Service]
User=<user>
WorkingDirectory=/data/wikmd
ExecStart=StartWikmd.sh
Restart=always
[Install]
WantedBy=multi-user.target
owner: root
group: root
mode: '0644'
# docker image is broken using manual install method
#- name: Write docker-compose.yml
# ansible.builtin.copy:
@@ -95,4 +112,14 @@
command: restic --password-file ./.resticpassword -r sftp:misamisa://home/restic/$(hostname) --target /data/wikmd restore latest
args:
chdir: /home/restic
creates: /data/wikmd
creates: /data/wikmd
- name: Reload systemd daemon
systemd:
daemon_reload: yes
- name: Start Wikmd Service
systemd:
name: wikmd
state: started
enabled: yes