new file: roles/host_maintenance/README.md
image-deploy.yaml / build-push-image (push) Successful in 47s
image-deploy.yaml / build-push-image (push) Successful in 47s
modified: roles/host_maintenance/tasks/systemd_mount.yaml modified: roles/host_maintenance/templates/systemd_mount.j2
This commit is contained in:
1 parent
c187d56137
commit
4a8ce0e3bd
3 files changed
+42
-5
No files matched your search
@@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
systemd_mount vars task example:
|
||||||
|
|
||||||
|
``` yaml
|
||||||
|
host_maintenance_disk_mounts:
|
||||||
|
- source: /dev/disk/by-uuid/xxxxxxx
|
||||||
|
target: /var/lib/rancher
|
||||||
|
mount_type: ext4
|
||||||
|
unit_before: k3s.service
|
||||||
|
unit_conflicts: umount.target
|
||||||
|
mount_options:
|
||||||
|
- defaults
|
||||||
|
- source: /dev/disk/by-uuid/xxxxx
|
||||||
|
target: /var/lib/rancher/k3s/storage
|
||||||
|
unit_before: k3s.service
|
||||||
|
unit_conflicts: umount.target
|
||||||
|
mount_type: ext4
|
||||||
|
mount_options:
|
||||||
|
- defaults
|
||||||
|
|
||||||
|
```
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
#vars:
|
- ansible.builtin.assert:
|
||||||
# host_maintenance_systemd_mount_target: ""
|
that:
|
||||||
# host_maintenance_systemd_mount_source: ""
|
- item.source is defined
|
||||||
|
- item.target is defined
|
||||||
|
- item.mount_type is defined
|
||||||
|
fail_msg: "All of source, target, and mount_type must be defined for each disk entry."
|
||||||
|
|
||||||
|
loop: "{{ host_maintenance_disk_mounts }}"
|
||||||
- name: check target folders
|
- name: check target folders
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item.target }}"
|
path: "{{ item.target }}"
|
||||||
|
|||||||
@@ -1,14 +1,26 @@
|
|||||||
|
# set by ansible role mylimbo.globals.host_maintenance role, do not edit manually
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Mount {{ item.target }} managed by mylimbo.globals collections, host_maintenance role
|
Description=Mount {{ item.target }} managed by mylimbo.globals collections, host_maintenance role
|
||||||
#After=
|
|
||||||
Conflicts={{ item.unit_conflicts }}
|
{% if item.unit_after is defined %}
|
||||||
|
# After dependencies
|
||||||
|
After={{ item.unit_after }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if item.unit_before is defined %}
|
||||||
|
# Before dependencies
|
||||||
Before={{ item.unit_before }}
|
Before={{ item.unit_before }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
[Mount]
|
[Mount]
|
||||||
What={{ item.source }}
|
What={{ item.source }}
|
||||||
Where={{ item.target }}
|
Where={{ item.target }}
|
||||||
Type={{ item.mount_type }}
|
Type={{ item.mount_type }}
|
||||||
|
|
||||||
|
{% if item.mount_options is defined %}
|
||||||
|
# Mount options, if specified
|
||||||
Options={{ item.mount_options | join(',') }}
|
Options={{ item.mount_options | join(',') }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
Reference in new issue
Block a user