Skip to content

claranet/ansible-role-memcached

Repository files navigation

Ansible role - memcached

Maintainer License Release Status Ansible version Ansible Galaxy

⭐ Star us on GitHub — it motivates us a lot!*

Install and configure Memcached.

⚠️ 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.

⚡ Installation

ansible-galaxy install claranet.memcached

⚙️ 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

🔄 Dependencies

N/A

✏️ 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

©️ License

Mozilla Public License Version 2.0