claranet.memcached
Ansible role - memcached
:star: Star us on GitHub — it motivates us a lot!*
Install and configure Memcached.
:warning: Requirements
Ansible >= 2.10
This role allows multiple instances of memcached to be installed on the same machine (in the same version). Just import the role several times as explained in the examples below. The role allows you to configure any memcached launch option.
:zap: Installation
ansible-galaxy install claranet.memcached
:gear: Role variables
| Variable | Default value | Description |
|---|---|---|
| memcached_verbose | true | Verbose mode for memcached |
| memcached_memory | 64 | Max memory can be used (in MB) |
| memcached_port | 11211 | Listen port |
| memcached_user | null | Sets the Unix user that the process is executed as. Takes a single user name |
| memcached_listen | [127.0.0.1] | List of listen addresses |
| memcached_maxconn | 1024 | Max acceptable connections |
| memcached_extra_options | [] | List of additional options |
| memcached_restart | false | Restarts memcached when the configuration changes |
:arrows_counterclockwise: Dependencies
N/A
:pencil2: Example Playbook
The playbook below instantiates two instances of memcached on two different ports. The memcached_extra_options variable allows you to add launch options (here -t 8).
- name: bootstrap instance
hosts: all
become: true
tasks:
- include_role:
name: memcached
vars:
memcached_restart: true
memcached_extra_options:
- t 8
- include_role:
name: memcached
vars:
memcached_port: 11212
