Skip to content

Commit

Permalink
Merge pull request #53 from donhector/converge
Browse files Browse the repository at this point in the history
Converge
  • Loading branch information
donhector committed Jan 17, 2022
2 parents 6f6e62a + ff9e3e5 commit 0447427
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 103 deletions.
16 changes: 8 additions & 8 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
exclude_paths:
- .cache/
- .git/
- .github/
- .idea/
- .vscode/
- .venv/
- .cache/
- .git/
- .github/
- .idea/
- .vscode/
- .venv/

skip_list:
- line-length
- package-latest
- line-length
- package-latest
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
PIPENV_VENV_IN_PROJECT="true"
#ANSIBLE_ROLES_PATH="${PWD}/.."
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
name: 📦 CI

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- main
- main
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Set up Python 3.
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: "3.9"

- name: Install pipenv
run: |
Expand All @@ -67,10 +67,12 @@ jobs:
run: make test
env:
MOLECULE_DISTRO: "${{ matrix.distros }}"
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"

- name: Automerge PR
# run only when an PR was actually opened and not on manual runs with no PR present
if: github.event != 'workflow_dispatch'
run: >-
gh pr merge --auto --merge --delete-branch ${{ github.event.pull_request.number }}
env:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_stages: [commit, manual]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: check-yaml
# https://github.com/pre-commit/pre-commit-hooks/issues/273
Expand Down
7 changes: 3 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"files.associations": {
"*.yml": "ansible",
"**/.github/**/*.yml": "yaml"
},
"python.pythonPath": ".venv/bin/python"
"*.yml": "ansible",
"**/.github/**/*.yml": "yaml"
}
}
20 changes: 17 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export PIPENV_VENV_IN_PROJECT := true
export ANSIBLE_ROLES_PATH := ${PWD}/..

define hr
@printf '%.s─' $$(seq 1 $$(tput cols))
Expand Down Expand Up @@ -43,9 +44,22 @@ security:
$(call hr)
@pipenv check

## Run just the role
run:
## Spin up a molecule instance
create:
@pipenv run molecule create

## Converge the role
converge: create
$(call hr)
@pipenv run molecule converge

.PHONY: all install lint test update clean security run
## Destroy the instance
destroy:
@pipenv run molecule destroy

## Run the role on localhost
run:
$(call hr)
@ansible-playbook -v tests/test.yml -i tests/inventory

.PHONY: all install lint test update clean security converge destroy run
Loading

0 comments on commit 0447427

Please sign in to comment.