Skip to content

Commit ce18b42

Browse files
authored
Update pre-commit
1 parent ac1cd9f commit ce18b42

File tree

118 files changed

+7690
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+7690
-2
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# The exclude_paths does not appear to be working in pre-commit
3+
# this issue describes similar behavior but suggested fix doesn't work
4+
# https://github.com/ansible/ansible-lint/issues/371
5+
# exclude_paths:
6+
# - roles/master_role_example/
7+
exclude_paths:
8+
- '.github/'
9+
- 'roles/master_role_example/'
10+
- 'changelogs/'
11+
- '*.py'
12+
parseable: true
13+
use_default_rules: true
14+
# https://github.com/ansible/ansible-lint/issues/808
15+
# with verbosity set to 1, its dumping 'unknown file type messages'
16+
# verbosity: 1
17+
skip_list:
18+
- meta-unsupported-ansible
19+
- meta-runtime # This collection with the appropriate awx.awx or ansible.controller still works with older ansible.
20+
- fqcn[keyword]
21+
- fqcn[action-core]
22+
- role-name[path]
23+
- var-naming[no-role-prefix]
24+
- galaxy[version-incorrect] # Added because it doesn't like pre-v1.0.0 versions
25+
warn_list:
26+
- jinja[invalid] # Temporarily adding this due to https://github.com/ansible/ansible-lint/issues/3048
27+
kinds:
28+
- playbooks: "**/examples/*.{yml,yaml}"
29+
- tasks: "**/examples/tasks/*.yml"
30+
- vars: "**/examples/vars/*.yml"
31+
...

.ansible/collections/ansible_collections/infra/eda_configuration/.ansible/.lock

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
max-line-length=160
3+
ignore=E402
4+
extend-ignore = E203, W503
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Community Code of Conduct
2+
3+
Please see the [Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# How to Contribute
2+
3+
We welcome contributions from the community. Here are a few ways you can help us improve.
4+
5+
## Open an Issue
6+
7+
If you see something you'd like changed, but aren't sure how to change it, submit an issue describing what you'd like to see.
8+
9+
## Working Locally
10+
11+
Python's pre-commit tool can be installed, and hooks installed, to cleanup whitespace, newlines, and run yamllint and ansible-lint against your local changes before committing. This will help you avoid failures in the github workflows.
12+
13+
1. Create a local virtual environment for galaxy_configurations (suggested, its your system!)
14+
2. Use pip to install pre-commit in your environment of choice: `pip install pre-commit`
15+
3. Install pre-commit hooks with `pre-commit install --install-hooks -c .github/workflow-config/.pre-commit-config.yml`
16+
4. With hooks installed, they will be run automatically when you call `git commit`, blocking commit if any hooks fail.
17+
5. [Optional] If you want to ignore hook failures and commit anyway, use `git commit -n`
18+
6. [Optional] Run pre-commit checks at any time with `pre-commit run --all -c .github/workflow-config/.pre-commit-config.yml`.
19+
20+
Please see pre-commit documentation for further explanation: [Pre-commit](https://pre-commit.com/)
21+
22+
## Submit a Pull Request
23+
24+
If you feel like getting your hands dirty, feel free to make the change yourself. Here's how:
25+
26+
1. Fork the repo on Github, and then clone it locally.
27+
2. Create a branch named appropriately for the change you are going to make.
28+
3. Make your code change.
29+
4. If you are creating a new role, please add a test for it in our [testing playbooks.](https://github.com/redhat-cop/eda_configuration/blob/devel/tests/playbooks/) by adding a new role entry and adding the appropriate yaml file with test data in the eda_configs directory.
30+
5. Add a changelog fragment in `changelogs/fragments` as per <https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs>
31+
6. Push your code change up to your forked repo.
32+
7. Open a Pull Request to merge your changes to this repo. The comment box will be filled in automatically via a template.
33+
8. All Pull Requests will be subject to Ansible and Yaml Linting checks. Please make sure that your code complies and fix any warnings that arise. These are checks that appear at the bottom of your Pull Request.
34+
9. All Pull requests are subject to Testing against being used in eda controller As above there is a check at the bottom of your pull request for this named integration.
35+
36+
See [Using Pull Requests](https://help.github.com/articles/using-pull-requests/) got more information on how to use GitHub PRs.
37+
38+
For an in depth guide on how to contribute see [this article](https://opensource.com/article/19/7/create-pull-request-github)
39+
40+
Note that we follow the [Automation Good Practices](https://redhat-cop.github.io/automation-good-practices) and so are you expected to do.
41+
42+
Try our Matrix room [#aap_config_as_code:ansible.com](https://matrix.to/#/#aap_config_as_code:ansible.com).
43+
44+
For the full list of Ansible IRC and Mailing list, please see the
45+
[Ansible Communication] page.
46+
Release announcements will be made to the [Ansible Announce] list.
47+
48+
Possible security bugs should be reported via email
49+
to <mailto:[email protected]>.
50+
51+
## Code of Conduct
52+
53+
As with all Ansible projects, we have a [Code of Conduct].
54+
55+
[ansible announce](https://groups.google.com/forum/#!forum/ansible-announce)
56+
[ansible communication](https://docs.ansible.com/ansible/latest/community/communication.html)
57+
[code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
58+
[creating your fork on github](https://guides.github.com/activities/forking/)
59+
[supported ansible versions](https://docs.ansible.com/ansible-core/devel/reference_appendices/release_and_maintenance.html#ansible-core-release-cycle)
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
name: Bug report
3+
about: Create a bug report. Please test against the latest release before submitting
4+
it. For anything else, please use the Forums link below.
5+
title: ''
6+
labels: bug, new
7+
assignees: ''
8+
9+
---
10+
11+
<!--- Verify first that your issue is not already reported on GitHub -->
12+
<!--- Also test if the latest release are affected -->
13+
14+
# Summary
15+
16+
<!--- Explain the problem briefly below -->
17+
18+
# Issue Type
19+
20+
- Bug Report
21+
22+
# Ansible, Collection, Event Driven Ansible Controller details
23+
24+
<!--- Paste verbatim output between triple backticks -->
25+
26+
```console (paste below)
27+
ansible --version
28+
29+
ansible-galaxy collection list
30+
31+
Event Driven Ansible Controller version
32+
33+
```
34+
35+
- ansible installation method: one of source, pip, OS package, EE
36+
37+
# OS / ENVIRONMENT
38+
39+
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
40+
41+
# Desired Behavior
42+
43+
<!--- Describe what you expected to happen when running the steps above -->
44+
45+
# Actual Behavior
46+
47+
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->
48+
49+
Please give some details of what is actually happening.
50+
Include a [minimum complete verifiable example] with:
51+
52+
- playbook / task
53+
- configuration file / list
54+
- error
55+
56+
<!--- Paste verbatim command output between triple backticks -->
57+
58+
```console (error)
59+
60+
```
61+
62+
# STEPS TO REPRODUCE
63+
64+
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->
65+
66+
<!--- Paste example playbooks or commands between triple backticks below -->
67+
68+
```yaml (playbook/task)
69+
70+
```
71+
72+
```yaml (config/list/array/variables)
73+
74+
```
75+
76+
<!--- HINT: You can paste gist.github.com links for larger files -->
77+
78+
<!-- [minimum complete verifiable example]: http://stackoverflow.com/help/mcve -->
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
3+
blank_issues_enabled: false # default is true
4+
contact_links:
5+
- name: Feature requests
6+
url: https://github.com/redhat-cop/eda_configuration/discussions/categories/ideas
7+
about: Suggest an idea for this project
8+
- name: Discussions
9+
url: https://github.com/redhat-cop/eda_configuration/discussions
10+
about: Any kind of questions should go on the forum.
11+
- name: Ansible Code of Conduct
12+
url: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html
13+
about: Be nice to other members of the community. Behave.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement, new
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!--- markdownlint-disable MD041 -->
2+
# What does this PR do?
3+
4+
<!--- Brief explanation of the code or documentation change you've made -->
5+
6+
# How should this be tested?
7+
8+
<!--- Automated tests are preferred, but not always doable - especially for infrastructure. Include commands to run your new feature, and also post-run commands to validate that it worked. (please use code blocks to format code samples) -->
9+
10+
# Is there a relevant Issue open for this?
11+
12+
<!--- Provide a link to any open issues that describe the problem you are solving. -->
13+
resolves #[number]
14+
15+
# Other Relevant info, PRs, etc
16+
17+
<!--- Please provide link to other PRs that may be related (blocking, resolves, etc. etc.) -->
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[defaults]
2+
collections_paths=/home/runner/collections
3+
roles_path=roles/
4+
module_utils=plugins/module_utils
5+
library=plugins/modules
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
authors:
3+
- Chris Renwick @crenwick93
4+
- Tom Page @Tompage1994
5+
- Sean Sullivan @sean-m-sullivan
6+
- David Danielsson @djdanielsson
7+
dependencies: {}
8+
description: Ansible content that interacts with the Ansible EDA Controller.
9+
documentation: https://github.com/redhat-cop/eda_configuration/blob/devel/README.md
10+
license:
11+
- GPL-3.0-only
12+
namespace: {{ collection_namespace }}
13+
name: {{ collection_name }}
14+
version: {{ collection_version }}
15+
readme: README.md
16+
repository: {{ collection_repo }}
17+
issues: {{ collection_repo }}/issues
18+
tags:
19+
- cloud
20+
- infrastructure
21+
- ansible
22+
- event
23+
- driven
24+
- controller
25+
- eda
26+
- automation
27+
build_ignore:
28+
- tools
29+
- setup.cfg
30+
- galaxy.yml.j2
31+
- template_galaxy.yml
32+
- '*.tar.gz'
33+
...
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Test roles and modules
3+
on: [push, pull_request_target]
4+
5+
jobs:
6+
ci_standalone:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
eda_server_version:
11+
# Pinning to specific ref because of breaking changes to user endpoint after this. This will need to be recified later.
12+
- 93ef155accc3013f82a4870569638e7e1eaf2adc
13+
uses: "./.github/workflows/ci_standalone_versioned.yml"
14+
with:
15+
eda_server_version: ${{ matrix.eda_server_version }}
16+
gh_ref: ${{ github.event.pull_request.head.sha || github.sha }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
name: Test roles and modules with galaxy_ng
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
eda_server_version:
8+
description: The version to pull of galaxy_ng
9+
required: true
10+
type: string
11+
gh_ref:
12+
description: The ref in the repository to pull
13+
required: false
14+
default: devel
15+
type: string
16+
17+
env:
18+
EDA_IMAGE: quay.io/ansible/eda-server:sha-${{ inputs.eda_server_version }} # If we transfer back to branches/tags then this needs updating to match the branch
19+
20+
jobs:
21+
22+
integration:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
with:
27+
ref: ${{ inputs.gh_ref }}
28+
29+
- name: "Checkout eda-server"
30+
uses: actions/checkout@v2
31+
with:
32+
repository: ansible/eda-server
33+
path: eda-server
34+
ref: ${{ inputs.eda_server_version }}
35+
36+
- uses: actions/setup-python@v2
37+
with:
38+
python-version: "3.8"
39+
40+
- name: Update apt
41+
run: sudo apt -y update
42+
43+
- name: Install docker-compose
44+
run: sudo curl -SL https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose
45+
46+
- name: collect system info
47+
run: whoami; id; pwd; ls -al; uname -a ; df -h .; mount ; cat /etc/issue; docker --version ; ps aux | fgrep -i docker; ls -al /var/run/containerd/containerd.sock
48+
49+
# We might also want to spin up an AWX later here and set EDA_CONTROLLER_URL and EDA_CONTROLLER_SSL_VERIFY for integration testing but for now we can skip.
50+
51+
# We should also consider setting EDA_IMAGE_URL and EDA_UI_IMAGE_URL from the eda_server_version once images are properly tagged. We may not need to pull a different version of the repo but instead just point at a different image.
52+
53+
- name: Pull Images
54+
working-directory: eda-server/tools/docker
55+
run: docker compose -p eda -f docker-compose-stage.yaml pull
56+
57+
- name: Start stack
58+
working-directory: eda-server/tools/docker
59+
run: |
60+
docker-compose -p eda -f docker-compose-stage.yaml up -d
61+
while ! curl -s http://localhost:8000/_healthz | grep -q "OK"; do
62+
echo "Waiting for API to be ready..."
63+
sleep 1
64+
done
65+
66+
- name: Move ansible.cfg to root
67+
run: mv .github/files/ansible.cfg .
68+
69+
- name: Build and install the collection
70+
id: build
71+
uses: redhat-cop/ansible_collections_tooling/actions/build_ansible_collection@main
72+
with:
73+
collection_namespace: infra
74+
collection_name: eda_configuration
75+
collection_version: 0.0.1
76+
collection_repo: https://github.com/redhat-cop/eda_configuration
77+
78+
- name: "Verify collection installed"
79+
run: |
80+
ansible-galaxy collection list infra.eda_configuration
81+
ansible-doc --list infra.eda_configuration
82+
ansible-doc --list infra.eda_configuration -t lookup
83+
84+
- name: "Perform playbook collection tests"
85+
run: ansible-playbook tests/playbooks/testing_collections_playbook.yml -v -e eda_server_version=${{ inputs.eda_server_version }} -e git_repo_name=${{ github.event.repository.name }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
# https://github.com/marketplace/actions/issues-helper
3+
name: Check and close inactive
4+
5+
on:
6+
schedule:
7+
- cron: "0 6 * * *"
8+
9+
jobs:
10+
close-inactive-issues:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: close-issues
14+
uses: actions-cool/issues-helper@v3
15+
with:
16+
actions: 'close-issues'
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
labels: 'inactive'
19+
inactive-day: 7
20+
...

0 commit comments

Comments
 (0)