Initial
This commit is contained in:
43
roles/nginxinc.nginx_unit/molecule/common/Dockerfile.j2
Normal file
43
roles/nginxinc.nginx_unit/molecule/common/Dockerfile.j2
Normal file
@ -0,0 +1,43 @@
|
||||
# Molecule managed
|
||||
|
||||
{% if item.registry is defined %}
|
||||
FROM {{ item.registry.url }}/{{ item.image }}
|
||||
{% else %}
|
||||
FROM {{ item.image }}
|
||||
{% endif %}
|
||||
|
||||
{% if item.env is defined %}
|
||||
{% for var, value in item.env.items() %}
|
||||
{% if value %}
|
||||
ENV {{ var }} {{ value }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
RUN \
|
||||
if [ $(command -v apt-get) ]; then \
|
||||
apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y aptitude bash ca-certificates curl iproute2 python-apt python3 python3-apt procps sudo systemd systemd-sysv vim \
|
||||
&& apt-get clean; \
|
||||
elif [ $(command -v dnf) ]; then \
|
||||
dnf makecache \
|
||||
&& dnf --assumeyes install bash iproute /usr/bin/dnf-3 /usr/bin/python3 /usr/bin/python3-config vim \
|
||||
&& dnf clean all; \
|
||||
elif [ $(command -v yum) ]; then \
|
||||
yum makecache fast \
|
||||
&& yum install -y bash iproute /usr/bin/python /usr/bin/python2-config sudo vim yum-plugin-ovl \
|
||||
&& sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf \
|
||||
&& yum clean all; \
|
||||
elif [ $(command -v zypper) ]; then \
|
||||
zypper refresh \
|
||||
&& zypper install -y bash iproute2 python3 sudo vim \
|
||||
&& zypper clean -a; \
|
||||
elif [ $(command -v apk) ]; then \
|
||||
apk update \
|
||||
&& apk add --no-cache bash ca-certificates curl openrc python3 sudo vim; \
|
||||
echo 'rc_provide="loopback net"' >> /etc/rc.conf; \
|
||||
elif [ $(command -v xbps-install) ]; then \
|
||||
xbps-install -Syu \
|
||||
&& xbps-install -y bash ca-certificates iproute2 python3 sudo vim \
|
||||
&& xbps-remove -O; \
|
||||
fi
|
@ -0,0 +1,32 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
pre_tasks:
|
||||
- name: Set module if Alpine
|
||||
set_fact:
|
||||
module:
|
||||
- unit-perl
|
||||
- unit-php7
|
||||
- unit-python3
|
||||
when: ansible_facts['os_family'] == "Alpine"
|
||||
- name: Set module if Debian
|
||||
set_fact:
|
||||
module:
|
||||
- unit-perl
|
||||
- unit-php
|
||||
- unit-ruby
|
||||
when: ansible_facts['os_family'] == "Debian"
|
||||
- name: Set module if Red Hat
|
||||
set_fact:
|
||||
module:
|
||||
- unit-php
|
||||
- unit-go
|
||||
when: ansible_facts['os_family'] == "RedHat"
|
||||
tasks:
|
||||
- name: Install NGINX Unit
|
||||
include_role:
|
||||
name: ansible-role-nginx-unit
|
||||
vars:
|
||||
nginx_enable: false
|
||||
nginx_unit_enable: true
|
||||
nginx_unit_modules: "{{ module }}"
|
47
roles/nginxinc.nginx_unit/molecule/default/molecule.yml
Normal file
47
roles/nginxinc.nginx_unit/molecule/default/molecule.yml
Normal file
@ -0,0 +1,47 @@
|
||||
---
|
||||
driver:
|
||||
name: docker
|
||||
lint: |
|
||||
set -e
|
||||
yamllint .
|
||||
ansible-lint --force-color
|
||||
platforms:
|
||||
- name: debian-stretch
|
||||
image: debian:stretch-slim
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
privileged: true
|
||||
volumes:
|
||||
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
|
||||
command: "/sbin/init"
|
||||
- name: debian-buster
|
||||
image: debian:buster-slim
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
privileged: true
|
||||
volumes:
|
||||
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
|
||||
command: "/sbin/init"
|
||||
- name: ubuntu-xenial
|
||||
image: ubuntu:xenial
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
privileged: true
|
||||
volumes:
|
||||
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
|
||||
command: "/sbin/init"
|
||||
- name: ubuntu-bionic
|
||||
image: ubuntu:bionic
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
privileged: true
|
||||
volumes:
|
||||
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
|
||||
command: "/sbin/init"
|
||||
- name: ubuntu-focal
|
||||
image: ubuntu:focal
|
||||
dockerfile: ../common/Dockerfile.j2
|
||||
privileged: true
|
||||
volumes:
|
||||
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
|
||||
command: "/sbin/init"
|
||||
provisioner:
|
||||
name: ansible
|
||||
playbooks:
|
||||
converge: ../common/playbooks/default_converge.yml
|
@ -0,0 +1,26 @@
|
||||
---
|
||||
driver:
|
||||
name: docker
|
||||
lint: |
|
||||
set -e
|
||||
yamllint .
|
||||
ansible-lint --force-color
|
||||
platforms:
|
||||
- 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/playbooks/default_converge.yml
|
Reference in New Issue
Block a user