Sweeper.
This commit is contained in:
parent
b8a0bdfbcd
commit
7cb81c4f96
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
collections:
|
||||||
|
- name: community.docker
|
||||||
|
- name: community.general
|
||||||
|
|
@ -8,13 +8,13 @@ repos:
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
|
|
||||||
- repo: https://github.com/adrienverge/yamllint
|
- repo: https://github.com/adrienverge/yamllint
|
||||||
rev: v1.25.0
|
rev: v1.26.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: yamllint
|
- id: yamllint
|
||||||
args: [-c=.yamllint]
|
args: [-c=.yamllint]
|
||||||
|
|
||||||
- repo: https://github.com/ansible/ansible-lint
|
- repo: https://github.com/ansible/ansible-lint
|
||||||
rev: v4.3.7
|
rev: v5.0.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: ansible-lint
|
- id: ansible-lint
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
|
|
|
||||||
|
|
@ -13,3 +13,4 @@ rules:
|
||||||
|
|
||||||
ignore: |
|
ignore: |
|
||||||
.tox/
|
.tox/
|
||||||
|
.cache/
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,8 @@
|
||||||
dest: .github/FUNDING.yml
|
dest: .github/FUNDING.yml
|
||||||
- source: pre-commit-config.yaml
|
- source: pre-commit-config.yaml
|
||||||
dest: .pre-commit-config.yaml
|
dest: .pre-commit-config.yaml
|
||||||
|
- source: collections.yml
|
||||||
|
dest: molecule/default/collections.yml
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.source }}"
|
label: "{{ item.source }}"
|
||||||
|
|
||||||
|
|
@ -180,6 +182,8 @@
|
||||||
- source: gitlab-ci.yml
|
- source: gitlab-ci.yml
|
||||||
dest: .gitlab-ci.yml
|
dest: .gitlab-ci.yml
|
||||||
- source: requirements.txt
|
- source: requirements.txt
|
||||||
|
- source: requirements2png.yml
|
||||||
|
dest: .github/workflows/requirements2png.yml
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.source }}"
|
label: "{{ item.source }}"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,4 +68,4 @@
|
||||||
description: "Monthly test"
|
description: "Monthly test"
|
||||||
ref: master
|
ref: master
|
||||||
cron: '{{ letter_minute_mapping[role[0]] }} {{ letter_hour_mapping[role[0]] }} {{ letter_day_mapping[role[0]] }} * *'
|
cron: '{{ letter_minute_mapping[role[0]] }} {{ letter_hour_mapping[role[0]] }} {{ letter_day_mapping[role[0]] }} * *'
|
||||||
cron_timezone: UTC
|
cron_timezone: Amsterdam
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ directory="/home/robertdb/Documents/github.com/robertdebock"
|
||||||
pattern="ansible-role-"
|
pattern="ansible-role-"
|
||||||
|
|
||||||
# Print the header of the table.
|
# Print the header of the table.
|
||||||
echo "|Role name|Travis|GitHub Action|GitLab CI|Version|"
|
echo "|Role name|GitHub Action|GitLab CI|Version|"
|
||||||
echo "|---------|------|-------------|---------|-------|"
|
echo "|---------|-------------|---------|-------|"
|
||||||
|
|
||||||
# Loop over the found roles.
|
# Loop over the found roles.
|
||||||
cd ${directory} ; ls -d "${pattern}"* | while read rolename ; do
|
cd ${directory} ; ls -d "${pattern}"* | while read rolename ; do
|
||||||
|
|
@ -20,12 +20,11 @@ cd ${directory} ; ls -d "${pattern}"* | while read rolename ; do
|
||||||
|
|
||||||
# Save the markdown per column in a variable, better readable loop.
|
# Save the markdown per column in a variable, better readable loop.
|
||||||
galaxy="[${shortrolename}](https://galaxy.ansible.com/robertdebock/${shortrolename})"
|
galaxy="[${shortrolename}](https://galaxy.ansible.com/robertdebock/${shortrolename})"
|
||||||
travis="[](https://travis-ci.com/robertdebock/${rolename})"
|
|
||||||
github="[](https://github.com/robertdebock/${rolename}/actions)"
|
github="[](https://github.com/robertdebock/${rolename}/actions)"
|
||||||
gitlab="[](https://gitlab.com/robertdebock/${rolename})"
|
gitlab="[](https://gitlab.com/robertdebock/${rolename})"
|
||||||
version="[](https://github.com/robertdebock/${rolename}/releases)"
|
version="[](https://github.com/robertdebock/${rolename}/releases)"
|
||||||
|
|
||||||
# Print the line of one role.
|
# Print the line of one role.
|
||||||
echo "|${galaxy}|${travis}|${github}|${gitlab}|${version}|"
|
echo "|${galaxy}|${github}|${gitlab}|${version}|"
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
{{ meta.galaxy_info.description }}
|
{{ meta.galaxy_info.description }}
|
||||||
|
|
||||||
|Travis|GitHub|GitLab|Quality|Downloads|Version|
|
|GitHub|GitLab|Quality|Downloads|Version|
|
||||||
|------|------|------|-------|---------|-------|
|
|------|------|-------|---------|-------|
|
||||||
|[](https://travis-ci.com/{{ travis_namespace }}/ansible-role-{{ role_name }})|[](https://github.com/{{ github_namespace }}/ansible-role-{{ role_name }}/actions)|[](https://gitlab.com/{{ github_namespace }}/ansible-role-{{ role_name }})|[ }})](https://galaxy.ansible.com/{{ github_namespace }}/{{ role_name }})|[ }})](https://galaxy.ansible.com/{{ github_namespace }}/{{ role_name }})|[](https://github.com/{{ github_namespace }}/ansible-role-{{ role_name }}/releases/)|
|
|[](https://github.com/{{ github_namespace }}/ansible-role-{{ role_name }}/actions)|[](https://gitlab.com/{{ github_namespace }}/ansible-role-{{ role_name }})|[ }})](https://galaxy.ansible.com/{{ github_namespace }}/{{ role_name }})|[ }})](https://galaxy.ansible.com/{{ github_namespace }}/{{ role_name }})|[](https://github.com/{{ github_namespace }}/ansible-role-{{ role_name }}/releases/)|
|
||||||
|
|
||||||
## [Example Playbook](#example-playbook)
|
## [Example Playbook](#example-playbook)
|
||||||
|
|
||||||
|
|
@ -37,10 +37,10 @@ These variables are set in `defaults/main.yml`:
|
||||||
|
|
||||||
The following roles are used to prepare a system. You may choose to prepare your system in another way, I have tested these roles as well.
|
The following roles are used to prepare a system. You may choose to prepare your system in another way, I have tested these roles as well.
|
||||||
|
|
||||||
| Requirement | Travis | GitHub |
|
| Requirement | GitHub | GitLab |
|
||||||
|-------------|--------|--------|
|
|-------------|--------|--------|
|
||||||
{% for requirement in requirements.roles %}
|
{% for requirement in requirements.roles %}
|
||||||
| [{{ requirement.name }}](https://galaxy.ansible.com/{{ github_namespace }}/{{ requirement.name | regex_replace(github_namespace + '\.') }}) | [ }}.svg?branch=master)](https://travis-ci.com/{{ github_namespace }}/{{ requirement.name | regex_replace(github_namespace + '\.', 'ansible-role-') }}) | [ }}/workflows/Ansible%20Molecule/badge.svg)](https://github.com/{{ github_namespace }}/{{ requirement.name | regex_replace(github_namespace + '\.', 'ansible-role-') }}/actions) |
|
| [{{ requirement.name }}](https://galaxy.ansible.com/{{ github_namespace }}/{{ requirement.name | regex_replace(github_namespace + '\.') }}) | [ }}/workflows/Ansible%20Molecule/badge.svg)](https://github.com/{{ github_namespace }}/{{ requirement.name | regex_replace(github_namespace + '\.', 'ansible-role-') }}/actions) | [ }}/badges/master/pipeline.svg)](https://gitlab.com/{{ github_namespace }}/{{ requirement.name | regex_replace(github_namespace + '\.', 'ansible-role-') }})
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ Most roles require some kind of preparation, this is done in `molecule/default/p
|
||||||
This role is a part of many compatible roles. Have a look at [the documentation of these roles](https://robertdebock.nl/) for further information.
|
This role is a part of many compatible roles. Have a look at [the documentation of these roles](https://robertdebock.nl/) for further information.
|
||||||
|
|
||||||
Here is an overview of related roles:
|
Here is an overview of related roles:
|
||||||

|

|
||||||
|
|
||||||
## [Compatibility](#compatibility)
|
## [Compatibility](#compatibility)
|
||||||
|
|
||||||
|
|
@ -96,40 +96,8 @@ This role [refers to a version]({{ reference }}) released by {{ project_name }}.
|
||||||
|
|
||||||
This version reference means a role may get outdated. Monthly tests occur to see if [bit-rot](https://en.wikipedia.org/wiki/Software_rot) occured. If you however find a problem, please create an issue, I'll get on it as soon as possible.{% endif %}
|
This version reference means a role may get outdated. Monthly tests occur to see if [bit-rot](https://en.wikipedia.org/wiki/Software_rot) occured. If you however find a problem, please create an issue, I'll get on it as soon as possible.{% endif %}
|
||||||
|
|
||||||
## [Testing](#testing)
|
|
||||||
|
|
||||||
[Unit tests](https://travis-ci.com/{{ travis_namespace }}/ansible-role-{{ role_name }}) are done on every commit, pull request, release and periodically.
|
|
||||||
|
|
||||||
If you find issues, please register them in [GitHub](https://github.com/{{ github_namespace }}/ansible-role-{{ role_name }}/issues)
|
If you find issues, please register them in [GitHub](https://github.com/{{ github_namespace }}/ansible-role-{{ role_name }}/issues)
|
||||||
|
|
||||||
Testing is done using [Tox](https://tox.readthedocs.io/en/latest/) and [Molecule](https://github.com/ansible/molecule):
|
|
||||||
|
|
||||||
[Tox](https://tox.readthedocs.io/en/latest/) tests multiple ansible versions.
|
|
||||||
[Molecule](https://github.com/ansible/molecule) tests multiple distributions.
|
|
||||||
|
|
||||||
To test using the defaults (any installed ansible version, namespace: `{{ docker_namespace }}`, image: `{{ docker_image }}`, tag: `{{ docker_tag }}`):
|
|
||||||
|
|
||||||
```
|
|
||||||
molecule test
|
|
||||||
|
|
||||||
# Or select a specific image:
|
|
||||||
image=ubuntu molecule test
|
|
||||||
# Or select a specific image and a specific tag:
|
|
||||||
image="debian" tag="stable" tox
|
|
||||||
```
|
|
||||||
|
|
||||||
Or you can test multiple versions of Ansible, and select images:
|
|
||||||
Tox allows multiple versions of Ansible to be tested. To run the default (namespace: `{{ docker_namespace }}`, image: `{{ docker_image }}`, tag: `{{ docker_tag }}`) tests:
|
|
||||||
|
|
||||||
```
|
|
||||||
tox
|
|
||||||
|
|
||||||
# To run CentOS (namespace: `{{ docker_namespace }}`, tag: `{{ docker_tag }}`)
|
|
||||||
image="centos" tox
|
|
||||||
# Or customize more:
|
|
||||||
image="debian" tag="stable" tox
|
|
||||||
```
|
|
||||||
|
|
||||||
## [License](#license)
|
## [License](#license)
|
||||||
|
|
||||||
{{ meta.galaxy_info.license }}
|
{{ meta.galaxy_info.license }}
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,12 @@ exclude_paths:
|
||||||
{% if preferencesymlstat.stat.exists %}
|
{% if preferencesymlstat.stat.exists %}
|
||||||
- ./meta/preferences.yml
|
- ./meta/preferences.yml
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
- ./molecule/default/prepare.yml
|
||||||
|
- ./molecule/default/converge.yml
|
||||||
{% if verify.stat.exists %}
|
{% if verify.stat.exists %}
|
||||||
- ./molecule/default/verify.yml
|
- ./molecule/default/verify.yml
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
- ./molecule/default/collections.yml
|
||||||
- ./.tox
|
- ./.tox
|
||||||
|
- ./.cache
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ molecule:
|
||||||
script:
|
script:
|
||||||
- image=${image} tag=${tag} molecule test
|
- image=${image} tag=${tag} molecule test
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG == null
|
- if: $CI_COMMIT_REF_NAME == "master"
|
||||||
retry: 2
|
retry: 2
|
||||||
parallel:
|
parallel:
|
||||||
matrix:
|
matrix:
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ jobs:
|
||||||
path: {% raw %}"${{ github.repository }}"{% endraw %}
|
path: {% raw %}"${{ github.repository }}"{% endraw %}
|
||||||
|
|
||||||
- name: molecule
|
- name: molecule
|
||||||
uses: robertdebock/molecule-action@2.6.8
|
uses: robertdebock/molecule-action@2.6.16
|
||||||
with:
|
with:
|
||||||
command: lint
|
command: lint
|
||||||
test:
|
test:
|
||||||
|
|
@ -51,7 +51,7 @@ jobs:
|
||||||
- name: parse apparmor for mysql
|
- name: parse apparmor for mysql
|
||||||
run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
|
run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
|
||||||
- name: molecule
|
- name: molecule
|
||||||
uses: robertdebock/molecule-action@2.6.8
|
uses: robertdebock/molecule-action@2.6.16
|
||||||
with:
|
with:
|
||||||
image: {% raw %}${{ matrix.config.image }}{% endraw %}
|
image: {% raw %}${{ matrix.config.image }}{% endraw %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ dependency:
|
||||||
name: galaxy
|
name: galaxy
|
||||||
options:
|
options:
|
||||||
role-file: requirements.yml
|
role-file: requirements.yml
|
||||||
|
{% if requirements.collections is defined %}
|
||||||
|
requirements-file: requirements.yml
|
||||||
|
{% endif %}
|
||||||
lint: |
|
lint: |
|
||||||
set -e
|
set -e
|
||||||
yamllint .
|
yamllint .
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
---
|
||||||
|
{{ ansible_managed | comment }}
|
||||||
|
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
|
||||||
|
name: Ansible Graphviz
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: {% raw %}${{ github.repository }}{% endraw %}
|
||||||
|
|
||||||
|
- name: create png
|
||||||
|
uses: robertdebock/graphviz-action@1.0.7
|
||||||
|
- name: Commit files
|
||||||
|
run: |
|
||||||
|
cd {% raw %}${{ github.repository }}{% endraw %}
|
||||||
|
|
||||||
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --local user.name "github-actions[bot]"
|
||||||
|
git add requirements.dot requirements.png
|
||||||
|
git commit -m "Add generated files"
|
||||||
|
- name: save to png branch
|
||||||
|
uses: ad-m/github-push-action@master
|
||||||
|
with:
|
||||||
|
github_token: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
|
||||||
|
|
||||||
|
directory: {% raw %}${{ github.repository }}{% endraw %}
|
||||||
|
|
||||||
|
force: true
|
||||||
|
branch: png
|
||||||
|
|
@ -1,26 +1,28 @@
|
||||||
{{ ansible_managed | comment }}
|
{{ ansible_managed | comment }}
|
||||||
[tox]
|
[tox]
|
||||||
minversion = 3.20
|
minversion = 3.21.4
|
||||||
{% if tox_versions is defined %}
|
{% if tox_versions is defined %}
|
||||||
envlist = py{39}-ansible-{% raw %}{{% endraw %}{% for version in tox_versions %}{{ version }}{% if not loop.last %},{% endif %}{% endfor %}{% raw %}}{% endraw %}
|
envlist = py{39}-ansible-{% raw %}{{% endraw %}{% for version in tox_versions %}{{ version }}{% if not loop.last %},{% endif %}{% endfor %}{% raw %}}{% endraw %}
|
||||||
{% else %}
|
{% else %}
|
||||||
envlist = py{39}-ansible-{previous,current}
|
# 2.11 has been disabled: couldn't resolve module/action 'docker_container'.
|
||||||
|
envlist = py{39}-ansible-{2.9,2.10}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
skipsdist = true
|
skipsdist = true
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
deps =
|
deps =
|
||||||
previous: ansible>=2.9, <2.10
|
2.9: ansible == 2.9.*
|
||||||
current: ansible
|
2.10: ansible == 2.10.*
|
||||||
next: git+https://github.com/ansible/ansible.git@devel
|
2.11: git+https://github.com/ansible/ansible.git@devel
|
||||||
molecule[docker]>=3, <4
|
molecule[docker]
|
||||||
docker>=4.2, <4.3
|
docker == 4.*
|
||||||
ansible-lint
|
ansible-lint == 5.*
|
||||||
commands = molecule test
|
commands = molecule test
|
||||||
setenv =
|
setenv =
|
||||||
TOX_ENVNAME={envname}
|
TOX_ENVNAME={envname}
|
||||||
PY_COLORS=1
|
PY_COLORS=1
|
||||||
ANSIBLE_FORCE_COLOR=1
|
ANSIBLE_FORCE_COLOR=1
|
||||||
|
ANSIBLE_ROLES_PATH=../
|
||||||
|
|
||||||
passenv = namespace image tag
|
passenv = namespace image tag
|
||||||
|
|
|
||||||
|
|
@ -67,13 +67,15 @@ distribution_version_mapping:
|
||||||
all:
|
all:
|
||||||
- 32
|
- 32
|
||||||
- latest
|
- latest
|
||||||
- rawhide
|
# RawHide has package-GPG issues.
|
||||||
|
# - rawhide
|
||||||
32:
|
32:
|
||||||
- 32
|
- 32
|
||||||
33:
|
33:
|
||||||
- latest
|
- latest
|
||||||
34:
|
# RawHide has package-GPG issues.
|
||||||
- rawhide
|
# 34:
|
||||||
|
# - rawhide
|
||||||
OpenSUSE:
|
OpenSUSE:
|
||||||
all:
|
all:
|
||||||
- latest
|
- latest
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue