Skip to content

Commit 41aeda3

Browse files
authored
Add option to specify the version of NGINX to install (#177)
And remove outdated Debian Jessie Molecule tests
1 parent cca5dbb commit 41aeda3

File tree

8 files changed

+18
-12
lines changed

8 files changed

+18
-12
lines changed

defaults/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ nginx_start: true
1010
# Print NGINX configuration file to terminal after executing playbook.
1111
nginx_debug_output: false
1212

13-
# Specify which version of NGINX you want to install.
13+
# Specify which type of NGINX you want to install.
1414
# Options are 'opensource' or 'plus'.
1515
# Default is 'opensource'.
1616
nginx_type: opensource
17+
# Specify which version of NGINX you want to install.
18+
# Default is empty.
19+
# nginx_version: =19-1~bionic
1720

1821
# Specify repository origin for NGINX Open Source.
1922
# Options are 'nginx_repository' or 'os_repository'.

molecule/default/molecule.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ platforms:
1212
volume_mounts:
1313
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
1414
command: "/usr/sbin/init"
15-
- name: debian-jessie
16-
image: debian:jessie
1715
- name: debian-stretch
1816
image: debian:stretch
1917
- name: debian-buster

molecule/default/playbook.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
---
22
- name: Converge
33
hosts: all
4+
pre_tasks:
5+
- name: "Set repo if Debian"
6+
set_fact:
7+
version: "=1.17.4-1~{{ ansible_distribution_release }}"
8+
when: ansible_os_family == "Debian"
9+
- name: "Set repo if RedHat"
10+
set_fact:
11+
version: "-1.17.4-1.el{{ ansible_distribution_major_version }}.ngx"
12+
when: ansible_os_family == "RedHat"
413
roles:
514
- role: ansible-role-nginx
15+
vars:
16+
nginx_version: "{{ version }}"

molecule/stable_push/molecule.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ platforms:
1515
volume_mounts:
1616
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
1717
command: "/usr/sbin/init"
18-
- name: debian-jessie
19-
image: debian:jessie
2018
- name: debian-stretch
2119
image: debian:stretch
2220
- name: debian-buster

molecule/template_module/molecule.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ platforms:
1515
volume_mounts:
1616
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
1717
command: "/usr/sbin/init"
18-
- name: debian-jessie
19-
image: debian:jessie
2018
- name: debian-stretch
2119
image: debian:stretch
2220
- name: debian-buster

molecule/unit/molecule.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ platforms:
1212
volume_mounts:
1313
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
1414
command: "/usr/sbin/init"
15-
- name: debian-jessie
16-
image: debian:jessie
1715
- name: debian-stretch
1816
image: debian:stretch
1917
- name: debian-buster

tasks/opensource/install-oss.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
- name: "(Install: Debian/Ubuntu/CentOS/RedHat) Install NGINX"
1818
package:
19-
name: nginx
19+
name: "nginx{{ nginx_version | default('') }}"
2020
state: present
2121
when: ansible_os_family != "FreeBSD"
2222
notify: "(Handler: All OSs) Start NGINX"
@@ -32,7 +32,7 @@
3232

3333
- name: "(Install: Debian/Ubuntu/CentOS/RedHat/FreeBSD) Install NGINX"
3434
package:
35-
name: nginx
35+
name: "nginx{{ nginx_version | default('') }}"
3636
state: present
3737
when: nginx_install_from == "os_repository"
3838
notify: "(Handler: All OSs) Start NGINX"

tasks/plus/install-plus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818

1919
- name: "(Install: All OSs) Install NGINX Plus"
2020
package:
21-
name: nginx-plus
21+
name: "nginx-plus{{ nginx_version | default('') }}"
2222
state: present
2323
notify: "(Handler: All OSs) Start NGINX"

0 commit comments

Comments
 (0)