feat: restructure CIFS configuration and include golink service tasks in Ansible playbook
Some checks failed
Nix Format Check / check-format (push) Failing after 38s
Some checks failed
Nix Format Check / check-format (push) Failing after 38s
This commit is contained in:
@ -1,43 +1,45 @@
|
|||||||
---
|
---
|
||||||
- name: Install CIFS utilities
|
- name: Configure CIFS
|
||||||
become: true
|
block:
|
||||||
ansible.builtin.package:
|
- name: Install CIFS utilities
|
||||||
name: cifs-utils
|
become: true
|
||||||
state: present
|
ansible.builtin.package:
|
||||||
|
name: cifs-utils
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Create mount point directory
|
- name: Create mount point directory
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /mnt/storage-box
|
path: /mnt/storage-box
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Create credentials file
|
- name: Create credentials file
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: /root/.smbcredentials
|
dest: /root/.smbcredentials
|
||||||
content: |
|
content: |
|
||||||
username=u451316
|
username=u451316
|
||||||
password={{ lookup('onepassword', '5j5y5axfjr3f3sn5nixb6htg4y', vault='j7nmhqlsjmp2r6umly5t75hzb4') | default('CHANGE_ME') }}
|
password={{ lookup('onepassword', '5j5y5axfjr3f3sn5nixb6htg4y', vault='j7nmhqlsjmp2r6umly5t75hzb4') | default('CHANGE_ME') }}
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
|
|
||||||
- name: Add fstab entry for storage-box
|
- name: Add fstab entry for storage-box
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/fstab
|
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"
|
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"
|
regexp: "^//u451316.your-storagebox.de/backup"
|
||||||
state: present
|
state: present
|
||||||
notify: Systemctl daemon-reload
|
notify: Systemctl daemon-reload
|
||||||
|
|
||||||
- name: Mount storage-box
|
- name: Mount storage-box
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.mount:
|
ansible.builtin.mount:
|
||||||
path: /mnt/storage-box
|
path: /mnt/storage-box
|
||||||
src: //u451316.your-storagebox.de/backup
|
src: //u451316.your-storagebox.de/backup
|
||||||
fstype: cifs
|
fstype: cifs
|
||||||
opts: credentials=/root/.smbcredentials,uid=1000,gid=100,iocharset=utf8,vers=3.0
|
opts: credentials=/root/.smbcredentials,uid=1000,gid=100,iocharset=utf8,vers=3.0
|
||||||
state: mounted
|
state: mounted
|
||||||
|
|
||||||
- name: Handlers
|
- name: Handlers
|
||||||
ansible.builtin.meta: flush_handlers
|
ansible.builtin.meta: flush_handlers
|
||||||
|
@ -13,4 +13,5 @@
|
|||||||
ansible.builtin.include_tasks: services/services.yml
|
ansible.builtin.include_tasks: services/services.yml
|
||||||
vars:
|
vars:
|
||||||
duplicati_enabled: true
|
duplicati_enabled: true
|
||||||
|
golink_enabled: true
|
||||||
when: ansible_hostname == "mennos-cloud-server"
|
when: ansible_hostname == "mennos-cloud-server"
|
||||||
|
@ -3,3 +3,7 @@
|
|||||||
- name: Include duplicati tasks
|
- name: Include duplicati tasks
|
||||||
ansible.builtin.include_tasks: duplicati/duplicati.yml
|
ansible.builtin.include_tasks: duplicati/duplicati.yml
|
||||||
when: duplicati_enabled|bool
|
when: duplicati_enabled|bool
|
||||||
|
|
||||||
|
- name: Include golink tasks
|
||||||
|
ansible.builtin.include_tasks: golink/golink.yml
|
||||||
|
when: golink_enabled|bool
|
||||||
|
Reference in New Issue
Block a user