diff --git a/host_vars/snunmu.yml b/host_vars/snunmu.yml index 2ebccb4..7d61dce 100644 --- a/host_vars/snunmu.yml +++ b/host_vars/snunmu.yml @@ -6,6 +6,7 @@ services: - name: linkding - name: pihole - name: hasteypaste + - name: vpn-stack - name: dashboards template_vars: dashy: false diff --git a/playbooks/setup-homelab.yml b/playbooks/setup-homelab.yml index 0fe19e1..2981af4 100644 --- a/playbooks/setup-homelab.yml +++ b/playbooks/setup-homelab.yml @@ -35,25 +35,51 @@ - name: Samba Clients hosts: sambaclients become: true + tags: [samba] pre_tasks: - name: Include vault variables. ansible.builtin.include_vars: '../{{ vault_file }}' tags: [always] tasks: + - name: Install CIFS and other required packages for mounting with apt + apt: + name: "{{ item }}" + state: present + with_items: + - smbclient + - cifs-utils + - name: Check mountpoint exists. ansible.builtin.file: path: "/mnt/mergerfs" state: directory mode: '0755' - owner: root - group: root - - name: Mount share. - tags: [samba] + owner: cianhatton + group: cianhatton + + - name: Check mountpoint exists. + ansible.builtin.file: + path: "/mnt/ssd0" + state: directory + mode: '0755' + owner: cianhatton + group: cianhatton + + - name: Mount shares. + mount: + state: "mounted" + fstype: "cifs" + path: /mnt/mergerfs + src: '//192.168.178.42/mergerfs' + opts: 'username=cianhatton,password={{ cianhatton_password }}' + + - name: Mount shares. mount: - state: "mounted" - fstype: "cifs" - path: /mnt/mergerfs - src: '//192.168.178.42/mergerfs' + state: "mounted" + fstype: "cifs" + path: /mnt/ssd0 + src: '//192.168.178.42/ssd0' + opts: 'username=cianhatton,password={{ cianhatton_password }}' - name: Install Docker on Docker hosts. hosts: docker diff --git a/roles/setup_samba/files/smb.conf b/roles/setup_samba/files/smb.conf index ac68475..9b8bfeb 100644 --- a/roles/setup_samba/files/smb.conf +++ b/roles/setup_samba/files/smb.conf @@ -8,4 +8,21 @@ map to guest = Bad User # the order in which it checks for host names name resolve order = bcast host # include a separate config -include = /etc/samba/shares.conf + +# the user that we're going to force this to be shared as +force user = smbuser +force group = smbgroup +# permissions for new files +create mask = 0664 +force create mode = 0664 +# permissions for new directories +directory mask = 0775 +force directory mode = 0775 +public = yes +writable = yes + +[mergerfs] +path = /mnt/mergerfs + +[ssd0] +path = /mnt/ssd0 diff --git a/roles/setup_samba/tasks/main.yml b/roles/setup_samba/tasks/main.yml index 0c01dfc..188c10b 100644 --- a/roles/setup_samba/tasks/main.yml +++ b/roles/setup_samba/tasks/main.yml @@ -1,11 +1,4 @@ --- -#- name: Install samba packages using apt. -# ansible.builtin.apt: -# name: -# - samba -# state: present -# update_cache: true - - name: Ensure samba group exists. ansible.builtin.group: name: '{{ samba_group }}'