Skip to content

Commit

Permalink
change docker images to 'dokken'
Browse files Browse the repository at this point in the history
  • Loading branch information
gofrolist committed Jun 11, 2019
1 parent c0f8530 commit 162bca7
Show file tree
Hide file tree
Showing 32 changed files with 364 additions and 70 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ files/server.key
files/*_SHA256SUMS
tests/test_results.json
*.pyc
molecule/*/cache/
22 changes: 15 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,27 @@ python: 2.7
services: docker

env:
matrix:
- MOLECULE_DISTRO: centos6
- MOLECULE_DISTRO: centos7
- MOLECULE_DISTRO: ubuntu1604
- MOLECULE_DISTRO: ubuntu1804
- MOLECULE_DISTRO: debian8
- SCENARIO=centos-6
- SCENARIO=centos-7
- SCENARIO=debian-8
- SCENARIO=debian-9
- SCENARIO=ubuntu-16.04
- SCENARIO=ubuntu-18.04
- SCENARIO=oraclelinux-6
- SCENARIO=oraclelinux-7
- SCENARIO=fedora-26
- SCENARIO=fedora-27
- SCENARIO=fedora-28

cache:
- pip

install:
# Install test dependencies.
- pip install testinfra molecule docker netaddr

script:
- molecule test
- molecule --base-config molecule/_shared/base.yml test --scenario-name ${SCENARIO}

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
6 changes: 6 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ galaxy_info:
versions:
- 6
- 7
- name: Fedora
versions:
- 26
- 27
- 28
- name: FreeBSD
versions:
- 10.0
Expand All @@ -29,6 +34,7 @@ galaxy_info:
- name: Debian
versions:
- jessie
- stretch
- name: Windows
versions:
- 2012R2
Expand Down
47 changes: 47 additions & 0 deletions molecule/_shared/base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
scenario:
test_sequence:
- lint
# - destroy
# - dependency
- syntax
- create
# - prepare
- converge
- idempotence
# - side_effect
- verify
# - cleanup
- destroy
dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
provisioner:
name: ansible
config_options:
defaults:
deprecation_warnings: False
callback_whitelist: timer,profile_tasks
fact_caching: jsonfile
fact_caching_connection: ./cache
forks: 100
connection:
pipelining: True
options:
limit: all
playbooks:
converge: ../_shared/playbook.yml
inventory:
group_vars:
consul_instances:
consul_node_role: bootstrap
lint:
name: ansible-lint
verifier:
name: testinfra
directory: ../_shared/tests
lint:
name: flake8
9 changes: 9 additions & 0 deletions molecule/_shared/playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Converge
hosts: all
roles:
- role: ansible-consul

vars:
# TODO: Probably we need to install syslog-ng/rsyslog first
consul_syslog_enable: False
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ def test_hosts_file(host):
assert f.exists
assert f.user == 'root'
assert f.group == 'root'


def test_service(host):
consul = host.service('consul')

assert consul.is_running
assert consul.is_enabled
File renamed without changes.
11 changes: 11 additions & 0 deletions molecule/centos-6/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
scenario:
name: centos-6
platforms:
- name: centos-6
groups:
- consul_instances
image: dokken/centos-6
command: /sbin/init
capabilities:
- SYS_ADMIN
14 changes: 14 additions & 0 deletions molecule/centos-7/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Molecule managed

{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
13 changes: 13 additions & 0 deletions molecule/centos-7/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
scenario:
name: centos-7
platforms:
- name: centos-7
groups:
- consul_instances
image: dokken/centos-7
command: /usr/lib/systemd/systemd
capabilities:
- SYS_ADMIN
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
14 changes: 14 additions & 0 deletions molecule/debian-8/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Molecule managed

{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
12 changes: 12 additions & 0 deletions molecule/debian-8/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
scenario:
name: debian-8
platforms:
- name: debian-8
groups:
- consul_instances
image: dokken/debian-8
command: /lib/systemd/systemd
privileged: True
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
14 changes: 14 additions & 0 deletions molecule/debian-9/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Molecule managed

{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
13 changes: 13 additions & 0 deletions molecule/debian-9/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
scenario:
name: debian-9
platforms:
- name: debian-9
groups:
- consul_instances
image: dokken/debian-9
command: /lib/systemd/systemd
capabilities:
- SYS_ADMIN
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
Empty file added molecule/default/.gitkeep
Empty file.
33 changes: 0 additions & 33 deletions molecule/default/molecule.yml

This file was deleted.

29 changes: 0 additions & 29 deletions molecule/default/playbook.yml

This file was deleted.

14 changes: 14 additions & 0 deletions molecule/fedora-26/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Molecule managed

{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
13 changes: 13 additions & 0 deletions molecule/fedora-26/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
scenario:
name: fedora-26
platforms:
- name: fedora-26
groups:
- consul_instances
image: dokken/fedora-26
command: /usr/lib/systemd/systemd
capabilities:
- SYS_ADMIN
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
14 changes: 14 additions & 0 deletions molecule/fedora-27/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Molecule managed

{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
13 changes: 13 additions & 0 deletions molecule/fedora-27/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
scenario:
name: fedora-27
platforms:
- name: fedora-27
groups:
- consul_instances
image: dokken/fedora-27
command: /usr/lib/systemd/systemd
capabilities:
- SYS_ADMIN
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
14 changes: 14 additions & 0 deletions molecule/fedora-28/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Molecule managed

{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
13 changes: 13 additions & 0 deletions molecule/fedora-28/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
scenario:
name: fedora-28
platforms:
- name: fedora-28
groups:
- consul_instances
image: dokken/fedora-28
command: /usr/lib/systemd/systemd
capabilities:
- SYS_ADMIN
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
14 changes: 14 additions & 0 deletions molecule/oraclelinux-6/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Molecule managed

{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi
Loading

0 comments on commit 162bca7

Please sign in to comment.