2024-02-17 19:01:04 +01:00
|
|
|
- name:
|
|
|
|
become: true
|
|
|
|
block:
|
|
|
|
- name: Install package cifs-utils
|
|
|
|
apt:
|
|
|
|
name: cifs-utils
|
|
|
|
|
|
|
|
- name: "Template {{ fstab_cifs_credentials_filename }} to /etc/{{ fstab_cifs_credentials_filename }}"
|
|
|
|
template:
|
|
|
|
src: "{{ fstab_cifs_credentials_filename }}"
|
|
|
|
dest: "/etc/{{ fstab_cifs_credentials_filename }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: '600'
|
|
|
|
register: fstab_template_cifs_credentials_result
|
|
|
|
|
|
|
|
- name: Mount/Remount CIFS devices & edit fstab accordingly
|
|
|
|
mount:
|
|
|
|
state: mounted
|
|
|
|
src: "{{ item.value.src }}"
|
|
|
|
path: "{{ item.value.path }}"
|
2024-07-06 10:48:47 +02:00
|
|
|
fstype: smb3
|
|
|
|
opts: "uid={{ item.value.uid }},gid={{ item.value.gid }},file_mode=0{{ item.value.file_mode }},dir_mode=0{{ item.value.dir_mode }},credentials=/etc/{{ fstab_cifs_credentials_filename }},iocharset=utf8,rw,mfsymlinks,vers=3,seal"
|
2024-02-17 19:01:04 +01:00
|
|
|
loop: "{{ cifs_mounts | dict2items }}"
|