From a0c0e4bdae2a86b53c723834f3da358b6a4f1625 Mon Sep 17 00:00:00 2001 From: John Freeman Date: Fri, 18 Oct 2019 17:48:06 +0100 Subject: [PATCH] Updated Molecule to 2.22 (#64) Keeping up with the latest changes. --- .moleculew/molecule_version | 2 +- .yamllint | 22 ++++++++++++++++++++++ molecule/default/Dockerfile.j2 | 18 +++++++++++++----- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/.moleculew/molecule_version b/.moleculew/molecule_version index 83ecbf1..4699fb0 100644 --- a/.moleculew/molecule_version +++ b/.moleculew/molecule_version @@ -1 +1 @@ -2.20.2 +2.22 diff --git a/.yamllint b/.yamllint index ad0be76..8827676 100644 --- a/.yamllint +++ b/.yamllint @@ -1,3 +1,5 @@ +--- +# Based on ansible-lint config extends: default rules: @@ -7,5 +9,25 @@ rules: brackets: max-spaces-inside: 1 level: error + colons: + max-spaces-after: -1 + level: error + commas: + max-spaces-after: -1 + level: error + comments: disable + comments-indentation: disable + document-start: disable + empty-lines: + max: 3 + level: error + hyphens: + level: error + indentation: disable + key-duplicates: enable line-length: disable + new-line-at-end-of-file: disable + new-lines: + type: unix + trailing-spaces: disable truthy: disable diff --git a/molecule/default/Dockerfile.j2 b/molecule/default/Dockerfile.j2 index e6aa95d..0de39e6 100644 --- a/molecule/default/Dockerfile.j2 +++ b/molecule/default/Dockerfile.j2 @@ -6,9 +6,17 @@ FROM {{ item.registry.url }}/{{ item.image }} 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; \ +{% 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 && apt-get install -y python sudo bash ca-certificates iproute2 && apt-get clean; \ + elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \ + elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash iproute && 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 iproute2 && 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 + elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O; fi