Browse Source

Added memcached role

feature/cinder-volume-encryption
Egon Rijpkema 5 years ago
parent
commit
13064a8e7e
  1. 5
      memcached.yml
  2. 15
      roles/memcached/files/memcached.service
  3. 16
      roles/memcached/tasks/main.yml

5
memcached.yml

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

15
roles/memcached/files/memcached.service

@ -0,0 +1,15 @@ @@ -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

16
roles/memcached/tasks/main.yml

@ -0,0 +1,16 @@ @@ -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
Loading…
Cancel
Save