autofs: Move users .cache directory out from home direcotry
No need to store users local .cache directory on NFS home directories. Use tmpfs which is much faster.
This commit is contained in:
parent
93c1ae2e89
commit
b317e5b12e
3 changed files with 23 additions and 0 deletions
6
roles/autofs/files/usercache.csh
Normal file
6
roles/autofs/files/usercache.csh
Normal file
|
@ -0,0 +1,6 @@
|
|||
if ($uid > 999 && "`/usr/bin/id -gn`" == "`/usr/bin/id -un`") then
|
||||
setenv XDG_CACHE_HOME "${XDG_RUNTIME_DIR}/.cache"
|
||||
if ( ! -d "${XDG_CACHE_HOME}" ) then
|
||||
install -d -m 0700 "${XDG_CACHE_HOME}"
|
||||
endif
|
||||
endif
|
6
roles/autofs/files/usercache.sh
Normal file
6
roles/autofs/files/usercache.sh
Normal file
|
@ -0,0 +1,6 @@
|
|||
if [ $UID -gt 999 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then
|
||||
export XDG_CACHE_HOME="$XDG_RUNTIME_DIR/.cache"
|
||||
if [ ! -d "$XDG_CACHE_HOME" ] ; then
|
||||
install -d -m 0700 "$XDG_CACHE_HOME"
|
||||
fi
|
||||
fi
|
|
@ -62,3 +62,14 @@
|
|||
Match User root
|
||||
AuthorizedKeysFile .ssh/authorized_keys
|
||||
notify: restart sshd
|
||||
|
||||
- name: move user cache from home directory to tmpfs
|
||||
copy:
|
||||
dest: "/etc/profile.d/{{ item }}"
|
||||
src: "{{ item }}"
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
with_items:
|
||||
- usercache.sh
|
||||
- usercache.csh
|
||||
|
|
Loading…
Add table
Reference in a new issue