add auto mounting

This commit is contained in:
admin 2025-02-22 13:27:47 +00:00
parent e37fce10f3
commit 748eeabbd8
4 changed files with 61 additions and 6 deletions

View File

@ -2,9 +2,9 @@
- name: configure host
hosts: all
#connection: local
vars_files:
- vars
- vault.yml
tasks:

1
run.sh Executable file
View File

@ -0,0 +1 @@
ansible-playbook main.yml --ask-vault-pass --ask-become-pass

View File

@ -150,6 +150,46 @@
ansible.builtin.apt:
deb: https://github.com/Open-Wine-Components/umu-launcher/releases/download/1.2.5/umu-launcher_1.2.5-1_all_debian-12.deb
- name: create mount directories
become: true
block:
- name: create /mnt/data
ansible.builtin.file:
path: /mnt/data
state: directory
- name: create /mnt/services
ansible.builtin.file:
path: /mnt/services
state: directory
- name: create /mnt/media
ansible.builtin.file:
path: /mnt/media
state: directory
- name: mount shares
become: true
block:
- name: mount data
ansible.posix.mount:
path: /mnt/data
src: "//{{ truenas_ip }}/data"
fstype: cifs
opts: "defaults,auto,rw,username={{ smb_user }},password={{ smb_pass }}"
state: mounted
- name: mount services
ansible.posix.mount:
path: /mnt/services
src: "//{{ truenas_ip }}/services"
fstype: cifs
opts: "defaults,auto,rw,username={{ smb_user }},password={{ smb_pass }}"
state: mounted
- name: mount media
ansible.posix.mount:
path: /mnt/media
src: "//{{ truenas_ip }}/media"
fstype: cifs
opts: "defaults,auto,rw,username={{ smb_user }},password={{ smb_pass }}"
state: mounted
- name: enable workspace-indicator extension
ansible.builtin.shell:
@ -162,6 +202,17 @@
value: 16777216
sysctl_file: /etc/sysctl.d/games.conf
- name: Ensure bookmarks are set
lineinfile:
path: "{{ ansible_user_dir }}/.config/gtk-3.0/bookmarks"
line: "{{ item }}"
create: yes
with_items:
- "file:///mnt/data"
- "file:///mnt/services"
- "file:///mnt/media"
when: ansible_user_dir is defined
- name: gnome settings
ansible.builtin.shell:
cmd: |

View File

@ -1,6 +1,9 @@
$ANSIBLE_VAULT;1.1;AES256
32396236343539346435343962343264363839303063663164333233373935343663316530633232
6263636535353531643935633931623739643231633532340a303165613032363763663531643732
34386631643739646332383931623062626136313263626331303732656661616666306334373763
6331363261326338360a356437346263383565363464663333363163333437316233313932383632
66613461383634393861653531613131343230623263663863303963633063613562
64333064643566613064616435343439646335313035326266623030323134333963646165323434
3538333735376364656330326138343633343434643862610a326638333030613134663562383836
35613332626238323937383630626635626363306430393163373962323832663934343163656136
6437613031626536360a626234313361346162356364366264616236396666656238633039633363
64633535373464666466663538643330663561386266393130376538386365333037343561353032
32666164356362376531303466626132653665636562623165353535653931393061366366386436
65316430646135396264346432313234666336356164636535363761623262383130353935353966
62363934363638303039