Some checks failed
Nix Format Check / check-format (push) Failing after 39s
50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
---
|
|
- 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
|