Added memcached role
This commit is contained in:
parent
0f10a61ae8
commit
13064a8e7e
5
memcached.yml
Normal file
5
memcached.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- hosts: memcached
|
||||||
|
become: True
|
||||||
|
roles:
|
||||||
|
- memcached
|
15
roles/memcached/files/memcached.service
Normal file
15
roles/memcached/files/memcached.service
Normal 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
|
16
roles/memcached/tasks/main.yml
Normal file
16
roles/memcached/tasks/main.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user