use second molecule scenario for custom ssh tests

Signed-off-by: rndmh3ro <[email protected]>
This commit is contained in:
rndmh3ro committed 2021-10-18 21:49:24 +02:00
1 parent bbc827e4a1
commit 55c83ac92d
8 files changed
+73 -225

No files matched your search

-1
View File
@@ -63,7 +63,6 @@ jobs:
export MOLECULE_DOCKER_COMMAND="/usr/lib/systemd/systemd"
fi
molecule --version
molecule test -s ssh_hardening_custom_tests
molecule test -s ssh_hardening
env:
MOLECULE_DISTRO: ${{ matrix.molecule_distro }}
@@ -0,0 +1,69 @@
---
name: "devsec.ssh_hardening with custom tests"
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
paths:
- 'roles/ssh_hardening/**'
- 'molecule/ssh_hardening_custom_tests/**'
- '.github/workflows/ssh_hardening_custom_tests.yml'
pull_request:
paths:
- 'roles/ssh_hardening/**'
- 'molecule/ssh_hardening_custom_tests/**'
- '.github/workflows/ssh_hardening_custom_tests.yml'
jobs:
build:
runs-on: ubuntu-18.04
env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1
strategy:
fail-fast: false
matrix:
molecule_distro:
- centos7
- centos8
- rocky8
- fedora
- ubuntu1804
- ubuntu2004
- debian9
- debian10
- amazon
# - arch # needs to be fixed
# - opensuse_tumbleweed # baseline is not compatible with suse
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
path: ansible_collections/devsec/hardening
submodules: true
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
sudo apt install git
python -m pip install --no-cache-dir --upgrade pip
pip install -r requirements.txt
working-directory: ansible_collections/devsec/hardening
- name: Create default collection path symlink
run: |
mkdir -p /home/runner/.ansible
ln -s /home/runner/work/ansible-os-hardening/ansible-os-hardening /home/runner/.ansible/collections
- name: Test with molecule
run: |
if [ "$MOLECULE_DISTRO" = "opensuse_tumbleweed" ]; then
export MOLECULE_DOCKER_COMMAND="/usr/lib/systemd/systemd"
fi
molecule --version
mol --base-config molecule/ssh_hardening/molecule.yml converge -s ssh_hardening_custom_tests
env:
MOLECULE_DISTRO: ${{ matrix.molecule_distro }}
working-directory: ansible_collections/devsec/hardening