Skip to content

Commit 5dbbe39

Browse files
authored
Always update NGINX dependencies to the latest available version (#452)
1 parent f2b8785 commit 5dbbe39

File tree

6 files changed

+27
-8
lines changed

6 files changed

+27
-8
lines changed

CHANGELOG.md

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

3+
## 0.21.2 (Unreleased)
4+
5+
ENHANCEMENTS:
6+
7+
* Change Ansible Lint exceptions from using an ID identifier to a text identifier.
8+
* Move non NGINX specific dependencies from the role into the Molecule Dockerfile.
9+
10+
BUG FIXES:
11+
12+
Always update NGINX dependencies to the latest available version to avoid outdated dependency issues (e.g. outdated CA certificates).
13+
314
## 0.21.1 (September 29, 2021)
415

516
FEATURES:

molecule/common/Dockerfile.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ENV {{ var }} {{ value }}
1717
RUN \
1818
if [ $(command -v apt-get) ]; then \
1919
apt-get update \
20-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y aptitude bash ca-certificates curl iproute2 python3 python3-apt procps sudo systemd systemd-sysv vim \
20+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y aptitude bash curl dirmngr iproute2 python3 python3-apt procps sudo systemd systemd-sysv vim \
2121
&& apt-get clean; \
2222
elif [ $(command -v dnf) ]; then \
2323
dnf makecache \
@@ -34,10 +34,10 @@ RUN \
3434
&& zypper clean -a; \
3535
elif [ $(command -v apk) ]; then \
3636
apk update \
37-
&& apk add --no-cache bash ca-certificates curl openrc python3 sudo vim; \
37+
&& apk add --no-cache bash curl openrc python3 sudo vim; \
3838
echo 'rc_provide="loopback net"' >> /etc/rc.conf; \
3939
elif [ $(command -v xbps-install) ]; then \
4040
xbps-install -Syu \
41-
&& xbps-install -y bash ca-certificates iproute2 python3 sudo vim \
41+
&& xbps-install -y bash iproute2 python3 sudo vim \
4242
&& xbps-remove -O; \
4343
fi

molecule/default/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- name: Enable NGINX @CentOS-AppStream dnf modules
1818
shell:
1919
args:
20-
cmd: dnf module info nginx | grep -q 'Stream.*\[e\]' && echo -n ENABLED || dnf module enable -y nginx # noqa 204 303
20+
cmd: dnf module info nginx | grep -q 'Stream.*\[e\]' && echo -n ENABLED || dnf module enable -y nginx # noqa command-instead-of-module
2121
register: dnf_module_enable
2222
changed_when: dnf_module_enable.stdout != 'ENABLED'
2323
when: ansible_facts['os_family'] == "RedHat" and ansible_facts['distribution_major_version'] is version('8', '==')

tasks/prerequisites/install-dependencies.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,43 @@
33
apk:
44
name: "{{ nginx_alpine_dependencies }}"
55
update_cache: true
6+
state: latest # noqa package-latest
67
when: ansible_facts['os_family'] == "Alpine"
78

89
- name: (Debian/Ubuntu) Install dependencies
910
apt:
1011
name: "{{ nginx_debian_dependencies }}"
1112
update_cache: true
13+
state: latest # noqa package-latest
1214
when: ansible_facts['os_family'] == "Debian"
1315

1416
- name: (Amazon Linux/CentOS/Oracle Linux/RHEL) Install dependencies
1517
yum:
1618
name: "{{ nginx_redhat_dependencies }}"
19+
update_cache: true
20+
state: latest # noqa package-latest
1721
when: ansible_facts['os_family'] == "RedHat"
1822

1923
- name: (SLES) Install dependencies
2024
zypper:
2125
name: "{{ nginx_sles_dependencies }}"
26+
update_cache: true
27+
state: latest # noqa package-latest
2228
when: ansible_facts['os_family'] == "Suse"
2329

2430
- name: (FreeBSD) Install dependencies
2531
block:
2632
- name: (FreeBSD) Install dependencies using package(s)
2733
pkgng:
2834
name: "{{ nginx_freebsd_dependencies }}"
35+
state: latest # noqa package-latest
2936
when: nginx_bsd_install_packages | bool
3037

3138
- name: (FreeBSD) Install dependencies using port(s)
3239
portinstall:
3340
name: "{{ item }}"
3441
use_packages: "{{ nginx_bsd_portinstall_use_packages | default(omit) }}"
42+
state: latest # noqa package-latest
3543
loop: "{{ nginx_freebsd_dependencies }}"
3644
when: not nginx_bsd_install_packages | bool
3745
when: ansible_facts['distribution'] == "FreeBSD"

tasks/prerequisites/setup-selinux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
changed_when: false
8787

8888
- name: Import SELinux NGINX Plus module
89-
command: "semodule -i {{ nginx_selinux_tempdir }}/nginx-plus-module.pp" # noqa 503
89+
command: "semodule -i {{ nginx_selinux_tempdir }}/nginx-plus-module.pp" # noqa no-handler
9090
changed_when: false
9191
when: nginx_selinux_module.changed | bool
9292

vars/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ nginx_plus_default_repository_suse: "https://pkgs.nginx.com/plus/sles/{{ ansible
4444

4545
# Alpine dependencies
4646
nginx_alpine_dependencies: [
47-
'coreutils', 'openssl', 'pcre',
47+
'ca-certificates', 'coreutils', 'openssl', 'pcre',
4848
]
4949

5050
# Debian dependencies
5151
nginx_debian_dependencies: [
52-
'apt-transport-https', 'ca-certificates', 'dirmngr',
52+
'apt-transport-https', 'ca-certificates',
5353
]
5454

5555
# Red Hat dependencies
5656
nginx_redhat_dependencies: [
57-
'ca-certificates', 'openssl', 'yum-utils',
57+
'ca-certificates',
5858
]
5959

6060
# SLES dependencies

0 commit comments

Comments
 (0)