additional course material RH294
Olaf Bohlen
2020-08-20 1de6236f80a879ca110981fe0e5c0c05c521225b
commit | author | age
1de623 1 # Ansible Role: Redis
OB 2
3 [![Build Status](https://travis-ci.org/geerlingguy/ansible-role-redis.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-redis)
4
5 Installs [Redis](http://redis.io/) on Linux.
6
7 ## Requirements
8
9 On RedHat-based distributions, requires the EPEL repository (you can simply add the role `geerlingguy.repo-epel` to install ensure EPEL is available).
10
11 ## Role Variables
12
13     redis_enablerepo: epel
14
15 (Used only on RHEL/CentOS) The repository to use for Redis installation.
16
17 Available variables are listed below, along with default values (see `defaults/main.yml`):
18
19     redis_port: 6379
20     redis_bind_interface: 127.0.0.1
21
22 Port and interface on which Redis will listen. Set the interface to `0.0.0.0` to listen on all interfaces.
23
24     redis_unixsocket: ''
25
26 If set, Redis will also listen on a local Unix socket.
27
28     redis_timeout: 300
29
30 Close a connection after a client is idle `N` seconds. Set to `0` to disable timeout.
31
32     redis_loglevel: "notice"
33     redis_logfile: /var/log/redis/redis-server.log
34
35 Log level and log location (valid levels are `debug`, `verbose`, `notice`, and `warning`).
36
37     redis_databases: 16
38
39 The number of Redis databases.
40
41     # Set to an empty set to disable persistence (saving the DB to disk).
42     redis_save:
43       - 900 1
44       - 300 10
45       - 60 10000
46
47 Snapshotting configuration; setting values in this list will save the database to disk if the given number of seconds (e.g. `900`) and the given number of write operations (e.g. `1`) have occurred.
48
49     redis_rdbcompression: "yes"
50     redis_dbfilename: dump.rdb
51     redis_dbdir: /var/lib/redis
52
53 Database compression and location configuration.
54
55     redis_maxmemory: 0
56
57 Limit memory usage to the specified amount of bytes. Leave at 0 for unlimited.
58
59     redis_maxmemory_policy: "noeviction"
60
61 The method to use to keep memory usage below the limit, if specified. See [Using Redis as an LRU cache](http://redis.io/topics/lru-cache).
62
63     redis_maxmemory_samples: 5
64
65 Number of samples to use to approximate LRU. See [Using Redis as an LRU cache](http://redis.io/topics/lru-cache).
66
67     redis_appendonly: "no"
68
69 The appendonly option, if enabled, affords better data durability guarantees, at the cost of slightly slower performance.
70
71     redis_appendfsync: "everysec"
72
73 Valid values are `always` (slower, safest), `everysec` (happy medium), or `no` (let the filesystem flush data when it wants, most risky).
74
75     # Add extra include files for local configuration/overrides.
76     redis_includes: []
77
78 Add extra include file paths to this list to include more/localized Redis configuration.
79
80 The redis package name for installation via the system package manager. Defaults to `redis-server` on Debian and `redis` on RHEL.
81
82     redis_package_name: "redis-server"
83
84 (Default for RHEL shown) The redis package name for installation via the system package manager. Defaults to `redis-server` on Debian and `redis` on RHEL.
85
86     redis_requirepass: ""
87
88 Set a password to require authentication to Redis. You can generate a strong password using `echo "my_password_here" | sha256sum`.
89
90     redis_disabled_commands: []
91
92 For extra security, you can disable certain Redis commands (this is especially important if Redis is publicly accessible). For example:
93
94     redis_disabled_commands:
95       - FLUSHDB
96       - FLUSHALL
97       - KEYS
98       - PEXPIRE
99       - DEL
100       - CONFIG
101       - SHUTDOWN
102
103 ## Dependencies
104
105 None.
106
107 ## Example Playbook
108
109     - hosts: all
110       roles:
111         - role: geerlingguy.redis
112
113 ## License
114
115 MIT / BSD
116
117 ## Author Information
118
119 This role was created in 2014 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).