Skip to content

Commit

Permalink
redis: Add redis_log_level parameter and reduce default verbosity.
Browse files Browse the repository at this point in the history
  • Loading branch information
JGoutin committed Aug 26, 2024
1 parent 947a21f commit 23225b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 4 additions & 3 deletions roles/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ Security:

### Optional

| Name | Default Value | Description |
|--------------|---------------|--------------------------------------------------------|
| `redis_user` | | If specified, allow this Unix user to access to Redis. |
| Name | Default Value | Description |
|-------------------|---------------|--------------------------------------------------------|
| `redis_log_level` | `"warning"` | Redis log level in the journal. |
| `redis_user` | | If specified, allow this Unix user to access to Redis. |

## Example Playbook

Expand Down
2 changes: 2 additions & 0 deletions roles/redis/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
redis_log_level: warning
4 changes: 3 additions & 1 deletion roles/redis/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- name: Ensure Redis is configured
ansible.builtin.lineinfile:
path: /etc/redis/redis.conf
regexp: '^#?\\s*{{ item.option }}\s'
regexp: '^#?\s*{{ item.option }}\s'
line: '{{ item.option }} {{ item.value }}'
with_items:
- option: unixsocket
Expand All @@ -38,6 +38,8 @@
value: "yes"
- option: logfile
value: "/dev/null"
- option: loglevel
value: "{{ redis_log_level }}"

- name: Ensure Redis service parent directory is present
ansible.builtin.file:
Expand Down

0 comments on commit 23225b0

Please sign in to comment.