Skip to content

Commit

Permalink
Add tasks to create icingadb-redis log directory
Browse files Browse the repository at this point in the history
Icinga's packages no longer create /var/log/icingadb-redis/ since
logging moved to the journal by default. If logging to a file is needed,
the according directory has to be created beforehand.

Fixes #298
  • Loading branch information
Donien committed Jul 4, 2024
1 parent abc3e40 commit 9ddfaa1
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelogs/fragments/fix_issue_298.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- Icinga's packages no longer create '/var/log/icingadb-redis/'. Added tasks that create a log directory based on `icingadb_redis_logfile` (#298).
10 changes: 10 additions & 0 deletions roles/icingadb_redis/tasks/install_on_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@
name: "{{ item }}"
state: present
loop: "{{ icingadb_redis_packages }}"

- name: Debian - Ensure log directory exists
when:
- icingadb_redis_logfile != ""
ansible.builtin.file:
path: "{{ icingadb_redis_logfile | dirname }}"
state: directory
owner: "{{ icingadb_redis_user }}"
group: "adm"
mode: "2750"
10 changes: 10 additions & 0 deletions roles/icingadb_redis/tasks/install_on_redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@
name: "{{ item }}"
state: present
loop: "{{ icingadb_redis_packages }}"

- name: RedHat - Ensure log directory exists
when:
- icingadb_redis_logfile != ""
ansible.builtin.file:
path: "{{ icingadb_redis_logfile | dirname }}"
state: directory
owner: "{{ icingadb_redis_user }}"
group: "{{ icingadb_redis_user }}"
mode: "0750"
10 changes: 10 additions & 0 deletions roles/icingadb_redis/tasks/install_on_suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@
community.general.zypper:
name: "{{ icingadb_redis_packages }}"
state: present

- name: Suse - Ensure log directory exists
when:
- icingadb_redis_logfile != ""
ansible.builtin.file:
path: "{{ icingadb_redis_logfile | dirname }}"
state: directory
owner: "{{ icingadb_redis_user }}"
group: "{{ icingadb_redis_user }}"
mode: "0750"
2 changes: 1 addition & 1 deletion roles/icingadb_redis/templates/icingadb-redis.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tcp-keepalive {{ icingadb_redis_tcp_keepalive }}
supervised {{ icingadb_redis_supervised }}
pidfile {{ icingadb_redis_pidfile }}
loglevel {{ icingadb_redis_loglevel }}
logfile {{ icingadb_redis_logfile }}
logfile "{{ icingadb_redis_logfile }}"
# syslog-enabled no
# syslog-ident redis
# syslog-facility local0
Expand Down

0 comments on commit 9ddfaa1

Please sign in to comment.