Skip to content

Commit

Permalink
Merge pull request #1 from 0ta2/fix-molecule-test
Browse files Browse the repository at this point in the history
Fix molecule test
  • Loading branch information
0ta2 authored Mar 7, 2020
2 parents 983afb6 + 7461c36 commit 9a1f632
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cron_molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
MOLECULE_DISTRO: ['centos:centos7']
MOLECULE_DISTRO: ['centos:centos7', 'centos:centos8']
python-version: ['3.5']

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
MOLECULE_DISTRO: ['centos:centos7']
MOLECULE_DISTRO: ['centos:centos7', 'centos:centos8']
python-version: ['3.5']

steps:
Expand Down
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
repo_epel_role
=========

repoリポジトリをインストールするためのロールです
epelリポジトリをインストールするためのロールです

Requirements
------------
Expand Down
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ galaxy_info:
- name: EL
versions:
- 7
- 8
galaxy_tags:
- epel
- package
Expand Down
17 changes: 6 additions & 11 deletions molecule/default/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ FROM {{ item.registry.url }}/{{ item.image }}
FROM {{ item.image }}
{% endif %}

{% if item.env is defined %}
{% for var, value in item.env.items() %}
{% if value %}
ENV {{ var }} {{ value }}
{% endif %}
{% endfor %}
{% endif %}
ARG testarg=fail
ENV envarg=$testarg

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 python-apt aptitude && apt-get clean; \
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python3 sudo bash ca-certificates iproute2 python3-apt aptitude systemd-sysv && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install /usr/bin/python3 /usr/bin/python3-config /usr/bin/dnf-3 sudo bash iproute && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y /usr/bin/python /usr/bin/python2-config 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 iproute2 && xbps-remove -O; fi
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python3 sudo bash iproute2 && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python3 sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python3 sudo bash ca-certificates iproute2 && xbps-remove -O; fi
8 changes: 8 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: Converge
hosts: all

tasks:
- name: "Include repo_epel_role"
include_role:
name: "repo_epel_role"
9 changes: 3 additions & 6 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
platforms:
- name: instance
image: ${MOLECULE_DISTRO:-centos:7}
privileged: True
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
command: /sbin/init
provisioner:
name: ansible
verifier:
name: ansible
lint:
name: ansible-lint
5 changes: 0 additions & 5 deletions molecule/default/playbook.yml

This file was deleted.

6 changes: 2 additions & 4 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
---
# This is an example playbook to execute Ansible tests.

- name: Verify
hosts: all
tasks:
- name: Check Installed a EPEL Package.
- name: Check Installed a epel-release package.
package_facts:
manager: auto

- name: Test if EPEL Package is installed.
- name: Test if epel-release is installed.
assert:
that:
- "'epel-release' in ansible_facts.packages"

0 comments on commit 9a1f632

Please sign in to comment.