You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Consolidate Redis roles
* Use handlers in redis role
Separate out basic configuration tasks in redis role
Fix issue with determining the Redis version when installing from source
* Update Redis readme
* Remove redis_replication and redis_auth references
---------
Co-authored-by: Steven Schattenberg <[email protected]>
Copy file name to clipboardExpand all lines: docs/redis_guide.md
+15-55Lines changed: 15 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,18 @@
1
1
# Overview
2
2
3
-
The playbook and roles in this section install and configure Redis for the Itential Automation Platform. There are currently three Redis-related roles:
3
+
The playbook and role in this section install and configure Redis for the Itential Automation Platform. There is one Redis-related role:
4
4
5
-
*`redis` – Installs Redis and performs a base configuration.
*`redis` – Installs Redis and performs a base configuration. Optionally configures authentication and replication.
8
6
9
-
# Roles
7
+
# Redis Role
10
8
11
-
## Redis Role
9
+
## Base Install
12
10
13
-
The `redis` role performs a base install of Redis including any OS packages required. It will compile and install any custom SELinux profiles. It creates the appropriate Linux users, directories, log files, and systemd services. It uses a template to generate a configuration file with some potential features available in other roles commented out. It will start the redis service when complete.
11
+
The `redis` role performs a base install of Redis including any OS packages required. It will compile and install any custom SELinux profiles. It creates the appropriate Linux users, directories, log files, and systemd services. It uses a template to generate a configuration file with some potential features available in other roles commented out. It will start the Redis service when complete.
14
12
15
-
## Redis Auth Role
13
+
## Authentication
16
14
17
-
The `redis_auth` role performs tasks to require authentication (username and password) when communicating with the Redis server. It adjusts the Redis config file and adds each of the required users and applies appropriate ACLs (see table). The "default" Redis user is disabled. It modifies the Redis config file to use the appropriate user while doing replication. It adjusts the Sentinel config file to enable the correct Sentinel user to monitor the redis cluster, if required. It disables the default user in both Redis and Redis Sentinel. It will restart the redis service and the Sentinel service (if required) when complete.
15
+
Optionally, the `redis` role performs tasks to require authentication (username and password) when communicating with the Redis server. It adjusts the Redis config file and adds each of the required users and applies appropriate ACLs (see table). The "default" Redis user is disabled. It modifies the Redis config file to use the appropriate user while doing replication. It adjusts the Sentinel config file to enable the correct Sentinel user to monitor the redis cluster, if required. It disables the default user in both Redis and Redis Sentinel.
18
16
19
17
More info on Redis authorization: https://redis.io/docs/manual/security/
20
18
@@ -24,12 +22,13 @@ More info on Redis authorization: https://redis.io/docs/manual/security/
24
22
| itential | itential | Has access to all keys, all channels, and all commands except: -asking -cluster -readonly -readwrite -bgrewriteaof -bgsave -failover -flushall -flushdb -psync -replconf -replicaof -save -shutdown -sync
25
23
| repluser | repluser | Has access to the minimum set of commands to perform replication.
26
24
| sentineluser | sentineluser | Has access to the minimum set of commands to perform sentinel monitoring.
25
+
| prometheus | prometheus | Has access to the minimum set of commands to perform Redis and Sentinel monitoring with Prometheus. Required by the optional redis_exporter service.
27
26
28
27
:::(Warning) (⚠ Warning: ) It is assumed that these default passwords will be changed to meet more rigorous standards. These are intended to be defaults strictly used just for ease of the installation. It is highly recommended that sensitive data be encrypted using Ansible Vault.
29
28
30
-
## Redis Replication Role
29
+
## Replication
31
30
32
-
The `redis_replication` role performs the steps required to create a Redis replica set. It uses a template to generate a Redis Sentinel config file. It modifies the Redis config file to turn off protected-mode. It assumes that the first host defined in the inventory file is the initial primary. It will update the config file for the non-primary Redis servers to replicate from the primary using hostname. It will restart Redis and Redis Sentinel when complete.
31
+
Optionally, the `redis` role performs the steps required to create a Redis replica set. It uses a template to generate a Redis Sentinel config file. It modifies the Redis config file to turn off protected-mode. It assumes that the first host defined in the inventory file is the initial primary. It will update the config file for the non-primary Redis servers to replicate from the primary using hostname. It will start Redis Sentinel when complete.
33
32
34
33
For more information on Redis replication: https://redis.io/docs/manual/replication/
35
34
@@ -57,15 +56,15 @@ The following table lists the default variables that are shared between the Redi
57
56
58
57
| Variable | Group | Type | Description | Default Value
| `redis_auth` | `all` | Boolean | Flag to enable Redis authentication. When set to to `true`, the `redis_auth` role will be executed. | `false`
61
-
| `redis_replication` | `all` | Boolean | Flag to enable Redis replication. When set to `true`, the `redis_replication` role will be executed. | `false`
59
+
| `redis_auth` | `all` | Boolean | Flag to enable Redis authentication. When set to to `true`, Redis authentication will be configured. | `false`
60
+
| `redis_replication` | `all` | Boolean | Flag to enable Redis replication. When set to `true`, Redis replication will be configured and the Redis Sentinel service started. | `false`
62
61
| `redis_tls` | `all` | Boolean | Flag to enable TLS connections. | `false`
63
62
64
63
## Redis Role Variables
65
64
66
65
The variables in this section may be overridden in the inventory in the `redis` group vars.
67
66
68
-
The following table lists the default variables located in `roles/redis/defaults/main.yml`.
67
+
The following table lists the default variables located in `roles/redis/defaults/main/redis.yml` and `roles/redis/defaults/main/sentinel.yml`.
69
68
70
69
| Variable | Group | Type | Description | Default Value
@@ -82,23 +81,8 @@ The following table lists the default variables located in `roles/redis/defaults
82
81
| `redis_bind_ipv6` | `redis` | Boolean | Flag to enable IPv6. | `true`
83
82
| `redis_bind_addr_source` | `redis` | String | The bind address source. Will default to the Ansible `inventory_hostname` unless explicitly set to `default_ipv4_address`. | `inventory_hostname`
84
83
| `redis_bind_addrs` | `redis` | String | A space-separated list of hostnames/IP addresses on which Redis listeners will be created. If `redis_bind_ipv6` is set to `true`, `::1` will be added to the addresses. The `redis_bind_addr_source` will also be added to the addresses. | `127.0.0.1`
85
-
| `iap_redis_packages` | `redis` | List of Strings | The Linux packages to install. | `redis`<br>`jemalloc`
86
84
| `redis_install_method` | `redis` | String | The method to use to install Redis.<br>Set to `remi_repo` to use the Remi repo.<br>Set to `source` to install from source. | `remi_repo`
87
-
| `epel_repo_url` | `redis` | String | The URL of the EPEL repo RPM.<br>Note: this is only used when the `redis_install_method` is set to `remi_repo`. | `https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm`
88
-
89
-
90
-
## Redis Auth Role Variables
91
-
92
-
There are no default variables for the Redis Auth role other than the Redis common default variables.
93
-
94
-
## Redis Replication Role Variables
95
-
96
-
The variables in this section may be overridden in the inventory in the `redis` group vars.
97
-
98
-
The following table lists the default variables located in `roles/redis_replication/defaults/main.yml`.
99
-
100
-
| Variable | Group | Type | Description | Default Value
| `redis_epel_repo_url` | `redis` | String | The URL of the EPEL repo RPM.<br>Note: this is only used when the `redis_install_method` is set to `remi_repo`. | `https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm`
102
86
| `redis_sentinel_conf_file` | `redis` | String | The location of the Redis Sentinel configuration file. | `{{ redis_conf_path }}/sentinel.conf`
103
87
| `redis_sentinel_port` | `redis` | Integer | The Redis Sentinel listen port | `26379`
104
88
@@ -165,32 +149,8 @@ all:
165
149
166
150
# Running the Playbook
167
151
168
-
To execute all Redis roles, run the `redis` playbook:
152
+
To execute the Redis role, run the `redis` playbook:
You can also run select Redis roles by using the following tags:
175
-
176
-
*`redis_install`
177
-
*`redis_auth`
178
-
*`redis_replication`
179
-
180
-
To execute only the `redis` role (skipping the `redis_auth` and `redis_replication` roles), run the `itential.deployer.redis` playbook with the `redis_install` tag:
To execute only the Redis Auth role (skipping the Redis and Redis Replication roles), run the `itential.deployer.redis` playbook with the `redis_auth` tag:
To execute only the Redis Replication role (skipping the Redis and Redis Auth roles), run the `itential.deployer.redis` playbook with the `redis_replication` tag:
0 commit comments