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 - name: Restart redis-server
vars: vars:
_daemon: "{{ 'redis' if ansible_distribution == 'CentOS' else 'redis-server' }}" _daemon: "{{ 'redis' if ansible_facts['distribution'] == 'CentOS' else 'redis-server' }}"
service: service:
name: "{{ _daemon }}" name: "{{ _daemon }}"
state: restarted state: restarted

View File

@@ -3,7 +3,7 @@
- name: (redis-server.yml) Set var '_redis_conf' - name: (redis-server.yml) Set var '_redis_conf'
set_fact: 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 - name: (redis-server.yml) update
apt: apt:
@@ -54,7 +54,7 @@
state: latest state: latest
update_cache: yes update_cache: yes
when: when:
- ansible_os_family == "RedHat" - ansible_facts["os_family"] == "RedHat"
- ansible_distribution == "CentOS" or ansible_distribution == "Fedora" - ansible_distribution == "CentOS" or ansible_distribution == "Fedora"
tags: tags:
- redis-server - redis-server