Skip to content

Commit 4023fa3

Browse files
committed
Added support for using Debian/Ubuntu backports repository.
To use the backports repository, user has to set variable: 'redis_debian_backports' to 'True'.
1 parent b185fea commit 4023fa3

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

defaults/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
---
22

3+
######################
4+
# Playbook variables #
5+
######################
6+
# Whether to use Debian/Ubuntu backports repository when installing Redis
7+
redis_debian_backports: False
8+
9+
###################
10+
# Redis variables #
11+
###################
312
redis_bind_address: "0.0.0.0"
413
redis_port: 6379
514
redis_syslog_enabled: "yes"

tasks/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
when: ansible_os_family == "RedHat"
2020

2121
- name: Install the Redis packages
22-
apt: name={{ item }} state=present update_cache=yes
22+
apt:
23+
name: "{{ item }}"
24+
state: present
25+
update_cache: yes
26+
default_release: "{{ ansible_distribution_release + '-backports' if redis_debian_backports else ansible_distribution_release }}"
2327
with_items: redis_ubuntu_pkg
2428
environment: env
2529
when: ansible_os_family == "Debian"

0 commit comments

Comments
 (0)