mote: use local memcached

This commit is contained in:
Francois Andrieu 2022-03-20 15:22:19 +01:00 committed by kevin
parent 7a88a6fb62
commit 3a5b83e62b
4 changed files with 51 additions and 2 deletions

View File

@ -0,0 +1,4 @@
[Service]
User=memcached
Group=apache
RuntimeDirectory=memcached

View File

@ -0,0 +1,5 @@
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="4096"
OPTIONS="-s /var/run/memcached/memcached.sock -a 0770"

View File

@ -5,10 +5,50 @@
package: name={{ item }} state=present
with_items:
- mote
- memcached
tags:
- packages
- mote
- name: set the memcached sysconfig file
copy:
src: memcached.sysconfig
dest: /etc/sysconfig/memcached
tags:
- mote
notify:
- restart memcached
- name: make systemd override dir
file:
state: directory
path: /etc/systemd/system/memcached.service.d
mode: 0755
owner: root
group: root
tags:
- mote
- name: make systemd override config
copy:
src: memcached.override
dest: /etc/systemd/system/memcached.service.d/override.conf
tags:
- mote
notify:
- reload systemd
- restart memcached
- meta: flush_handlers
- name: start memcached
service:
state: started
enabled: yes
name: memcached
tags:
- mote
- name: replace the mote configuration file by the one with the normal user
template: src={{ item.file }}
dest="{{ item.location }}/{{ item.file }}"

View File

@ -46,8 +46,8 @@ General Configuration
admin_groups = ["sysadmin-mote"]
# memcached must be installed for this feature
memcached_ip = "memcached01:11211"
use_memcached = False # Use a memcached store for greater performance
memcached_ip = "unix:/var/run/memcached/memcached.sock"
use_memcached = True # Use a memcached store for greater performance
# JSON cache store location
json_cache_location = "/var/cache/httpd/mote/cache.json"