commit 46564f859386b03a096f53d9dfa4d5eb0764cba0
Author: Nicolas Chauvet <kwizart(a)gmail.com>
Date: Fri Oct 7 18:58:17 2016 +0200
Add memcached
.../memcached/files/memcached-systemdoverride.conf | 3 ++
roles/memcached/tasks/main.yml | 35 ++++++++++++++++++++
roles/memcached/templates/memcached | 5 +++
3 files changed, 43 insertions(+), 0 deletions(-)
---
diff --git a/roles/memcached/files/memcached-systemdoverride.conf
b/roles/memcached/files/memcached-systemdoverride.conf
new file mode 100644
index 0000000..98d34df
--- /dev/null
+++ b/roles/memcached/files/memcached-systemdoverride.conf
@@ -0,0 +1,3 @@
+[Service]
+Restart=always
+
diff --git a/roles/memcached/tasks/main.yml b/roles/memcached/tasks/main.yml
new file mode 100644
index 0000000..e8f6c9c
--- /dev/null
+++ b/roles/memcached/tasks/main.yml
@@ -0,0 +1,35 @@
+---
+- name: install memcached server package
+ yum: state=present name=memcached
+ tags:
+ - packages
+ - memcached
+
+- name: setup memcached sysconfig
+ template: src=memcached dest=/etc/sysconfig/memcached mode=644
+ notify:
+ - restart memcached
+ tags:
+ - config
+ - memcached
+
+- name: enable memcached service
+ service: state=running enabled=true name=memcached
+ tags:
+ - service
+ - config
+ - memcached
+
+- name: make systemd override dir
+ file: state=directory path=/etc/systemd/system/memcached.service.d mode=0755 owner=root
group=root
+ tags:
+ - memcached
+ when: not ansible_distribution_major_version|int == 6
+
+- name: make systemd override config
+ copy: src=memcached-systemdoverride.conf dest=/etc/systemd/system/memcached.service.d/
+ tags:
+ - memcached
+ notify:
+ - reload systemd
+ when: not ansible_distribution_major_version|int == 6
diff --git a/roles/memcached/templates/memcached b/roles/memcached/templates/memcached
new file mode 100644
index 0000000..e350ae6
--- /dev/null
+++ b/roles/memcached/templates/memcached
@@ -0,0 +1,5 @@
+PORT="11211"
+USER="memcached"
+MAXCONN="1024"
+CACHESIZE="1024"
+OPTIONS=""
Show replies by date