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 - docker
env: env:
- scenario: default - scenario: default
- scenario: default_alpine
- scenario: default_centos
- scenario: module - scenario: module
- scenario: module_alpine
- scenario: module_centos
- scenario: stable_push - scenario: stable_push
- scenario: stable_push_alpine
- scenario: stable_push_centos
- scenario: template - scenario: template
- scenario: template_alpine
- scenario: template_centos
- scenario: unit - scenario: unit
- scenario: unit_alpine
- scenario: unit_centos
before_install: before_install:
- sudo apt-get -qq update - sudo apt-get -qq update
install: install:

View File

@ -19,6 +19,10 @@ RUN \
apt-get update \ apt-get update \
&& apt-get install -y python sudo bash ca-certificates iproute2 curl \ && apt-get install -y python sudo bash ca-certificates iproute2 curl \
&& apt-get clean; \ && 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 \ elif [ $(command -v dnf) ]; then \
dnf makecache \ dnf makecache \
&& dnf --assumeyes install python sudo python-devel python*-dnf bash iproute \ && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute \

View File

@ -4,29 +4,6 @@ driver:
lint: lint:
name: yamllint name: yamllint
platforms: 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 - name: debian-stretch
image: debian:stretch-slim image: debian:stretch-slim
dockerfile: ../common/Dockerfile.j2 dockerfile: ../common/Dockerfile.j2
@ -41,9 +18,12 @@ platforms:
dockerfile: ../common/Dockerfile.j2 dockerfile: ../common/Dockerfile.j2
provisioner: provisioner:
name: ansible name: ansible
playbooks:
converge: ../common/playbook_default.yml
lint: lint:
name: ansible-lint name: ansible-lint
verifier: verifier:
name: testinfra name: testinfra
directory: ../common/test_default
lint: lint:
name: flake8 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: lint:
name: yamllint name: yamllint
platforms: 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 - name: debian-stretch
image: debian:stretch-slim image: debian:stretch-slim
dockerfile: ../common/Dockerfile.j2 dockerfile: ../common/Dockerfile.j2
@ -41,9 +18,12 @@ platforms:
dockerfile: ../common/Dockerfile.j2 dockerfile: ../common/Dockerfile.j2
provisioner: provisioner:
name: ansible name: ansible
playbooks:
converge: ../common/playbook_module.yml
lint: lint:
name: ansible-lint name: ansible-lint
verifier: verifier:
name: testinfra name: testinfra
directory: ../common/test_module
lint: lint:
name: flake8 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: lint:
name: yamllint name: yamllint
platforms: 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 - name: debian-stretch
image: debian:stretch-slim image: debian:stretch-slim
dockerfile: ../common/Dockerfile.j2 dockerfile: ../common/Dockerfile.j2
@ -44,9 +21,12 @@ platforms:
dockerfile: ../common/Dockerfile.j2 dockerfile: ../common/Dockerfile.j2
provisioner: provisioner:
name: ansible name: ansible
playbooks:
converge: ../common/playbook_stable_push.yml
lint: lint:
name: ansible-lint name: ansible-lint
verifier: verifier:
name: testinfra name: testinfra
directory: ../common/test_stable_push
lint: lint:
name: flake8 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: lint:
name: yamllint name: yamllint
platforms: 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 - name: debian-stretch
image: debian:stretch-slim image: debian:stretch-slim
dockerfile: ../common/Dockerfile.j2 dockerfile: ../common/Dockerfile.j2
@ -44,9 +21,12 @@ platforms:
dockerfile: ../common/Dockerfile.j2 dockerfile: ../common/Dockerfile.j2
provisioner: provisioner:
name: ansible name: ansible
playbooks:
converge: ../common/playbook_template.yml
lint: lint:
name: ansible-lint name: ansible-lint
verifier: verifier:
name: testinfra name: testinfra
directory: ../common/test_template
lint: lint:
name: flake8 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: lint:
name: yamllint name: yamllint
platforms: 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 - name: debian-stretch
image: debian:stretch-slim image: debian:stretch-slim
dockerfile: ../common/Dockerfile.j2 dockerfile: ../common/Dockerfile.j2
@ -41,5 +18,7 @@ platforms:
dockerfile: ../common/Dockerfile.j2 dockerfile: ../common/Dockerfile.j2
provisioner: provisioner:
name: ansible name: ansible
playbooks:
converge: ../common/playbook_unit.yml
lint: lint:
name: ansible-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) when: nginx_modules.perl | default(false)
- import_tasks: install-geoip.yml - 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 - import_tasks: install-image-filter.yml
when: nginx_modules.image_filter | default(false) when: nginx_modules.image_filter | default(false)
- import_tasks: install-rtmp.yml - 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 - import_tasks: install-xslt.yml
when: nginx_modules.xslt | default(false) when: nginx_modules.xslt | default(false)
- import_tasks: install-waf.yml - 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" - name: "(Install: All OSs) Install NGINX Open Source Perl Module"
package: package:
name: nginx-module-perl name: nginx-module-perl

View File

@ -14,13 +14,11 @@
- import_tasks: setup-suse.yml - import_tasks: setup-suse.yml
when: ansible_os_family == "Suse" when: ansible_os_family == "Suse"
when: when: nginx_install_from == "nginx_repository"
- nginx_install_from == "nginx_repository"
- name: "(Install: Linux) Install NGINX package" - name: "(Install: Linux) Install NGINX package"
package: package:
name: "nginx{{ nginx_version | default('') }}" name: "nginx{{ nginx_version | default('') }}"
state: present state: present
when: when: nginx_install_from == "os_repository"
- nginx_install_from == "os_repository"
notify: "(Handler: All OSs) Start NGINX" notify: "(Handler: All OSs) Start NGINX"

View File

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