Move storagebox to cifs share for better performance
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
355426a345
commit
0ed91a92c6
7
ansible/host_vars/backup.unruhig.eu/vault.yaml
Normal file
7
ansible/host_vars/backup.unruhig.eu/vault.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
64323432633839313739346636383934366264653165373433316239366235613336646462333031
|
||||
3633326564323431653131653436386563613562633432390a383161343463343366336266303038
|
||||
36316230323264646532386238363331663364353365643861323536643961613561626265313762
|
||||
3864373034646433300a623535623532353965333030383065346562393139313437313438623361
|
||||
63336531373365383463303437343833646531366363353630626134373932303063653530323433
|
||||
6639623264316133356463333236623032356138636361383966
|
@ -25,44 +25,37 @@
|
||||
ansible.builtin.file:
|
||||
path: "/home/backup/.config/systemd/user"
|
||||
state: directory
|
||||
- name: Check if user is lingering
|
||||
become: true
|
||||
stat:
|
||||
path: "/var/lib/systemd/linger/backup"
|
||||
register: user_lingering
|
||||
- name: Enable lingering for user if needed
|
||||
become: true
|
||||
command: "loginctl enable-linger backup"
|
||||
when:
|
||||
- not user_lingering.stat.exists
|
||||
- name: Create mount unit
|
||||
become: true
|
||||
become_user: backup
|
||||
become_user: root
|
||||
ansible.builtin.template:
|
||||
src: mount-storagebox.mount.j2
|
||||
dest: /home/backup/.config/systemd/user/var-home-backup-storagebox.mount
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0600" # Credentials
|
||||
dest: /etc/systemd/system/var-home-backup-storagebox.mount
|
||||
- name: Create automount unit
|
||||
become: true
|
||||
become_user: backup
|
||||
become_user: root
|
||||
ansible.builtin.template:
|
||||
src: mount-storagebox.automount.j2
|
||||
dest: /home/backup/.config/systemd/user/var-home-backup-storagebox.automount
|
||||
dest: /etc/systemd/system/var-home-backup-storagebox.automount
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
- name: Start storagebox Mount Service
|
||||
become: true
|
||||
become_user: backup
|
||||
become_user: root
|
||||
ansible.builtin.systemd:
|
||||
name: var-home-backup-storagebox.mount
|
||||
state: started
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
scope: user
|
||||
- name: enable storagebox automount Mount Unit
|
||||
become: true
|
||||
become_user: backup
|
||||
become_user: root
|
||||
ansible.builtin.systemd:
|
||||
name: var-home-backup-storagebox.automount
|
||||
enabled: true
|
||||
scope: user
|
||||
|
||||
|
||||
# vim: ft=yaml.ansible
|
||||
|
@ -7,8 +7,8 @@ Wants=network-online.target
|
||||
WantedBy=default.target
|
||||
|
||||
[Mount]
|
||||
What=u309229-sub6@u309229.your-storagebox.de:
|
||||
What=//u309229-sub6.your-storagebox.de/u309229-sub6
|
||||
Where=/var/home/backup/storagebox
|
||||
Type=fuse.sshfs
|
||||
Options=_netdev,reconnect,uid=1000,gid=1000,delay_connect,ServerAliveInterval=30,ServerAliveCountMax=5,x-systemd.automount,Port=23,IdentityFile=/var/home/backup/.ssh/storagebox
|
||||
Type=cifs
|
||||
Options=_netdev,iocharset=utf8,username=u309229-sub6,password={{ cifs.password }},uid=1000,gid=1000,x-systemd.automount
|
||||
TimeoutSec=60
|
||||
|
Loading…
Reference in New Issue
Block a user