Skip to content

Commit

Permalink
molecule3
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaassssiiee committed Jan 15, 2021
1 parent 9ef88a9 commit 7f6b3a7
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 144 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Ansible Molecule

on:
push:
tags_ignore:
- '*'
pull_request:

jobs:
lint:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
with:
path: "${{ github.repository }}"
- name: molecule
uses: robertdebock/[email protected]
with:
command: lint
test:
needs:
- lint
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- name: checkout
uses: actions/checkout@v2
with:
path: "${{ github.repository }}"
- name: molecule
uses: robertdebock/[email protected]
with:
image: ${{ matrix.config.image }}
tag: ${{ matrix.config.tag }}
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

50 changes: 6 additions & 44 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,48 +1,10 @@
---

extends: default

rules:
braces:
min-spaces-inside: 0
max-spaces-inside: 1
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
colons:
max-spaces-before: 0
max-spaces-after: 1
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments:
level: warning
require-starting-space: false
min-spaces-from-content: 2
comments-indentation: disable
document-end: disable
document-start: disable
empty-lines:
max: 2
max-start: 0
max-end: 0
hyphens:
max-spaces-after: 1
indentation:
spaces: consistent
indent-sequences: true
check-multi-line-strings: false
key-duplicates: enable
line-length:
max: 500
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: false
new-line-at-end-of-file: enable
new-lines:
type: unix
trailing-spaces: enable
truthy:
allowed-values: ['true', 'false', 'on']
check-keys: true

ignore: |
.tox/
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# make a local environment and use molecule test

../base:
python3 -m venv ../base
# (source ../base/bin/activate && python3 -m pip install --upgrade pip)
(source ../base/bin/activate && pip3 install -r requirements.txt)
(source ../base/bin/activate && mol test)

clean:
rm -rf ../base
4 changes: 1 addition & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---
# Software collections offer latest versions of programming languages
collections_enabled: true

# When collections is enabled this is set for the major versions in tasks/main.yml
# base_git: rh-git218
14 changes: 0 additions & 14 deletions molecule/default/Dockerfile.j2

This file was deleted.

26 changes: 0 additions & 26 deletions molecule/default/INSTALL.rst

This file was deleted.

File renamed without changes.
20 changes: 5 additions & 15 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
lint: |
set -e
yamllint .
ansible-lint
platforms:
- name: base-git-centos7
image: milcom/centos7-systemd
Expand All @@ -15,17 +17,5 @@ platforms:
privileged: true
provisioner:
name: ansible
config_options:
defaults:
remote_tmp: /tmp
stdout_callback: yaml
playbooks:
converge: playbook.yml
lint:
name: ansible-lint
scenario:
name: default
verifier:
name: goss
lint:
name: yamllint
name: ansible
6 changes: 6 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
goss_version: v0.3.7
goss_arch: amd64
goss_dst: /usr/local/bin/goss
# yamllint disable-line rule:line-length
goss_sha256sum: 357f5c7f2e7949b412bce44349cd32ab19eb3947255a8ac805f884cc2c326059
# yamllint disable-line rule:line-length
goss_url: "https://github.com/aelsabbahy/goss/releases/download/{{ goss_version }}/goss-linux-{{ goss_arch }}"
goss_test_directory: /tmp
goss_format: tap
Expand All @@ -29,17 +31,21 @@
copy:
src: "{{ item }}"
dest: "{{ goss_test_directory }}/{{ item | basename }}"
mode: 0644
with_fileglob:
- "{{ lookup('env', 'MOLECULE_VERIFIER_TEST_DIRECTORY') }}/test_*.yml"

- name: Register test files
shell: "ls {{ goss_test_directory }}/test_*.yml"
changed_when: false
register: test_files

- name: Execute Goss tests
environment:
# yamllint disable-line rule:line-length
PATH: '/opt/rh/rh-git218/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
command: "{{ goss_dst }} -g {{ item }} validate -f {{ goss_format }}"
changed_when: false
register: test_results
with_items: "{{ test_files.stdout_lines }}"

Expand Down
11 changes: 8 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#pyyaml>3.12
# these python extensions are for testing
tox
molecule==2.22
docker
sh==1.12.14
molecule
molecule-docker
yamllint
ansible-lint
docker==4.2.2
anyconfig>=0.10.0 # not directly required, pinned by Snyk to avoid a vulnerability

23 changes: 0 additions & 23 deletions tox.ini

This file was deleted.

0 comments on commit 7f6b3a7

Please sign in to comment.