Skip to content

Commit db7f16a

Browse files
committed
[fix] Fix failing redis installation on Ubuntu 20.04
- Increased minor versions
1 parent 29922d6 commit db7f16a

4 files changed

Lines changed: 29 additions & 31 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
- name: Set default python version
3636
run: sudo update-alternatives --install /usr/bin/python python ${pythonLocation}/bin/python3.8 2
3737

38-
3938
- name: Install python dependencies
4039
run: |
4140
pip install molecule[docker,ansible] molecule-docker yamllint ansible-lint docker openwisp-utils[qa]
@@ -47,7 +46,10 @@ jobs:
4746
openwisp-qa-check --skip-isort --skip-flake8 --skip-checkmigrations --skip-black
4847
4948
- name: Tests
50-
run: molecule test
49+
run: |
50+
mkdir -p ~/.ansible/roles
51+
ln -s $GITHUB_WORKSPACE ~/.ansible/roles/openwisp.openwisp2
52+
molecule test
5153
env:
5254
ROLE_NAME: openwisp2
5355
PY_COLORS: '1'

defaults/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ openwisp2_monitoring: true
88
openwisp2_radius: false
99
openwisp2_controller_subnet_division: false
1010
openwisp2_radius_urls: "{{ openwisp2_radius }}"
11-
openwisp2_controller_version: "openwisp-controller~=1.0.0"
11+
openwisp2_controller_version: "openwisp-controller~=1.0.1"
1212
openwisp2_network_topology_version: "openwisp-network-topology~=1.0.0"
1313
openwisp2_firmware_upgrader_version: "openwisp-firmware-upgrader~=1.0.0"
1414
openwisp2_monitoring_version: "openwisp-monitoring~=1.0.0"
15-
openwisp2_radius_version: "openwisp-radius~=1.0.0"
15+
openwisp2_radius_version: "openwisp-radius~=1.0.1"
1616
openwisp2_django_version: "{{ 'django~=4.0.0' if ansible_distribution_release|string in ['focal', 'bullseye'] else 'django~=3.2.13' }}"
1717
openwisp2_extra_python_packages:
1818
- bpython

tasks/apt.yml

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,35 +36,14 @@
3636
register: result
3737
until: result is success
3838

39-
- name: Install redis 6 if available
39+
- name: Install redis
4040
apt:
41-
name: "redis-server=5:6*"
41+
name: redis-server
4242
notify:
4343
- reload systemd
4444
- start redis
45-
ignore_errors: true
46-
register: use_redis6
4745
when: openwisp2_redis_install
4846

49-
- name: Install redis 5 if available
50-
apt:
51-
name: "redis-server=5:5*"
52-
notify:
53-
- reload systemd
54-
- start redis
55-
ignore_errors: true
56-
register: use_redis5
57-
when: openwisp2_redis_install and use_redis6 is failed
58-
59-
- name: Install redis 4 (fallback)
60-
when: openwisp2_redis_install and (use_redis5 is failed and use_redis6 is failed)
61-
apt:
62-
name: "redis-server=5:4*"
63-
register: use_redis4
64-
notify:
65-
- reload systemd
66-
- start redis
67-
6847
# On the newer versions of redis, by default redis
6948
# binds to localhost on ipv6 address which wouldn't
7049
# let the service start if the server doesn't have
@@ -77,6 +56,7 @@
7756
regexp: '^bind 127\.0\.0\.1 ::1'
7857
line: 'bind 127.0.0.1'
7958
backrefs: true
59+
ignore_errors: true
8060

8161
- name: start redis
8262
when: openwisp2_redis_install
@@ -189,7 +169,7 @@
189169
- name: Set python 3.7
190170
set_fact:
191171
openwisp2_python: python3.7
192-
when: openwisp2_should_install_python_37 == "True\n"
172+
when: openwisp2_should_install_python_37 == true
193173

194174
- name: Install python3 packages
195175
apt:

tasks/pip.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,27 @@
5454
tags:
5555
- molecule-idempotence-notest
5656

57-
- name: Pin channels_redis to 2.4 for redis 4 compatibility
58-
when: use_redis4 is defined and use_redis4 is succeeded
57+
- name: Install channels-redis~=3.4.0
58+
when: ansible_distribution_release not in ['buster', 'bionic']
5959
pip:
6060
name:
61-
- channels_redis~=2.4
61+
- channels-redis~=3.4.0
62+
state: latest
63+
virtualenv: "{{ virtualenv_path }}"
64+
virtualenv_python: "{{ openwisp2_python }}"
65+
virtualenv_site_packages: true
66+
environment:
67+
SETUPTOOLS_USE_DISTUTILS: stdlib
68+
retries: 1
69+
delay: 10
70+
register: result
71+
until: result is success
72+
73+
- name: Install channels-redis~=2.4.0 for redis 4 compatibility
74+
when: ansible_distribution_release in ['buster', 'bionic']
75+
pip:
76+
name:
77+
- channels-redis~=2.4.0
6278
state: latest
6379
virtualenv: "{{ virtualenv_path }}"
6480
virtualenv_python: "{{ openwisp2_python }}"

0 commit comments

Comments
 (0)