Skip to content

Commit

Permalink
Add an extra role for testing limited version.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdebock committed Mar 3, 2023
1 parent 4c0c9e2 commit c320ea7
Show file tree
Hide file tree
Showing 37 changed files with 954 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- role: ansible-role-default
- role: ansible-role-preferences
- role: ansible-role-minimal
- role: ansible-role-version
steps:
- name: checkout
uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions templates/tox.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ envlist = py{310}-ansible{% raw %}{{% endraw %}{% for version in tox_ansible_ver
{% else %}
envlist = py{310}-ansible{5,6,7}
{% endif %}

skipsdist = true

[testenv]
Expand Down
14 changes: 14 additions & 0 deletions tests/ansible-role-version/.ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
#
# Ansible managed
#
exclude_paths:
- ./meta/preferences.yml
- ./molecule/default/prepare.yml
- ./molecule/default/converge.yml
- ./molecule/default/verify.yml
- ./molecule/default/collections.yml
- ./.tox
- ./.cache
- ./.github
- ./requirements.yml
2 changes: 2 additions & 0 deletions tests/ansible-role-version/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
github: robertdebock
32 changes: 32 additions & 0 deletions tests/ansible-role-version/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help me improve

---

## Describe the bug

A clear and concise description of what the bug is.

## Playbook

Please paste the playbook you are using. (Consider `requirements.yml` and
optionally the command you've invoked.)


```yaml
---
YOUR PLAYBOOK HERE
```

## Output

Show at least the error, possible related output, maybe just all the output.

## Environment

- Control node OS: [e.g. Debian 9] (`cat /etc/os-release`)
- Control node Ansible version: [e.g. 2.9.1] (`ansible --version`)
- Managed node OS: [e.g. CentOS 7] (`cat /etc/os-release`)

Please consider [sponsoring me](https://github.com/sponsors/robertdebock).
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project

---

## Proposed feature

A clear and concise description of what you want to happen.

## Rationale

Why is this feature required?

## Additional context

Add any other context about the feature request here.

Please consider [sponsoring me](https://github.com/sponsors/robertdebock).
8 changes: 8 additions & 0 deletions tests/ansible-role-version/.github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
#
# Ansible managed
#
repository:
description: Install and configure version on your system.
homepage: https://robertdebock.nl/
topics: version, ansible, molecule, tox, playbook, hacktoberfest
18 changes: 18 additions & 0 deletions tests/ansible-role-version/.github/workflows/galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
#
# Ansible managed
#

name: Release to Ansible Galaxy

on:
release:
types: [created, edited, published, released]
jobs:
release:
runs-on: ubuntu-20.04
steps:
- name: galaxy
uses: robertdebock/[email protected]
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
75 changes: 75 additions & 0 deletions tests/ansible-role-version/.github/workflows/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
#
# Ansible managed
#

name: Ansible Molecule

on:
push:
tags_ignore:
- '*'
pull_request:
schedule:
- cron: '9 5 5 * *'

jobs:
lint:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: ansible-lint
uses: ansible-community/ansible-lint-action@main
test:
needs:
- lint
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
config:
- image: "alpine"
tag: "latest"
- image: "amazonlinux"
tag: "1"
- image: "amazonlinux"
tag: "latest"
- image: "debian"
tag: "latest"
- image: "debian"
tag: "bookworm"
- image: "enterpriselinux"
tag: "7"
- image: "enterpriselinux"
tag: "8"
- image: "enterpriselinux"
tag: "latest"
- image: "fedora"
tag: "36"
- image: "fedora"
tag: "latest"
- image: "fedora"
tag: "rawhide"
- image: "opensuse"
tag: "latest"
- image: "ubuntu"
tag: "latest"
- image: "ubuntu"
tag: "focal"
- image: "ubuntu"
tag: "bionic"
steps:
- name: checkout
uses: actions/checkout@v3
with:
path: "${{ github.repository }}"
- name: disable apparmor for mysql
run: sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
- name: parse apparmor for mysql
run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- name: molecule
uses: robertdebock/[email protected]
with:
image: ${{ matrix.config.image }}
tag: ${{ matrix.config.tag }}
34 changes: 34 additions & 0 deletions tests/ansible-role-version/.github/workflows/requirements2png.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
#
# Ansible managed
#

on:
- push

name: Ansible Graphviz

jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v3
with:
path: ${{ github.repository }}
- name: create png
uses: robertdebock/[email protected]
- name: Commit files
run: |
cd ${{ github.repository }}
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: ${{ secrets.GITHUB_TOKEN }}
directory: ${{ github.repository }}
force: true
branch: png
20 changes: 20 additions & 0 deletions tests/ansible-role-version/.github/workflows/todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
#
# Ansible managed
#

name: "TODO 2 Issue"

on:
push:

jobs:
build:
runs-on: "ubuntu-20.04"
steps:
- uses: "actions/checkout@master"
- name: "TODO to Issue"
uses: "alstr/[email protected]"
id: "todo"
with:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions tests/ansible-role-version/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.molecule
*.log
*.swp
.tox
.cache
.DS_Store
50 changes: 50 additions & 0 deletions tests/ansible-role-version/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
image: "robertdebock/github-action-molecule:5.0.0"

variables:
PY_COLORS: 1

molecule:
script:
- if [ -f tox.ini ] ; then tox ; fi
- if [ ! -f tox.ini ] ; then molecule test ; fi
rules:
- if: $CI_COMMIT_REF_NAME == "master"
parallel:
matrix:
- image: "alpine"
tag: "latest"
- image: "amazonlinux"
tag: "1"
- image: "amazonlinux"
tag: "latest"
- image: "debian"
tag: "latest"
- image: "debian"
tag: "bookworm"
- image: "enterpriselinux"
tag: "7"
- image: "enterpriselinux"
tag: "8"
- image: "enterpriselinux"
tag: "latest"
- image: "fedora"
tag: "36"
- image: "fedora"
tag: "latest"
- image: "fedora"
tag: "rawhide"
- image: "opensuse"
tag: "latest"
- image: "ubuntu"
tag: "latest"
- image: "ubuntu"
tag: "focal"
- image: "ubuntu"
tag: "bionic"

galaxy:
script:
- ansible-galaxy role import --api-key ${GALAXY_API_KEY} robertdebock ${CI_PROJECT_NAME}
rules:
- if: $CI_COMMIT_TAG != null
24 changes: 24 additions & 0 deletions tests/ansible-role-version/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files

- repo: https://github.com/adrienverge/yamllint
rev: v1.26.3
hooks:
- id: yamllint
args: [-c=.yamllint]

- repo: https://github.com/robertdebock/pre-commit
rev: v1.5.2
hooks:
- id: ansible_role_find_unused_variable
- id: ansible_role_find_empty_files
- id: ansible_role_find_empty_directories
- id: ansible_role_find_undefined_handlers
- id: ansible_role_find_unquoted_values
- id: ansible_role_find_horizontal_when
16 changes: 16 additions & 0 deletions tests/ansible-role-version/.yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
extends: default

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
line-length: disable
truthy: disable

ignore: |
.tox/
.cache/
46 changes: 46 additions & 0 deletions tests/ansible-role-version/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behaviour that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behaviour by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behaviour and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behaviour.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviours that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behaviour may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
Loading

0 comments on commit c320ea7

Please sign in to comment.