replace more deprecated code.

This commit is contained in:
2026-02-01 14:49:41 +01:00
parent 6b2dd6b0bf
commit a41467f6d4
2 changed files with 3 additions and 3 deletions

View File

@@ -64,7 +64,7 @@
- name: Restart redis-server
vars:
_daemon: "{{ 'redis' if ansible_distribution == 'CentOS' else 'redis-server' }}"
_daemon: "{{ 'redis' if ansible_facts['distribution'] == 'CentOS' else 'redis-server' }}"
service:
name: "{{ _daemon }}"
state: restarted

View File

@@ -3,7 +3,7 @@
- name: (redis-server.yml) Set var '_redis_conf'
set_fact:
_redis_conf: "{{ '/etc/redis.conf' if ansible_distribution == 'CentOS' else '/etc/redis/redis.conf' }}"
_redis_conf: "{{ '/etc/redis.conf' if ansible_facts['distribution'] == 'CentOS' else '/etc/redis/redis.conf' }}"
- name: (redis-server.yml) update
apt:
@@ -54,7 +54,7 @@
state: latest
update_cache: yes
when:
- ansible_os_family == "RedHat"
- ansible_facts["os_family"] == "RedHat"
- ansible_distribution == "CentOS" or ansible_distribution == "Fedora"
tags:
- redis-server