Add option to specify the version of NGINX to install (#177)

And remove outdated Debian Jessie Molecule tests
This commit is contained in:
Alessandro Fael Garcia 2019-11-03 15:07:38 +01:00 committed by GitHub
parent cca5dbb37d
commit 41aeda300d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 18 additions and 12 deletions

View File

@ -10,10 +10,13 @@ nginx_start: true
# Print NGINX configuration file to terminal after executing playbook.
nginx_debug_output: false
# Specify which version of NGINX you want to install.
# Specify which type of NGINX you want to install.
# Options are 'opensource' or 'plus'.
# Default is 'opensource'.
nginx_type: opensource
# Specify which version of NGINX you want to install.
# Default is empty.
# nginx_version: =19-1~bionic
# Specify repository origin for NGINX Open Source.
# Options are 'nginx_repository' or 'os_repository'.

View File

@ -12,8 +12,6 @@ platforms:
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
- name: debian-jessie
image: debian:jessie
- name: debian-stretch
image: debian:stretch
- name: debian-buster

View File

@ -1,5 +1,16 @@
---
- name: Converge
hosts: all
pre_tasks:
- name: "Set repo if Debian"
set_fact:
version: "=1.17.4-1~{{ ansible_distribution_release }}"
when: ansible_os_family == "Debian"
- name: "Set repo if RedHat"
set_fact:
version: "-1.17.4-1.el{{ ansible_distribution_major_version }}.ngx"
when: ansible_os_family == "RedHat"
roles:
- role: ansible-role-nginx
vars:
nginx_version: "{{ version }}"

View File

@ -15,8 +15,6 @@ platforms:
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
- name: debian-jessie
image: debian:jessie
- name: debian-stretch
image: debian:stretch
- name: debian-buster

View File

@ -15,8 +15,6 @@ platforms:
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
- name: debian-jessie
image: debian:jessie
- name: debian-stretch
image: debian:stretch
- name: debian-buster

View File

@ -12,8 +12,6 @@ platforms:
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
- name: debian-jessie
image: debian:jessie
- name: debian-stretch
image: debian:stretch
- name: debian-buster

View File

@ -16,7 +16,7 @@
- name: "(Install: Debian/Ubuntu/CentOS/RedHat) Install NGINX"
package:
name: nginx
name: "nginx{{ nginx_version | default('') }}"
state: present
when: ansible_os_family != "FreeBSD"
notify: "(Handler: All OSs) Start NGINX"
@ -32,7 +32,7 @@
- name: "(Install: Debian/Ubuntu/CentOS/RedHat/FreeBSD) Install NGINX"
package:
name: nginx
name: "nginx{{ nginx_version | default('') }}"
state: present
when: nginx_install_from == "os_repository"
notify: "(Handler: All OSs) Start NGINX"

View File

@ -18,6 +18,6 @@
- name: "(Install: All OSs) Install NGINX Plus"
package:
name: nginx-plus
name: "nginx-plus{{ nginx_version | default('') }}"
state: present
notify: "(Handler: All OSs) Start NGINX"