generalize role to a generale mount role

This commit is contained in:
nd 2020-11-21 00:22:02 +01:00
parent 1e93481389
commit 0ab1f2d078
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9
3 changed files with 30 additions and 24 deletions

25
tasks/mount.yml Normal file
View file

@ -0,0 +1,25 @@
- set_fact:
mount: "{{ {}|combine(item.value, { 'mountpoint': item.key }, recursive=True) }}"
- name: "create mount point {{ mount.mountpoint }}"
file:
path: "{{ mount.mountpoint }}"
state: directory
- name: "mount {{ mount.mountpoint }}"
mount:
path: "{{ mount.mountpoint }}"
src: "{{ mount.source }}"
opts: "{{ mount.options }}"
fstype: "{{ mount.type }}"
passno: "{{ mount.passno|d(0) }}"
state: mounted
- name: "write mount {{ mount.mountpoint }} to fstab"
mount:
path: "{{ mount.mountpoint }}"
src: "{{ mount.source }}"
opts: "{{ mount.options }}"
fstype: "{{ mount.type }}"
passno: "{{ mount.passno|d(0) }}"
state: present