feat: add CIFS utilities installation and configuration tasks
Some checks failed
Nix Format Check / check-format (push) Failing after 39s
Some checks failed
Nix Format Check / check-format (push) Failing after 39s
This commit is contained in:
49
config/ansible/tasks/servers/cifs.yml
Normal file
49
config/ansible/tasks/servers/cifs.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
- name: Install CIFS utilities
|
||||
become: true
|
||||
ansible.builtin.package:
|
||||
name: cifs-utils
|
||||
state: present
|
||||
|
||||
- name: Create mount point directory
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: /mnt/storage-box
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Create credentials file
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
dest: /root/.smbcredentials
|
||||
content: |
|
||||
username=u451316
|
||||
password={{ storage_box_password | default('CHANGE_ME') }}
|
||||
mode: '0600'
|
||||
|
||||
- name: Add fstab entry for storage-box
|
||||
become: true
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/fstab
|
||||
line: "//u451316.your-storagebox.de/backup /mnt/storage-box cifs credentials=/root/.smbcredentials,uid=1000,gid=100,iocharset=utf8,vers=3.0 0 0"
|
||||
regexp: "^//u451316.your-storagebox.de/backup"
|
||||
state: present
|
||||
notify: Systemctl daemon-reload
|
||||
|
||||
- name: Mount storage-box
|
||||
become: true
|
||||
ansible.builtin.mount:
|
||||
path: /mnt/storage-box
|
||||
src: //u451316.your-storagebox.de/backup
|
||||
fstype: cifs
|
||||
- name: Mount storage-box
|
||||
become: true
|
||||
ansible.builtin.mount:
|
||||
path: /mnt/storage-box
|
||||
src: //u451316.your-storagebox.de/backup
|
||||
fstype: cifs
|
||||
opts: credentials=/root/.smbcredentials,uid=1000,gid=100,iocharset=utf8,vers=3.0
|
||||
state: mounted
|
||||
|
||||
- name: Handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
Reference in New Issue
Block a user