Skip to content

Commit b12efef

Browse files
committed
Splitted the task that installs Redis on Debian/Ubuntu into two.
This was done to avoid using Jinja2's conditionals in the playbook, which is discouraged.
1 parent 4023fa3 commit b12efef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tasks/main.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,20 @@
1919
when: ansible_os_family == "RedHat"
2020

2121
- name: Install the Redis packages
22+
apt: name={{ item }} state=present update_cache=yes
23+
with_items: redis_ubuntu_pkg
24+
environment: env
25+
when: ansible_os_family == "Debian" and not redis_debian_backports
26+
27+
- name: Install the Redis packages
2228
apt:
2329
name: "{{ item }}"
2430
state: present
2531
update_cache: yes
26-
default_release: "{{ ansible_distribution_release + '-backports' if redis_debian_backports else ansible_distribution_release }}"
32+
default_release: "{{ ansible_distribution_release }}-backports"
2733
with_items: redis_ubuntu_pkg
2834
environment: env
29-
when: ansible_os_family == "Debian"
35+
when: ansible_os_family == "Debian" and redis_debian_backports
3036

3137
- name: Copy the redis configuration file
3238
template: src=redis.conf.j2 dest={{ redis_conf_dest }}

0 commit comments

Comments
 (0)