Add testing and use correct repository for CentOS/RHEL 8

This commit is contained in:
Alessandro Fael Garcia 2019-11-26 22:12:09 +01:00
parent 4ad659a784
commit e4e68376f5
32 changed files with 413 additions and 122 deletions

View File

@ -5,10 +5,20 @@ services:
- docker
env:
- scenario: default
- scenario: default_alpine
- scenario: default_centos
- scenario: module
- scenario: module_alpine
- scenario: module_centos
- scenario: stable_push
- scenario: stable_push_alpine
- scenario: stable_push_centos
- scenario: template
- scenario: template_alpine
- scenario: template_centos
- scenario: unit
- scenario: unit_alpine
- scenario: unit_centos
before_install:
- sudo apt-get -qq update
install:

View File

@ -19,6 +19,10 @@ RUN \
apt-get update \
&& apt-get install -y python sudo bash ca-certificates iproute2 curl \
&& apt-get clean; \
elif [ $(command -v dnf) ] && [ $(rpm -E %{rhel}) -eq 8 ]; then \
dnf makecache \
&& dnf --assumeyes install python3 python3-devel python3-dnf python3-pip bash iproute \
&& dnf clean all; \
elif [ $(command -v dnf) ]; then \
dnf makecache \
&& dnf --assumeyes install python sudo python-devel python*-dnf bash iproute \

View File

@ -4,29 +4,6 @@ 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
- name: centos-7
image: centos:7
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
tty: True
- name: debian-stretch
image: debian:stretch-slim
dockerfile: ../common/Dockerfile.j2
@ -41,9 +18,12 @@ platforms:
dockerfile: ../common/Dockerfile.j2
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_default.yml
lint:
name: ansible-lint
verifier:
name: testinfra
directory: ../common/test_default
lint:
name: flake8

View File

@ -0,0 +1,38 @@
---
driver:
name: docker
lint:
name: yamllint
platforms:
- name: alpine-3.8
image: alpine:3.8
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: alpine-3.9
image: alpine:3.9
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: alpine-3.10
image: alpine:3.10
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_default.yml
lint:
name: ansible-lint
verifier:
name: testinfra
directory: ../common/test_default
lint:
name: flake8

View File

@ -0,0 +1,34 @@
---
driver:
name: docker
lint:
name: yamllint
platforms:
- name: centos-6
image: centos:6
dockerfile: ../common/Dockerfile.j2
- name: centos-7
image: centos:7
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
- name: centos-8
image: centos:8
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_default.yml
lint:
name: ansible-lint
verifier:
name: testinfra
directory: ../common/test_default
lint:
name: flake8

View File

@ -4,29 +4,6 @@ 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
- name: centos-7
image: centos:7
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
tty: True
- name: debian-stretch
image: debian:stretch-slim
dockerfile: ../common/Dockerfile.j2
@ -41,9 +18,12 @@ platforms:
dockerfile: ../common/Dockerfile.j2
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_module.yml
lint:
name: ansible-lint
verifier:
name: testinfra
directory: ../common/test_module
lint:
name: flake8

View File

@ -0,0 +1,38 @@
---
driver:
name: docker
lint:
name: yamllint
platforms:
- name: alpine-3.8
image: alpine:3.8
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: alpine-3.9
image: alpine:3.9
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: alpine-3.10
image: alpine:3.10
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_module.yml
lint:
name: ansible-lint
verifier:
name: testinfra
directory: ../common/test_module
lint:
name: flake8

View File

@ -0,0 +1,34 @@
---
driver:
name: docker
lint:
name: yamllint
platforms:
- name: centos-6
image: centos:6
dockerfile: ../common/Dockerfile.j2
- name: centos-7
image: centos:7
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
- name: centos-8
image: centos:8
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_module.yml
lint:
name: ansible-lint
verifier:
name: testinfra
directory: ../common/test_module
lint:
name: flake8

View File

@ -7,29 +7,6 @@ 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
- name: centos-7
image: centos:7
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
tty: True
- name: debian-stretch
image: debian:stretch-slim
dockerfile: ../common/Dockerfile.j2
@ -44,9 +21,12 @@ platforms:
dockerfile: ../common/Dockerfile.j2
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_stable_push.yml
lint:
name: ansible-lint
verifier:
name: testinfra
directory: ../common/test_stable_push
lint:
name: flake8

View File

@ -0,0 +1,41 @@
---
dependency:
name: shell
command: pip install python-nginx
driver:
name: docker
lint:
name: yamllint
platforms:
- name: alpine-3.8
image: alpine:3.8
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: alpine-3.9
image: alpine:3.9
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: alpine-3.10
image: alpine:3.10
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_stable_push.yml
lint:
name: ansible-lint
verifier:
name: testinfra
directory: ../common/test_stable_push
lint:
name: flake8

View File

@ -0,0 +1,37 @@
---
dependency:
name: shell
command: pip install python-nginx
driver:
name: docker
lint:
name: yamllint
platforms:
- name: centos-6
image: centos:6
dockerfile: ../common/Dockerfile.j2
- name: centos-7
image: centos:7
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
- name: centos-8
image: centos:8
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_stable_push.yml
lint:
name: ansible-lint
verifier:
name: testinfra
directory: ../common/test_stable_push
lint:
name: flake8

View File

@ -7,29 +7,6 @@ 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
- name: centos-7
image: centos:7
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
tty: True
- name: debian-stretch
image: debian:stretch-slim
dockerfile: ../common/Dockerfile.j2
@ -44,9 +21,12 @@ platforms:
dockerfile: ../common/Dockerfile.j2
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_template.yml
lint:
name: ansible-lint
verifier:
name: testinfra
directory: ../common/test_template
lint:
name: flake8

View File

@ -0,0 +1,41 @@
---
dependency:
name: shell
command: pip install python-nginx
driver:
name: docker
lint:
name: yamllint
platforms:
- name: alpine-3.8
image: alpine:3.8
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: alpine-3.9
image: alpine:3.9
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: alpine-3.10
image: alpine:3.10
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_template.yml
lint:
name: ansible-lint
verifier:
name: testinfra
directory: ../common/test_template
lint:
name: flake8

View File

@ -0,0 +1,37 @@
---
dependency:
name: shell
command: pip install python-nginx
driver:
name: docker
lint:
name: yamllint
platforms:
- name: centos-6
image: centos:6
dockerfile: ../common/Dockerfile.j2
- name: centos-7
image: centos:7
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
- name: centos-8
image: centos:8
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_template.yml
lint:
name: ansible-lint
verifier:
name: testinfra
directory: ../common/test_template
lint:
name: flake8

View File

@ -4,29 +4,6 @@ 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
- name: centos-7
image: centos:7
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
tty: True
- name: debian-stretch
image: debian:stretch-slim
dockerfile: ../common/Dockerfile.j2
@ -41,5 +18,7 @@ platforms:
dockerfile: ../common/Dockerfile.j2
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_unit.yml
lint:
name: ansible-lint

View File

@ -0,0 +1,33 @@
---
driver:
name: docker
lint:
name: yamllint
platforms:
- name: alpine-3.8
image: alpine:3.8
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: alpine-3.9
image: alpine:3.9
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
- name: alpine-3.10
image: alpine:3.10
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/sbin/init"
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_unit.yml
lint:
name: ansible-lint

View File

@ -0,0 +1,29 @@
---
driver:
name: docker
lint:
name: yamllint
platforms:
- name: centos-6
image: centos:6
dockerfile: ../common/Dockerfile.j2
- name: centos-7
image: centos:7
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
- name: centos-8
image: centos:8
dockerfile: ../common/Dockerfile.j2
privileged: True
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
provisioner:
name: ansible
playbooks:
converge: ../common/playbook_unit.yml
lint:
name: ansible-lint

View File

@ -6,16 +6,23 @@
when: nginx_modules.perl | default(false)
- import_tasks: install-geoip.yml
when: nginx_modules.geoip | default(false)
when:
- nginx_modules.geoip | default(false)
- ansible_os_family != "RedHat"
- ansible_distribution_major_version != "8"
- import_tasks: install-image-filter.yml
when: nginx_modules.image_filter | default(false)
- import_tasks: install-rtmp.yml
when: nginx_modules.rtmp | default(false) and nginx_type == "plus"
when:
- nginx_modules.rtmp | default(false)
- nginx_type == "plus"
- import_tasks: install-xslt.yml
when: nginx_modules.xslt | default(false)
- import_tasks: install-waf.yml
when: nginx_modules.waf | default(false) and nginx_type == "plus"
when:
- nginx_modules.waf | default(false)
- nginx_type == "plus"

View File

@ -1,4 +1,9 @@
---
- name: "(Install: All OSs) Install Perl Dependency"
package:
name: perl
state: present
- name: "(Install: All OSs) Install NGINX Open Source Perl Module"
package:
name: nginx-module-perl

View File

@ -14,13 +14,11 @@
- 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:
- nginx_install_from == "os_repository"
when: nginx_install_from == "os_repository"
notify: "(Handler: All OSs) Start NGINX"

View File

@ -18,7 +18,13 @@
enabled: yes
gpgcheck: yes
- name: "(Install: CentOS/RedHat) Install Required CentOS/RedHat Dependencies"
yum:
name: openssl
- name: "(Install: CentOS/RedHat) Install NGINX"
yum:
name: "nginx{{ nginx_version | default('') }}"
disablerepo: "*"
enablerepo: "nginx"
notify: "(Handler: All OSs) Start NGINX"