2021-04-28 07:23:11 +00:00
|
|
|
---
|
|
|
|
- name: Install memcached
|
|
|
|
apt:
|
|
|
|
name: '{{ memcached_package }}'
|
|
|
|
notify: restart memcached
|
|
|
|
|
|
|
|
- name: Template configuration
|
|
|
|
template:
|
|
|
|
src: 'memcached.conf.j2'
|
|
|
|
dest: '{{ memcached_cfg_file }}'
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
register: memcached_config
|
|
|
|
notify: restart memcached
|
|
|
|
|
|
|
|
- name: Create Consul service definition
|
2024-03-13 15:27:54 +00:00
|
|
|
include_role: name=infra-role-consul-service
|
2021-04-28 07:23:11 +00:00
|
|
|
vars:
|
|
|
|
consul_config_name: '{{ memcached_service }}'
|
|
|
|
consul_services:
|
|
|
|
- name: '{{ memcached_service }}'
|
|
|
|
tags: '{{ memcached_consul_tags }}'
|
|
|
|
port: '{{ memcached_port }}'
|
|
|
|
address: '{{ memcached_addr }}'
|
|
|
|
checks:
|
|
|
|
- id: '{{ memcached_service }}-health'
|
|
|
|
name: 'Memcached'
|
|
|
|
type: 'tcp'
|
|
|
|
tcp: '{{ memcached_addr }}:{{ memcached_port }}'
|