{"id":18906533,"url":"https://github.com/claranet/ansible-role-redis","last_synced_at":"2026-04-28T21:32:26.759Z","repository":{"id":162065899,"uuid":"635774694","full_name":"claranet/ansible-role-redis","owner":"claranet","description":"Install and configure Redis","archived":false,"fork":false,"pushed_at":"2024-03-27T14:31:20.000Z","size":109,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-03-27T17:57:29.726Z","etag":null,"topics":["ansible","claranet","redis","role"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/claranet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-05-03T12:33:22.000Z","updated_at":"2024-04-15T08:45:53.411Z","dependencies_parsed_at":null,"dependency_job_id":"a4595bc7-6799-4cac-8b53-998bc06a81ee","html_url":"https://github.com/claranet/ansible-role-redis","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claranet%2Fansible-role-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claranet%2Fansible-role-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claranet%2Fansible-role-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claranet%2Fansible-role-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/claranet","download_url":"https://codeload.github.com/claranet/ansible-role-redis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239889921,"owners_count":19713863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","claranet","redis","role"],"created_at":"2024-11-08T09:16:41.055Z","updated_at":"2026-03-05T12:30:18.162Z","avatar_url":"https://github.com/claranet.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible role - redis\n[![Maintainer](https://img.shields.io/badge/maintained%20by-claranet-e00000?style=flat-square)](https://www.claranet.fr/)\n[![License](https://img.shields.io/github/license/claranet/ansible-role-redis?style=flat-square)](LICENSE)\n[![Release](https://img.shields.io/github/v/release/claranet/ansible-role-redis?style=flat-square)](https://github.com/claranet/ansible-role-redis/releases)\n[![Status](https://img.shields.io/github/actions/workflow/status/claranet/ansible-role-redis/molecule.yml?style=flat-square\u0026label=tests\u0026branch=main)](https://github.com/claranet/ansible-role-redis/actions?query=workflow%3A%22Ansible+Molecule%22)\n[![Ansible version](https://img.shields.io/badge/ansible-%3E%3D2.10-black.svg?style=flat-square\u0026logo=ansible)](https://github.com/ansible/ansible)\n[![Ansible Galaxy](https://img.shields.io/badge/ansible-galaxy-black.svg?style=flat-square\u0026logo=ansible)](https://galaxy.ansible.com/claranet/redis)\n\n\n\u003e :star: Star us on GitHub — it motivates us a lot!\n\nInstall and configure Redis\n\n## :warning: Requirements\n\nAnsible \u003e= 2.10\n\n## :zap: Installation\n\n```bash\nansible-galaxy install claranet.redis\n```\n\n## :gear: Role variables\n\nVariable                              | Default value                                      | Description\n--------------------------------------|----------------------------------------------------|------------------------------------------------------------------\nredis_server_enabled                  | **true**                                           | enable installation and configuration of redis server\nredis_master_ip                       | **null**                                           | redis master ip. used for clustering scenario\nredis_group                           | **groups.redis**                                   | redis group name in inventory\nredis_server_version                  | **latest**                                         | redis version to install\nredis_server_user                     | **redis**                                          | redis user for configuration\nredis_server_group                    | **redis**                                          | group for redis\nredis_server_logdir                   | **/var/log/redis**                                 | path to log directory\nredis_server_databases_number         | **16**                                             | number of databases\nredis_server_port                     | **6379**                                           | listen port\nredis_server_password                 | **void**                                           | password for redis authentication\nredis_conf.bind                       | **0.0.0.0**                                        | listen address\nredis_conf.supervised                 | **systemd**                                        | Supervision option\nredis_conf.pidfile                    | **/var/run/redis_{{ redis_server_port }}.pid**     | pid file for systemd service\nredis_conf.logfile                    | **redis-server_{{ redis_server_port }}.log**       | name of redis log file\nredis_conf.dir                        | **/var/lib/redis**                                 | path of databases files\nredis_conf.dbfilename                 | **{{ redis_server_port }}.rdb**                    | database filename\nredis_conf.maxmemory-policy           | **allkeys-lru**                                    | max memory policy\nredis_conf.maxmemory                  | **'{{ autocalculated \\| int }}'**                  | max memory available\nredis_conf.replica-priority           | **10 (master) / 100 (replica)**                    | replica priority\nredis_conf.appendfilename             | **{{ redis_server_port }}.aof**                    | redis append filename\nredis_sentinel_version                | **'{{ redis_server_version }}'**                   | sentinel version to install\nredis_sentinel_enabled                | **false**                                          | sentinel version to install\nredis_sentinel_daemonize              | **true**                                           | daemonize redis sentinel\nredis_sentinel_listen                 | **0.0.0.0**                                        | listen address for sentinel\nredis_sentinel_port                   | **26379**                                          | port for listen address\nredis_sentinel_logdir                 | **'{{ redis_server_logdir }}'**                    | logdir path for sentinel\nredis_sentinel_logfile                | **'redis-sentinel_{{ redis_sentinel_port }}.log'** | sentinel logfile\nredis_sentinel_databases_dir          | **'{{ redis_server_databases_dir }}'**             | sentinel database directory\nredis_sentinel_quorum                 | **2**                                              | redis sentinel quorum\nredis sentinel downafter              | **10000**                                          | time for downafter\nredis_sentinel_failover_timeout       | **30000**                                          | failover timeout\n\nAll other redis parameters have default values .\n\nCustom configuration should be declared inside a \u003ccode\u003eredis_conf\u003c/code\u003e dictionnary (see example below)\n\n## :arrows_counterclockwise: Dependencies\n\ncommunity.general \u003e= 2.0.0\n\n## :pencil2: Example Playbook\n\n* #### Standalone scenario\n\n```yaml\n---\n- hosts: all\n  roles:\n    - role: claranet.redis\n```\n\n* #### Previous release scenario\n\n```yaml\n---\n- hosts: all\n  vars:\n    redis_server_version: \"6:7.0\"\n  roles:\n    - role: claranet.redis\n```\n* #### Password scenario\n\n```yaml\n---\n- hosts: all\n  vars:\n    redis_server_password: \"foobar\"\n  roles:\n    - role: claranet.redis\n```\n* #### Custom configuration scenario\n\n```yaml\n---\n- hosts: all\n  vars:\n    redis_conf:\n      loglevel: \"warning\"\n  roles:\n    - role: claranet.redis\n```\n\nThe available parameters for each release of redis can be found in the self documented configuration files available [here](https://redis.io/docs/management/config/)\n\n* #### Multi-instance scenario\n\n```yaml\n---\n- name: First instance\n  hosts: all\n  vars:\n    redis_server_version: \"6:7.0.7\"\n  roles:\n    - role: claranet.redis\n\n- name: Second instance\n  hosts: all\n  vars:\n    redis_server_version: \"6:7.0.7\"\n    redis_server_port: 6378\n  roles:\n    - role: claranet.redis\n```\nIf installing a previous release of redis, both instances should be the same version\n\n* #### Master slave scenario\n\n**inventory**\n\n```yaml\n---\nall:\n  children:\n    redis:\n      hosts:\n        master:\n          redis_role: master\n        slave-01:\n          redis_role: replica\n        slave-02:\n          redis_role: replica\n```\n\n**playbook**\n\n```yaml\n---\n- hosts: all\n  roles:\n    - role: claranet.redis\n```\n\n* #### Sentinel scenario\n\n**inventory**\n\n```yaml\n---\nall:\n  children:\n    redis:\n      hosts:\n        master:\n          redis_role: master\n        slave-01:\n          redis_role: replica\n        slave-02:\n          redis_role: replica\n```\n\n**playbook**\n\n```yaml\n---\n- hosts: all\n  vars:\n    redis_sentinel_enabled: true\n  roles:\n    - role: claranet.redis\n```\n\n## :closed_lock_with_key: [Hardening](HARDENING.md)\n\n## :heart_eyes_cat: [Contributing](CONTRIBUTING.md)\n\n## :copyright: [License](LICENSE)\n\n[Mozilla Public License Version 2.0](https://www.mozilla.org/en-US/MPL/2.0/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaranet%2Fansible-role-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclaranet%2Fansible-role-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaranet%2Fansible-role-redis/lists"}