diff --git a/molecule/common/playbooks/source_converge.yml b/molecule/common/playbooks/source_converge.yml
index 45d3be3..e2ce0e0 100644
--- a/molecule/common/playbooks/source_converge.yml
+++ b/molecule/common/playbooks/source_converge.yml
@@ -7,8 +7,8 @@
nginx_debug_output: true
nginx_install_from: source
- nginx_branch: mainline
+ nginx_branch: stable
nginx_install_source_build_tools: true
- nginx_install_source_pcre: false
+ nginx_install_source_pcre: true
nginx_install_source_openssl: true
- nginx_install_source_zlib: false
+ nginx_install_source_zlib: true
diff --git a/tasks/opensource/setup-source.yml b/tasks/opensource/setup-source.yml
index 018c0b7..e2d5c56 100644
--- a/tasks/opensource/setup-source.yml
+++ b/tasks/opensource/setup-source.yml
@@ -1,26 +1,26 @@
---
-- name: "(Install: Linux) Check for build tools"
- when: nginx_install_source_build_tools
+- name: "(Install: Linux) Check For Build Tools"
block:
-
- - name: "(Install: Linux) Install Python - Centos/RHEL"
- package:
+ - name: "(Install: Centos/RHEL) Install Python"
+ yum:
name:
- python3
- python3-pip
- python3-devel
- state: present
+ update_cache: true
when: ansible_os_family == "RedHat"
- - name: "(Install: Linux) Set Python3 default - Centos/RHEL"
+ - name: "(Install: Centos/RHEL) Set Python3 Default"
alternatives:
name: python
path: /usr/bin/python3
link: /usr/bin/python
- when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "8"
+ when:
+ - ansible_os_family == "RedHat"
+ - ansible_distribution_major_version == "8"
- - name: "(Install: Linux) Install Build Tools - Centos/RHEL"
- package:
+ - name: "(Install: Centos/RHEL) Install Build Tools"
+ yum:
name:
- "@Development tools"
- gcc
@@ -32,16 +32,16 @@
- wget
- ca-certificates
- zlib-devel
- state: present
+ update_cache: true
when: ansible_os_family == "RedHat"
- - name: "(Install: Linux) Install backports repo for Buster"
+ - name: "(Install: Debian) Install Backports Repo For Buster"
apt_repository:
repo: deb http://ftp.us.debian.org/debian buster-backports main
when: ansible_distribution_release == "buster"
- - name: "(Install: Linux) Install Build Tools - Debian/Ubuntu"
- package:
+ - name: "(Install: Debian/Ubuntu) Install Build Tools"
+ apt:
name:
- python3-minimal
- build-essential
@@ -50,11 +50,11 @@
- checkinstall
- zlib1g-dev
- libtemplate-perl
- state: present
+ update_cache: true
when: ansible_os_family == "Debian"
- - name: "(Install: Linux) Install Build Tools - Alpine"
- package:
+ - name: "(Install: Alpine) Install Build Tools"
+ apk:
name:
- python
- alpine-sdk
@@ -65,10 +65,10 @@
- linux-headers
- tar
- openrc
- state: present
+ update_cache: true
when: ansible_os_family == "Alpine"
- - name: "(Install: Linux) Enable openrc - Alpine"
+ - name: "(Install: Alpine) Enable openrc"
copy:
content: ""
dest: /run/openrc/softlevel
@@ -76,218 +76,224 @@
owner: root
mode: 0644
when: ansible_os_family == "Alpine"
+ when: nginx_install_source_build_tools
-- name: "(Install: Linux) Check for Source Installs"
+- name: "(Install: Linux) Check For Source Installs"
block:
-
- - name: "(Install: Linux) Check for PCRE Install"
+ - name: "(Install: Linux) Check For PCRE Install"
stat:
path: /tmp/{{ pcre_version }}
register: pcre_result
- - name: "(Install: Linux) Check for zlib Install"
+ - name: "(Install: Linux) Check For zlib Install"
stat:
path: /tmp/{{ zlib_version }}
register: zlib_result
- - name: "(Install: Linux) Check for openssl Install"
+ - name: "(Install: Linux) Check For openssl Install"
stat:
path: /tmp/{{ openssl_version }}
register: openssl_result
-- name: "(Install: Linux) Install PCRE Dependency: Package: Centos/RHEL"
- when: nginx_install_source_pcre and ansible_os_family == "RedHat"
- package:
+- name: "(Install: Centos/RHEL) Install PCRE Dependency From Package"
+ yum:
name: pcre-devel
- state: present
+ update_cache: true
+ when:
+ - nginx_install_source_pcre
+ - ansible_os_family == "RedHat"
-- name: "(Install: Linux) Install PCRE Dependency: Package: Debian/Ubuntu"
- when: nginx_install_source_pcre and ansible_os_family == "Debian"
- package:
- name: libpcre3–dev
- state: present
+- name: "(Install: Debian/Ubuntu) Install PCRE Dependency From Package"
+ apt:
+ name: libpcre3-dev
+ update_cache: true
+ when:
+ - nginx_install_source_pcre
+ - ansible_os_family == "Debian"
-- name: "(Install: Linux) Install PCRE Dependency: Package: Alpine"
- when: nginx_install_source_pcre and ansible_os_family == "Alpine"
- package:
+- name: "(Install: Alpine) Install PCRE Dependency From Package"
+ apk:
name: pcre-dev
- state: present
+ update_cache: true
+ when:
+ - nginx_install_source_pcre
+ - ansible_os_family == "Alpine"
-- name: "(Install: Linux) Install PCRE Dependency: Source"
- when: not pcre_result.stat.exists and not nginx_install_source_pcre
+- name: "(Install: Linux) Install PCRE Dependence From Source"
block:
-
- - name: "(Install: Linux) Install PCRE Dependency: Download"
+ - name: "(Install: Linux) Download PCRE Dependency"
get_url:
url: "http://ftp.pcre.org/pub/pcre/{{ pcre_version }}.tar.gz"
dest: "/tmp/{{ pcre_version }}.tar.gz"
register: pcre_source
- - name: "(Install: Linux) Install PCRE Dependency: Unpack"
+ - name: "(Install: Linux) Unpack PCRE Dependency"
unarchive:
copy: no
dest: /tmp/
src: "{{ pcre_source.dest }}"
register: pcre_source_unpack
- - name: "(Install: Linux) Install PCRE Dependency: Configure"
+ - name: "(Install: Linux) Configure PCRE Dependency"
command: "./configure"
args:
chdir: "/tmp/{{ pcre_version }}"
register: pcre_configure
- - name: "(Install: Linux) Install PCRE Dependency: Install"
+ - name: "(Install: Linux) Make PCRE Dependency"
make:
chdir: "/tmp/{{ pcre_version }}"
- - name: "(Install: Linux) Install PCRE Dependency: Install"
+ - name: "(Install: Linux) Install PCRE Dependency"
make:
chdir: "/tmp/{{ pcre_version }}"
target: install
+ when:
+ - not pcre_result.stat.exists
+ - not nginx_install_source_pcre
-- name: "(Install: Linux) Install zlib Dependency: Package: Centos/RHEL"
- when: nginx_install_source_zlib and ansible_os_family == "RedHat"
- package:
+- name: "(Install: Centos/RHEL) Install zlib Dependency From Package"
+ yum:
name: zlib-devel
- state: present
+ update_cache: true
+ when:
+ - nginx_install_source_zlib
+ - ansible_os_family == "RedHat"
-- name: "(Install: Linux) Install zlib Dependency: Package: Debian/Ubuntu"
- when: nginx_install_source_zlib and ansible_os_family == "Debian"
- package:
+- name: "(Install: Debian/Ubuntu) Install zlib Dependency From Package"
+ apt:
name: zlib1g-dev
- state: present
+ update_cache: true
+ when:
+ - nginx_install_source_zlib
+ - ansible_os_family == "Debian"
-- name: "(Install: Linux) Install zlib Dependency: Package: Alpine"
- when: nginx_install_source_zlib and ansible_os_family == "Alpine"
- package:
+- name: "(Install: Alpine) Install zlib Dependency From Package"
+ apk:
name: zlib-dev
- state: present
+ update_cache: true
+ when:
+ - nginx_install_source_zlib
+ - ansible_os_family == "Alpine"
-- name: "(Install: Linux) Install zlib Dependency: Source"
- when: not zlib_result.stat.exists and not nginx_install_source_zlib
+- name: "(Install: Linux) Install zlib Dependency From Source"
block:
-
- - name: "(Install: Linux) Install zlib Dependency: Download"
+ - name: "(Install: Linux) Download zlib Dependency"
get_url:
url: "http://zlib.net/{{ zlib_version }}.tar.gz"
dest: "/tmp/{{ zlib_version }}.tar.gz"
register: zlib_source
- - name: "(Install: Linux) Install zlib Dependency: Unpack"
+ - name: "(Install: Linux) Unpack zlib Dependency"
unarchive:
copy: no
dest: /tmp/
src: "{{ zlib_source.dest }}"
register: zlib_source_unpack
- - name: "(Install: Linux) Install zlib Dependency: Configure"
+ - name: "(Install: Linux) Configure zlib Dependency"
command: "./configure"
args:
chdir: "/tmp/{{ zlib_version }}"
register: zlib_configure
- - name: "(Install: Linux) Install zlib Dependency: Install"
+ - name: "(Install: Linux) Make zlib Dependency"
make:
chdir: "/tmp/{{ zlib_version }}"
- - name: "(Install: Linux) Install zlib Dependency: Install"
+ - name: "(Install: Linux) Install zlib Dependency"
make:
chdir: "/tmp/{{ zlib_version }}"
target: install
+ when:
+ - not zlib_result.stat.exists
+ - not nginx_install_source_zlib
-- name: "(Install: Linux) Install OpenSSL Dependency: Package: Centos/RHEL"
- when: nginx_install_source_openssl and ansible_os_family == "RedHat"
- package:
+- name: "(Install: Centos/RHEL) Install OpenSSL Dependency From Package"
+ yum:
name: openssl-devel
- state: present
+ update_cache: true
+ when:
+ - nginx_install_source_openssl
+ - ansible_os_family == "RedHat"
-- name: "(Install: Linux) Install OpenSSL Dependency: Package: Debian/Ubuntu"
- when: nginx_install_source_openssl and ansible_os_family == "Debian"
- package:
+- name: "(Install: Debian/Ubuntu) Install OpenSSL Dependency From Package"
+ apt:
name: libssl-dev
- state: present
+ update_cache: true
+ when:
+ - nginx_install_source_openssl
+ - ansible_os_family == "Debian"
-- name: "(Install: Linux) Install OpenSSL Dependency: Package: Alpine"
- when: nginx_install_source_openssl and ansible_os_family == "Alpine"
- package:
+- name: "(Install: Alpine) Install OpenSSL Dependency From Package"
+ apk:
name: openssl-dev
- state: present
+ update_cache: true
+ when:
+ - nginx_install_source_openssl
+ - ansible_os_family == "Alpine"
-- name: "(Install: Linux) Install OpenSSL Dependency: Source"
- when: not openssl_result.stat.exists and not nginx_install_source_openssl
+- name: "(Install: Linux) Install OpenSSL Dependency From Source"
block:
-
- - name: "(Install: Linux) Install OpenSSL Dependency: Download"
+ - name: "(Install: Linux) Download OpenSSL Dependency"
get_url:
url: "http://www.openssl.org/source/{{ openssl_version }}.tar.gz"
dest: "/tmp/{{ openssl_version }}.tar.gz"
register: openssl_source
- - name: "(Install: Linux) Install OpenSSL Dependency: Unpack"
+ - name: "(Install: Linux) Unpack OpenSSL Dependency"
unarchive:
copy: no
dest: /tmp/
src: "{{ openssl_source.dest }}"
register: openssl_source_unpack
- - name: "(Install: Linux) Install OpenSSL Dependency: Configure"
+ - name: "(Install: Linux) Configure OpenSSL Dependency"
command: "./config --prefix=/usr"
args:
chdir: "/tmp/{{ openssl_version }}"
register: openssl_configure
- - name: "(Install: Linux) Install OpenSSL Dependency: Make"
+ - name: "(Install: Linux) Make OpenSSL Dependency"
make:
chdir: "/tmp/{{ openssl_version }}"
- - name: "(Install: Linux) Install OpenSSL Dependency: Install"
+ - name: "(Install: Linux) Install OpenSSL Dependency"
make:
chdir: "/tmp/{{ openssl_version }}"
target: install
+ when:
+ - not openssl_result.stat.exists
+ - not nginx_install_source_openssl
-- name: "(Install: Linux) Install NGINX: Get NGINX version"
+- name: "(Install: Linux) Get NGINX Version"
block:
+ - name: "(Install: Linux) Fetch NGINX Version"
+ uri:
+ url: https://trac.nginx.org/nginx/browser
+ return_content: true
+ register: nginx_versions
- - name: "(Install: Linux) Install NGINX: Get NGINX mainline version"
- shell:
- args:
- cmd: curl --stderr - https://trac.nginx.org/nginx/browser | grep release | head -1 | sed -e 's:.*