Skip to content

Commit

Permalink
Adding Markdownlint config and setting ansible-lint version (#1)
Browse files Browse the repository at this point in the history
* Adding Markdownlint config and setting ansible-lint version

* Switching Ansible Lint to Poetry

* Adding YAML lint ignore list

* Adding ansible-lint to Poetry

* Run ansible-lint via poetry. Update table of contents
  • Loading branch information
aia authored Nov 15, 2021
1 parent 1a9bbb6 commit af56ad2
Show file tree
Hide file tree
Showing 6 changed files with 242 additions and 3 deletions.
37 changes: 35 additions & 2 deletions .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,41 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v2

- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x64

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.1.11
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install Package
run: poetry install --no-interaction

- name: List installed packages
shell: bash -l {0}
run: |
source $VENV
pip list
- name: Run YAML Lint
uses: ibiqlik/action-yamllint@v3
run: poetry run yamllint .

- name: Run Ansible Lint
uses: ansible/ansible-lint-action@master
run: poetry run ansible-lint
12 changes: 12 additions & 0 deletions .markdownlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"default": true,
"MD025": false,
"MD013": {
"line_length": 120,
"tables": false,
"code_blocks": false
},
"MD033": false,
"MD036": false,
"MD041": false
}
7 changes: 7 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ extends: default
rules:
line-length:
max: 120

ignore: |
__pycache__/
.venv
.vscode
env/
venv/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<!-- markdownlint-disable-file MD014 -->

- [Ansible Amazon Base Repository](#ansible-amazon-base-repository)
- [About](#about)
- [Setting Up Ansible Environment](#setting-up-ansible-environment)
- [Configuring Python VENV and Ansible](#configuring-python-venv-and-ansible)
- [Editor Configuration](#editor-configuration)
Expand All @@ -14,6 +15,7 @@
- [Running Test Kitchen](#running-test-kitchen)
- [Running Integration Tests](#running-integration-tests)
- [Running Ansible Playbooks on AWS Instances](#running-ansible-playbooks-on-aws-instances)
- [Example Project: Build a Local Docker/Containerd Server VM](#example-project-build-a-local-dockercontainerd-server-vm)
- [Ansible References](#ansible-references)

## About
Expand Down
186 changes: 185 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pytest-testinfra = "^6.4.0"
colorama = "^0.4.4"
yamllint = "^1.26.3"
codespell = "^2.1.0"
ansible-lint = "^5.2.1"

[tool.poetry.dev-dependencies]

Expand Down

0 comments on commit af56ad2

Please sign in to comment.