vps/roles/fstab/tasks/main.yml
2024-02-17 19:01:04 +01:00

24 lines
938 B
YAML

- 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 }}"
fstype: cifs
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.0,seal"
loop: "{{ cifs_mounts | dict2items }}"