Skip to content

Commit

Permalink
Init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ngotzmann committed Jan 11, 2024
0 parents commit 7fd932e
Show file tree
Hide file tree
Showing 16 changed files with 1,057 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
exclude_paths:
- molecule/

skip_list:
- 'unknown-module'
- 'command-shell, idempotency'
Empty file added .copier-answers.yml
Empty file.
74 changes: 74 additions & 0 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Validate infrastructure as code

on:
push:
branches:
- "dev"
- "main"
pull_request:
branches:
- "dev"
- "main"
schedule:
- cron: "0 7 * * 0"
jobs:
Linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ansible-lint
uses: ansible/ansible-lint@cc7f2f599318aa344fca575c635c2caa6d492a14

Security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Ensure results dir
run: mkdir -p kics-results/
- name: Run kics scan
uses: checkmarx/kics-github-action@3f21d96af19575aae6bf83ebdd7dee91d02fa746
with:
path: ./
output_path: kics-results/
fail_on: high,medium
type: Ansible
- name: Remove results directory
run: rm -rf kics-results/


Testing:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
with:
path: 'ansible_role_ensure_k8s_dashboard_state'

- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install test dependencies.
run: pip3 install -r ansible_role_ensure_k8s_dashboard_state/pip_requirements.txt

- uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79
name: "Enable k3d in gh action with creating a cluster"
with:
cluster-name: "test-cluster-1"
args: --agents 1

- name: Run Molecule tests
run: molecule test
working-directory: 'ansible_role_ensure_k8s_dashboard_state'
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'

Deprications:
runs-on: ubuntu-latest
steps:
- name: Ensure pluto is present
uses: FairwindsOps/pluto/github-action@ba8fec507d0e5ae0960530a60cd519875704a4b3
- name: Find deprecations
run: pluto detect-files -d ./
33 changes: 33 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# Based on ansible-lint config
extends: default

rules:
braces:
max-spaces-inside: 1
level: error
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
Loading

0 comments on commit 7fd932e

Please sign in to comment.