Added memcached role

This commit is contained in:
Egon Rijpkema 2017-06-21 13:38:55 +02:00
parent 0f10a61ae8
commit 13064a8e7e
3 changed files with 36 additions and 0 deletions

5
memcached.yml Normal file
View File

@ -0,0 +1,5 @@
---
- hosts: memcached
become: True
roles:
- memcached

View File

@ -0,0 +1,15 @@
[Unit]
Description=memcached Container
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker stop %n
ExecStartPre=-/usr/bin/docker rm %n
ExecStartPre=/usr/bin/docker pull memcached:1.4
ExecStart=/usr/bin/docker run --name %n -p 11211:11211 -m 1024m memcached:1.4
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,16 @@
# Install a docker based mariadb.
---
- include: ../common/tasks/docker.yml
- name: install service file.
template:
src: files/memcached.service
dest: /etc/systemd/system/memcached.service
mode: 644
owner: root
group: root
- name: install service file
command: systemctl daemon-reload
- name: make sure service is started
systemd:
name: memcached.service
state: started