This commit is contained in:
1 parent
6f3911a433
commit
c187d56137
3 files changed
+48
No files matched your search
@@ -0,0 +1,27 @@
|
||||
#vars:
|
||||
# host_maintenance_systemd_mount_target: ""
|
||||
# host_maintenance_systemd_mount_source: ""
|
||||
|
||||
- name: check target folders
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.target }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
loop: "{{ host_maintenance_disk_mounts }}"
|
||||
|
||||
- name: set systemd mount
|
||||
ansible.builtin.template:
|
||||
src: templates/systemd_mount.j2
|
||||
dest: "/etc/systemd/system/{{ item.target | regex_replace('^/', '') | regex_replace('/', '-') }}.mount"
|
||||
mode: '0644'
|
||||
loop: "{{ host_maintenance_disk_mounts }}"
|
||||
register: systemd_mount_files
|
||||
|
||||
|
||||
- name: reload systemd
|
||||
ansible.builtin.systemd_service:
|
||||
name: "{{ item.target | regex_replace('^/', '') | regex_replace('/', '-') }}.mount"
|
||||
daemon_reload: "{{ systemd_mount_files.changed }}"
|
||||
enabled: true
|
||||
state: started
|
||||
loop: "{{ host_maintenance_disk_mounts }}"
|
||||
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Mount {{ item.target }} managed by mylimbo.globals collections, host_maintenance role
|
||||
#After=
|
||||
Conflicts={{ item.unit_conflicts }}
|
||||
Before={{ item.unit_before }}
|
||||
|
||||
[Mount]
|
||||
What={{ item.source }}
|
||||
Where={{ item.target }}
|
||||
Type={{ item.mount_type }}
|
||||
Options={{ item.mount_options | join(',') }}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in new issue
Block a user