feat: restructure CIFS configuration and include golink service tasks in Ansible playbook
Some checks failed
Nix Format Check / check-format (push) Failing after 38s

This commit is contained in:
Menno van Leeuwen 2025-03-11 18:46:31 +01:00
parent 28c28c6493
commit c70357a16d
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
3 changed files with 44 additions and 37 deletions

View File

@ -1,43 +1,45 @@
---
- name: Install CIFS utilities
become: true
ansible.builtin.package:
name: cifs-utils
state: present
- name: Configure CIFS
block:
- 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 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={{ lookup('onepassword', '5j5y5axfjr3f3sn5nixb6htg4y', vault='j7nmhqlsjmp2r6umly5t75hzb4') | default('CHANGE_ME') }}
mode: '0600'
- name: Create credentials file
become: true
ansible.builtin.copy:
dest: /root/.smbcredentials
content: |
username=u451316
password={{ lookup('onepassword', '5j5y5axfjr3f3sn5nixb6htg4y', vault='j7nmhqlsjmp2r6umly5t75hzb4') | 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: 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
opts: credentials=/root/.smbcredentials,uid=1000,gid=100,iocharset=utf8,vers=3.0
state: mounted
- 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
- name: Handlers
ansible.builtin.meta: flush_handlers

View File

@ -13,4 +13,5 @@
ansible.builtin.include_tasks: services/services.yml
vars:
duplicati_enabled: true
golink_enabled: true
when: ansible_hostname == "mennos-cloud-server"

View File

@ -3,3 +3,7 @@
- name: Include duplicati tasks
ansible.builtin.include_tasks: duplicati/duplicati.yml
when: duplicati_enabled|bool
- name: Include golink tasks
ansible.builtin.include_tasks: golink/golink.yml
when: golink_enabled|bool