Add Alpine tests to all molecule scenarios (#191)
* Use distro specific Ansible modules to install NGINX * Install NGINX directly in Alpine distributions from the official repository to avoid naming conflicts * Set travis_wait parameter to max timeout setting
This commit is contained in:
parent
59e0170313
commit
f6c48c12d6
@ -14,6 +14,6 @@ before_install:
|
||||
install:
|
||||
- pip install molecule[docker]
|
||||
script:
|
||||
- molecule test -s $scenario
|
||||
- travis_wait 50 molecule test -s $scenario
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||
|
@ -4,6 +4,18 @@ driver:
|
||||
lint:
|
||||
name: yamllint
|
||||
platforms:
|
||||
- name: alpine-3.8
|
||||
image: alpine:3.8
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
command: "/sbin/init"
|
||||
- name: alpine-3.9
|
||||
image: alpine:3.9
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
command: "/sbin/init"
|
||||
- name: alpine-3.10
|
||||
image: alpine:3.10
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
command: "/sbin/init"
|
||||
- name: centos-6
|
||||
image: centos:6
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
|
@ -7,6 +7,18 @@ driver:
|
||||
lint:
|
||||
name: yamllint
|
||||
platforms:
|
||||
- name: alpine-3.8
|
||||
image: alpine:3.8
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
command: "/sbin/init"
|
||||
- name: alpine-3.9
|
||||
image: alpine:3.9
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
command: "/sbin/init"
|
||||
- name: alpine-3.10
|
||||
image: alpine:3.10
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
command: "/sbin/init"
|
||||
- name: centos-6
|
||||
image: centos:6
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
|
@ -7,6 +7,18 @@ driver:
|
||||
lint:
|
||||
name: yamllint
|
||||
platforms:
|
||||
- name: alpine-3.8
|
||||
image: alpine:3.8
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
command: "/sbin/init"
|
||||
- name: alpine-3.9
|
||||
image: alpine:3.9
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
command: "/sbin/init"
|
||||
- name: alpine-3.10
|
||||
image: alpine:3.10
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
command: "/sbin/init"
|
||||
- name: centos-6
|
||||
image: centos:6
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
|
@ -4,6 +4,18 @@ driver:
|
||||
lint:
|
||||
name: yamllint
|
||||
platforms:
|
||||
- name: alpine-3.8
|
||||
image: alpine:3.8
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
command: "/sbin/init"
|
||||
- name: alpine-3.9
|
||||
image: alpine:3.9
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
command: "/sbin/init"
|
||||
- name: alpine-3.10
|
||||
image: alpine:3.10
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
command: "/sbin/init"
|
||||
- name: centos-6
|
||||
image: centos:6
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
|
@ -1,10 +1,30 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
pre_tasks:
|
||||
- name: "Set module if Alpine"
|
||||
set_fact:
|
||||
module:
|
||||
- "unit-perl"
|
||||
- "unit-php7"
|
||||
- "unit-python3"
|
||||
when: ansible_os_family == "Alpine"
|
||||
- name: "Set module if Debian/RedHat"
|
||||
set_fact:
|
||||
module:
|
||||
- "unit-perl"
|
||||
- "unit-php"
|
||||
- "unit-ruby"
|
||||
when: ansible_os_family == "Debian"
|
||||
- name: "Set module if RedHat"
|
||||
set_fact:
|
||||
module:
|
||||
- "unit-php"
|
||||
- "unit-go"
|
||||
when: ansible_os_family == "RedHat"
|
||||
roles:
|
||||
- role: ansible-role-nginx
|
||||
vars:
|
||||
nginx_enable: false
|
||||
nginx_unit_enable: true
|
||||
nginx_unit_modules:
|
||||
- unit-php
|
||||
nginx_unit_modules: "{{ module }}"
|
||||
|
@ -14,11 +14,13 @@
|
||||
- import_tasks: setup-suse.yml
|
||||
when: ansible_os_family == "Suse"
|
||||
|
||||
when: nginx_install_from == "nginx_repository"
|
||||
when:
|
||||
- nginx_install_from == "nginx_repository"
|
||||
|
||||
- name: "(Install: Linux) Install NGINX package"
|
||||
package:
|
||||
name: "nginx{{ nginx_version | default('') }}"
|
||||
state: present
|
||||
when: ansible_os_family in nginx_linux_families
|
||||
when:
|
||||
- nginx_install_from == "os_repository"
|
||||
notify: "(Handler: All OSs) Start NGINX"
|
||||
|
@ -14,3 +14,15 @@
|
||||
path: /etc/apk/repositories
|
||||
insertafter: EOF
|
||||
line: "{{ repository }}"
|
||||
|
||||
- name: "(Install: Alpine) Install Required Alpine Dependencies"
|
||||
apk:
|
||||
name:
|
||||
- openssl
|
||||
- pcre
|
||||
|
||||
- name: "(Install: Alpine) Install NGINX"
|
||||
apk:
|
||||
name: "nginx{{ nginx_version | default('') }}"
|
||||
repository: "{{ repository }}"
|
||||
notify: "(Handler: All OSs) Start NGINX"
|
||||
|
@ -18,3 +18,8 @@
|
||||
repo: "{{ item }}"
|
||||
with_items:
|
||||
- "{{ repository }}"
|
||||
|
||||
- name: "(Install: Debian/Ubuntu) Install NGINX"
|
||||
apt:
|
||||
name: "nginx{{ nginx_version | default('') }}"
|
||||
notify: "(Handler: All OSs) Start NGINX"
|
||||
|
@ -17,3 +17,8 @@
|
||||
description: NGINX Repository
|
||||
enabled: yes
|
||||
gpgcheck: yes
|
||||
|
||||
- name: "(Install: CentOS/RedHat) Install NGINX"
|
||||
yum:
|
||||
name: "nginx{{ nginx_version | default('') }}"
|
||||
notify: "(Handler: All OSs) Start NGINX"
|
||||
|
@ -13,3 +13,8 @@
|
||||
zypper_repository:
|
||||
name: "nginx-{{ nginx_branch }}"
|
||||
repo: "{{ repository }}"
|
||||
|
||||
- name: "(Install: SUSE) Install NGINX"
|
||||
zypper:
|
||||
name: "nginx{{ nginx_version | default('') }}"
|
||||
notify: "(Handler: All OSs) Start NGINX"
|
||||
|
Loading…
Reference in New Issue
Block a user