Support network mounts in mount_points
- never run mkfs for nfs/nfs4/cifs entries (the filesystem task would try to format the share) - install nfs-common when an nfs mount is configured Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ca99b3c6cb
commit
a6f015fd68
1 file changed
+9
@@ -1,3 +1,10 @@
|
|||||||
|
- name: install nfs client for network mounts
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
state: present
|
||||||
|
pkg: nfs-common
|
||||||
|
when: mount_points | selectattr('fstype', 'defined') | selectattr('fstype', 'in', ['nfs', 'nfs4']) | list | length > 0
|
||||||
|
|
||||||
- name: generate filesystem on mounts if not defined
|
- name: generate filesystem on mounts if not defined
|
||||||
filesystem:
|
filesystem:
|
||||||
fstype: "{{ mnt.fstype | default('ext4') }}"
|
fstype: "{{ mnt.fstype | default('ext4') }}"
|
||||||
@@ -6,6 +13,8 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
loop_var: mnt
|
loop_var: mnt
|
||||||
label: "{{ mnt.dev }}: {{ mnt.fstype | default('ext4') }}"
|
label: "{{ mnt.dev }}: {{ mnt.fstype | default('ext4') }}"
|
||||||
|
# network shares already have a filesystem; never format them
|
||||||
|
when: mnt.fstype | default('ext4') not in ['nfs', 'nfs4', 'cifs']
|
||||||
|
|
||||||
- name: mount required points
|
- name: mount required points
|
||||||
mount:
|
mount:
|
||||||
|
|||||||
Reference in new issue
Block a user