Skip to content

Update default nginx version to 1.24 - #43

Merged
FrankApiyo merged 17 commits into
masterfrom
update-default-nginx-version-to-1.24
Jun 30, 2026
Merged

Update default nginx version to 1.24#43
FrankApiyo merged 17 commits into
masterfrom
update-default-nginx-version-to-1.24

Conversation

@FrankApiyo

@FrankApiyo FrankApiyo commented Oct 18, 2023

Copy link
Copy Markdown
Member

TODO

  • Update tests

@FrankApiyo
FrankApiyo force-pushed the update-default-nginx-version-to-1.24 branch 8 times, most recently from 8941357 to 83d6c79 Compare May 3, 2024 09:44
@FrankApiyo
FrankApiyo force-pushed the update-default-nginx-version-to-1.24 branch from 83d6c79 to 35219bb Compare May 3, 2024 09:54
Sites that use uwsgi_pass include `uwsgi_params` (e.g. the onadata API
nginx config), which requires the file to exist under the nginx config
directory. Add a task to copy a bundled uwsgi_params file into
{{ nginx_dir }}/uwsgi_params and restart nginx on change.
@FrankApiyo
FrankApiyo force-pushed the update-default-nginx-version-to-1.24 branch from 3bc11a1 to 4c9ef0b Compare June 30, 2026 12:19
@FrankApiyo
FrankApiyo requested review from manutarus and ukanga June 30, 2026 12:23
ngx_http_auth_request_module has shipped in nginx core since 1.5.4, so build
it with the --with-http_auth_request_module configure flag instead of fetching
the obsolete standalone source from mdounin.ru. That host frequently returns
503 and was the cause of the failing Molecule CI run.

Also clear assorted CI warnings surfaced in the logs:
- bump actions/checkout v2 -> v4 (Node 20 deprecation)
- install nginx build deps in a single apt call (drops the squash_actions
  with_items deprecation)
- replace `wget` shell tasks with the get_url module (openssl source and the
  libssl1.1 deb), removing the command/wget warnings
The GeoIP DB download/unzip tasks ran whenever the module was compiled in,
even though nginx_geoip defaults to 'off'. That pulled deprecated databases
from unreliable third-party hosts (centminmod.com now 403s CI runners,
returning HTML that breaks gunzip). Gate the downloads and unarchive steps on
nginx_geoip being enabled, and install the GeoIP libs via a single apt call
(drops the squash_actions with_items deprecation).
- molecule: test on ubuntu 22.04/24.04/26.04 (default + install-only scenarios)
  using the pre-built geerlingguy systemd images with cgroupns_mode=host and a
  /tmp-rooted remote_tmp, which fixes the "~/.ansible/tmp" unreachable errors
- package install for >=22.04 (the source build / bundled OpenSSL 1.0.2h does
  not compile on modern Ubuntu); derive the nginx.org repo codename from
  ansible_distribution_release instead of hardcoding focal
- modernize apt key handling: fetch the nginx.org signing key into
  /etc/apt/keyrings and reference it via signed-by (apt-key is gone in 24.04+)
- drop dead 18.04/20.04 hacks: the libssl1.1 deb downgrade, the OpenSSL 1.0.2h
  source path (http_ssl_module.yml), and the libssl1.1 source build dependency
- meta: advertise jammy/noble/resolute
onaio/molecule-action pins molecule 3.0.4, whose docker driver does not pass
cgroupns_mode, so systemd (cgroup v2) instances - every Ubuntu >=22.04 - came
up UNREACHABLE. Run molecule directly on the ubuntu-latest runner with a
current toolchain (molecule + molecule-plugins[docker] + pytest-testinfra),
whose docker driver forwards cgroupns_mode, while keeping the testinfra
verifier and existing tests.

- workflow: install molecule/ansible/testinfra + community.docker, run
  yamllint/flake8 as explicit steps, then molecule test per scenario
- molecule.yml: drop the now-removed top-level lint block, provisioner.lint,
  and the lint test-sequence step (lint runs in the workflow instead)
Modern molecule does not add the project's parent directory to the roles
path, so converge.yml's 'role: ansible-nginx' could not be found. Point
ANSIBLE_ROLES_PATH at ${MOLECULE_PROJECT_DIRECTORY}/.. (the checkout dir is
named ansible-nginx) plus ~/.ansible/roles for the galaxy dependencies.
The role's galaxy dependencies use modules from community.general (e.g.
zypper), which ansible-core does not bundle, so syntax-check failed to resolve
them. Install the full 'ansible' distribution (as the old molecule image did),
which ships community.general/community.docker/ansible.posix.
Gate the uwsgi_params file behind nginx_uwsgi_app (default false) so it is
only deployed for sites that use uwsgi_pass, rather than on every nginx host.
Set nginx_uwsgi_app: true in both converge playbooks so the role's own CI
covers the uwsgi_params install, and assert /etc/nginx/uwsgi_params exists.
Default nginx_uwsgi_app to true so the uwsgi_params file is installed out of
the box; consumers that don't serve a uWSGI app can set it to false.
The ssl on; directive it used to guard was removed (not valid in nginx 1.26),
leaving an empty {% if %}{% endif %} block. Remove the dead wrapper too.
Folds in #44.
@FrankApiyo
FrankApiyo merged commit 328a6d2 into master Jun 30, 2026
2 checks passed
@FrankApiyo
FrankApiyo deleted the update-default-nginx-version-to-1.24 branch June 30, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants