Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSUSE support #75

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ redis_includes: []

Add extra include file paths to this list to include more/localized Redis configuration.

The redis package name for installation via the system package manager. Defaults to `redis-server` on Debian and `redis` on RHEL.
The redis package name for installation via the system package manager. Defaults to `redis-server` on Debian and `redis` on RHEL/OpenSUSE.

```yaml
redis_package_name: "redis-server"
```

(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.
(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/OpenSUSE.

```yaml
redis_requirepass: ""
Expand Down
3 changes: 3 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ galaxy_info:
- name: Fedora
versions:
- all
- name: opensuse
versions:
- 15.4
- name: Debian
versions:
- all
Expand Down
3 changes: 3 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
- include_tasks: setup-Archlinux.yml
when: ansible_os_family == 'Archlinux'

- include_tasks: setup-Suse.yml
when: ansible_os_family == 'Suse'

- name: Ensure Redis is running and enabled on boot.
service: "name={{ redis_daemon }} state=started enabled=yes"
15 changes: 15 additions & 0 deletions tasks/setup-Suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- name: Ensure Redis is installed.
package:
name: "{{ redis_package }}"
state: present

- name: Ensure Redis configuration has the rights as advertised by the SuSE configuration.
ansible.builtin.file:
path: "{{ redis_conf_path }}"
mode: "{{ redis_conf_mode }}"
owner: root
group: redis

- name: execute installation of data folder as recommended by SuSE
ansible.builtin.command: "install -d -o redis -g redis -m 0750 /var/lib/redis/{{ redis_instancename }}/"
2 changes: 1 addition & 1 deletion templates/redis.conf.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# {{ ansible_managed }}

daemonize yes
pidfile /var/run/redis/{{ redis_daemon }}.pid
pidfile {{ redis_pidfile }}
port {{ redis_port }}
bind {{ redis_bind_interface }}

Expand Down
1 change: 1 addition & 0 deletions vars/Archlinux.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
__redis_package: redis
redis_daemon: redis
redis_pidfile: /var/run/redis/{{ redis_daemon }}.pid
redis_conf_path: /etc/redis.conf
1 change: 1 addition & 0 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
__redis_package: redis-server
redis_daemon: redis-server
redis_pidfile: /var/run/redis/{{ redis_daemon }}.pid
redis_conf_dir_mode: 02770
redis_conf_path: /etc/redis/redis.conf
redis_conf_mode: 0640
2 changes: 2 additions & 0 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
__redis_package: redis
redis_daemon: redis
redis_daemonize: "yes"
redis_pidfile: /var/run/redis/{{ redis_daemon }}.pid
redis_conf_dir_mode: 0750
redis_conf_path: /etc/redis/redis.conf
redis_conf_mode: 0644
8 changes: 8 additions & 0 deletions vars/Suse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
__redis_package: redis
redis_instancename: default
redis_daemon: "redis@{{ redis_instancename }}"
redis_pidfile: "/var/run/redis/{{ redis_instancename }}.pid"
# redis_suse_logfile: "/var/log/redis/{{ redis_instancename }}.log"
redis_conf_path: "/etc/redis/{{ redis_instancename }}.conf"
redis_conf_mode: 0640