Refactor systemd unit files for mounting and opening LUKS devices
This commit is contained in:
@@ -93,6 +93,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Open LUKS device
|
Description=Open LUKS device
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
Before=snap.microk8s.daemon-kubelite.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
@@ -103,7 +104,7 @@
|
|||||||
ExecStop=/usr/sbin/cryptsetup close {{ luks_device_name }}
|
ExecStop=/usr/sbin/cryptsetup close {{ luks_device_name }}
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=remote-fs.target
|
WantedBy=snap.microk8s.daemon-kubelite.service
|
||||||
|
|
||||||
- name: Create systemd service to mount the file system
|
- name: Create systemd service to mount the file system
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
@@ -112,7 +113,9 @@
|
|||||||
content: |
|
content: |
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Mount LUKS device
|
Description=Mount LUKS device
|
||||||
After=remote-fs.target
|
After={{ key_fetch_service }}
|
||||||
|
Requires={{ key_fetch_service }}
|
||||||
|
Before=snap.microk8s.daemon-kubelite.service
|
||||||
|
|
||||||
[Mount]
|
[Mount]
|
||||||
What=/dev/mapper/{{ luks_device_name }}
|
What=/dev/mapper/{{ luks_device_name }}
|
||||||
@@ -121,7 +124,7 @@
|
|||||||
Options=defaults
|
Options=defaults
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=snap.microk8s.daemon-kubelite.service
|
||||||
|
|
||||||
- name: Reload systemd daemon
|
- name: Reload systemd daemon
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
- name: Set required facts
|
- name: Set required facts
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
gitea_home: "/var/lib/gitea"
|
gitea_home: "/var/lib/gitea"
|
||||||
|
gitea_config_dir: "/a13labs/gitea"
|
||||||
gitea_mysql_home: "/var/lib/mysql.gitea"
|
gitea_mysql_home: "/var/lib/mysql.gitea"
|
||||||
gitea_user_id: 1000
|
gitea_user_id: 1000
|
||||||
gitea_group_id: 1000
|
gitea_group_id: 1000
|
||||||
@@ -57,6 +58,18 @@
|
|||||||
- tasks
|
- tasks
|
||||||
- tasks::folders
|
- tasks::folders
|
||||||
|
|
||||||
|
- name: Create required gitea config folder
|
||||||
|
become: true
|
||||||
|
ansible.builtin.file:
|
||||||
|
state: directory
|
||||||
|
path: "{{ gitea_config_dir }}"
|
||||||
|
mode: "0750"
|
||||||
|
owner: "{{ gitea_user_id }}"
|
||||||
|
group: "{{ gitea_group_id }}"
|
||||||
|
tags:
|
||||||
|
- tasks
|
||||||
|
- tasks::folders
|
||||||
|
|
||||||
- name: Create required mysql data folder
|
- name: Create required mysql data folder
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
|||||||
Reference in New Issue
Block a user