-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
363 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
warn_list: | ||
- '106' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
name: CI | ||
'on': | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '30 1 * * 3' | ||
|
||
jobs: | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the codebase | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install test dependencies | ||
run: pip install ansible-lint[community,yamllint] | ||
|
||
- name: Lint code | ||
run: | | ||
yamllint . | ||
ansible-lint | ||
molecule: | ||
name: Molecule | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: "${{ github.repository }}" | ||
needs: | ||
- lint | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- distro: ubuntu2004 | ||
ansible-version: '>=2.11.5' | ||
|
||
steps: | ||
- name: Check out the codebase | ||
uses: actions/checkout@v2 | ||
with: | ||
path: "${{ github.repository }}" | ||
|
||
- name: Set up Python 3 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install test dependencies | ||
run: pip install 'ansible${{ matrix.ansible-version }}' molecule[docker] docker | ||
|
||
- name: Run Molecule tests | ||
run: | | ||
molecule test | ||
env: | ||
ANSIBLE_FORCE_COLOR: '1' | ||
ANSIBLE_VERBOSITY: '2' | ||
MOLECULE_DEBUG: '1' | ||
MOLECULE_DISTRO: "${{ matrix.distro }}" | ||
PY_COLORS: '1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Release | ||
'on': | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the codebase | ||
uses: actions/checkout@v2 | ||
|
||
- name: Publish to Galaxy | ||
uses: robertdebock/[email protected] | ||
with: | ||
galaxy_api_key: ${{ secrets.ANSIBLE_GALAXY_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.DS_Store | ||
*/**.DS_Store | ||
._* | ||
.*.sw* | ||
*~ | ||
.idea/ | ||
.vscode/ | ||
*.retry | ||
|
||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"default": true, | ||
"first-header-h1": false, | ||
"first-line-h1": false, | ||
"line_length": false, | ||
"no-multiple-blanks": false, | ||
"fenced-code-language": true, | ||
"no-duplicate-header": { | ||
"siblings_only": true | ||
}, | ||
"code-block-style": { | ||
"style": "fenced" | ||
}, | ||
"single-trailing-newline": false, | ||
"MD033": { | ||
"allowed_elements": ["a", "pre", "br"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: fix-byte-order-marker | ||
- id: check-executables-have-shebangs | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
args: [--markdown-linebreak-ext=md] | ||
|
||
- repo: https://github.com/jorisroovers/gitlint | ||
rev: v0.15.1 | ||
hooks: | ||
- id: gitlint | ||
args: [--contrib=contrib-title-conventional-commits, --ignore=body-is-missing, --msg-filename] | ||
|
||
- repo: https://github.com/igorshubovych/markdownlint-cli | ||
rev: v0.28.1 | ||
hooks: | ||
- id: markdownlint | ||
exclude: .github/ISSUE_TEMPLATE | ||
|
||
- repo: https://github.com/detailyang/pre-commit-shell | ||
rev: v1.0.6 | ||
hooks: | ||
- id: shell-lint | ||
|
||
- repo: https://github.com/ansible-community/ansible-lint | ||
# This is intentionally being held back because of issues in v5 per | ||
# https://github.com/cisagov/skeleton-ansible-role/issues/69 | ||
rev: v5.4.0 | ||
hooks: | ||
- id: ansible-lint | ||
|
||
- repo: https://github.com/adrienverge/yamllint | ||
rev: v1.26.3 | ||
hooks: | ||
- id: yamllint | ||
name: yamllint | ||
description: This hook runs yamllint. | ||
entry: yamllint | ||
language: python | ||
types: [file, yaml] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ | |
"minSeverityLevel": "LOW", | ||
"issueType": "DEPENDENCY" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
braces: | ||
max-spaces-inside: 1 | ||
level: error | ||
brackets: | ||
max-spaces-inside: 1 | ||
level: error | ||
line-length: disable | ||
truthy: disable | ||
|
||
ignore: | | ||
.tox/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# ansible-role-template | ||
# ansible-role-template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# defaults file | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# handlers file | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# meta file | ||
--- | ||
galaxy_info: | ||
namespace: appsilon | ||
role_name: template | ||
author: Appsilon | ||
company: Appsilon | ||
description: Fill this in | ||
license: MIT | ||
min_ansible_version: 2.11.1 | ||
platforms: | ||
- name: Ubuntu | ||
versions: | ||
- focal | ||
galaxy_tags: | ||
- development | ||
- system | ||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
become: true | ||
pre_tasks: | ||
- name: include vars | ||
include_vars: "{{ playbook_dir }}/../../tests/vars/main.yml" | ||
roles: | ||
- ../../../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: instance | ||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest" | ||
command: ${MOLECULE_DOCKER_COMMAND:-""} | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
privileged: true | ||
pre_build_image: true | ||
provisioner: | ||
name: ansible | ||
playbooks: | ||
prepare: prepare.yml | ||
converge: converge.yml | ||
verify: verify.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- name: Prepare | ||
hosts: all | ||
become: true | ||
tasks: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
become: true | ||
tasks: | ||
- name: include tasks | ||
include: "{{ playbook_dir }}/../../tests/tasks/post.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"extends": [ | ||
"config:base" | ||
], | ||
"labels": [ | ||
"dependencies" | ||
], | ||
"packageRules": [ | ||
{ | ||
"automerge": false, | ||
"matchUpdateTypes": [ | ||
"patch", | ||
"pin", | ||
"digest", | ||
"minor" | ||
] | ||
}, | ||
{ | ||
"matchUpdateTypes": [ | ||
"major" | ||
], | ||
"reviewers": [ | ||
"team:infrastructure-team" | ||
] | ||
}, | ||
{ | ||
"automerge": false, | ||
"groupName": "dependencies", | ||
"managers": [ | ||
"pre-commit", | ||
"ansible", | ||
"github-actions" | ||
], | ||
"matchUpdateTypes": [ | ||
"minor", | ||
"patch" | ||
] | ||
} | ||
], | ||
"prConcurrentLimit": 2, | ||
"schedule": [ | ||
"every weekday", | ||
"after 9am and before 5pm" | ||
], | ||
"separateMinorPatch": true, | ||
"timezone": "Europe/Warsaw" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# tasks file | ||
--- | ||
- name: include variables | ||
include_vars: "{{ item }}" | ||
with_first_found: | ||
- "_{{ ansible_distribution_release }}.yml" | ||
- "_{{ ansible_distribution | lower }}.yml" | ||
- _default.yml | ||
tags: | ||
- configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{# | ||
# Jinja2 macro which converts Ansible map into GCFG format | ||
#} | ||
|
||
{%- macro gcfg_encode( | ||
item, | ||
delimiter=" = ", | ||
quote="" ) %} | ||
|
||
{%- for section, options in item.items() | sort %} | ||
{%- if options is mapping -%} | ||
{{ "\n[" ~ section ~ "]\n" }} | ||
{%- for property, value in options.items() | sort -%} | ||
{%- if value is string or value is number -%} | ||
{{ property ~ delimiter ~ quote ~ value ~ quote ~ "\n" }} | ||
{%- else %} | ||
{%- for v in value -%} | ||
{{ property ~ delimiter ~ quote ~ v ~ quote ~ "\n" }} | ||
{%- endfor %} | ||
{%- endif %} | ||
{%- endfor %} | ||
{%- endif %} | ||
{%- endfor %} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# post test file | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# test file | ||
--- | ||
- hosts: localhost | ||
connection: local | ||
become: true | ||
pre_tasks: | ||
- name: include vars | ||
include_vars: "{{ playbook_dir }}/vars/main.yml" | ||
roles: | ||
- ../../ | ||
post_tasks: | ||
- name: include tasks | ||
include: "{{ playbook_dir }}/tasks/post.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# vars file | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# vars file | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# vars file | ||
--- |