Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devel #30

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
offline: false

exclude_paths:
- .github/
- docs
- mkdocs.yml

warn_list:
- name[template]
- run-once[play]
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://github.com/orgs/redhat-cop/teams/rhis-code-admins
* @redhat-cop/rhis-code-admins
5 changes: 5 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Community Code of Conduct

The Ansible Community Code of Conduct emphasizes respect, patience, and inclusivity in all interactions. It encourages community members to be considerate, kind, and helpful, avoiding harassment or offensive behavior. The Code applies to all Ansible-related events, forums, and communications. Violations, including harassment, can be reported to event organizers or admins, with potential consequences like warnings or expulsion from events. The policy is designed to ensure a safe, welcoming environment for all contributors, regardless of background or skill level.

Please see the [Ansible Community Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).
72 changes: 72 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Contributor's Guidelines

Refer to the [Ansible Community Guide](https://docs.ansible.com/ansible/devel/community/index.html) for basic guideline.

## General Guidance
When making a contribution to the repositories of the Red Hat Communities of Practice, try to utilize the following set of guidelines outlined in this section. Committers should adhere to these practices as they attempt to address many (but not all) of the primary concerns associated with open source repositories and project management:

**Do:**

- Squash commits whenever possible
- Engage with the community and with contributors
- Write tests when applicable
- Discuss with other committers whenever you are unsure of something
- Create documentation, especially for new features and functionality
- Review existing content in order to avoid overwriting existing content
- Keep it simple
- Sign your commits

**Don’t:**

- Commit directly to the master branch
- Merge pull requests you have authored
- Break existing functionality
- Ignore requests for assistance
- Go against established repository and CoP norms

Please checkout [General Guidelines](../docs/general_guidelines.md) for more information.

Please follow [Ansible Good Practices](../docs/ansible_practices.md) as the project consists of full automation with Ansible.

And finally, you can benefit from the [Git Cheat Sheet](../docs/git_cheat_sheet.md) for the basics of using Git within the project.

## How to Contribute

Contributions from the community play an important role in the assets associated with the Red Hat Communities of Practice (CoP). We welcome contributions from the community. Here are a few ways you can help us improve.

### Open an Issue

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.

### Submit a Pull Request

If you feel like getting your hands dirty, feel free to make the change yourself. Here's how:

1. Fork the repo on Github, and then clone it locally.
2. Create a branch named appropriately for the change you are going to make. Follow the [branch standards](../docs/branch_standards.md) to create a branch.
3. Make your code change.
4. If you are creating a new role, please add a tests for it for use in a github action if possible.
5. Push your code change up to your forked repo.
6. Open a Pull Request to merge your changes to this repo. The comment box will be filled in automatically via a template.
7. 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.
8. PR must be reviewed and approved by two persons who own commit permissions.


See [Using Pull Requests](https://help.github.com/articles/using-pull-requests/) got more information on how to use GitHub PRs.

For an in depth guide on how to contribute see [this article](https://opensource.com/article/19/7/create-pull-request-github)

Note that we follow the [Automation Good Practices](https://redhat-cop.github.io/automation-good-practices) and so are you expected to do.

Use Github [discussions](https://github.com/redhat-cop/rhis-code/discussions) forum or for a live chat experience try
Matrix room [#aap_config_as_code:ansible.com](https://matrix.to/#/#aap_config_as_code:ansible.com).

## Code of Conduct

As with all Ansible projects, we have a [Code of Conduct](./CODE_OF_CONDUCT.md).

- [ansible communication](https://docs.ansible.com/ansible/latest/community/communication.html)
- [code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
- [creating your fork on github](https://guides.github.com/activities/forking/)
- [releases and maintenances](https://docs.ansible.com/ansible-core/devel/reference_appendices/release_and_maintenance.)
- [supported ansible versions](https://docs.ansible.com/ansible-core/devel/reference_appendices/release_and_maintenance.html#ansible-core-release-cycle)
92 changes: 92 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
name: 🐛 Bug Report
about: Create a bug report. Please test against the latest release before submitting
it. For anything else, please use the Forums link below.
title: 'BUG:'
labels: bug, new
assignees: ''

---

<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release are affected -->

## Summary

<!--- Explain the problem briefly below -->

*Provide a concise description of the bug.*

---

## Ansible, Collection details

<!--- Paste verbatim output between triple backticks -->

```console (paste below)
ansible --version

ansible-galaxy collection list

```

- ansible installation method: one of source, pip, OS package, EE

---

## OS / ENVIRONMENT

<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->

---

## Desired Behavior

<!--- Describe what you expected to happen when running the steps above -->

*Describe what actually expected.*

---

## Actual Behavior

<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->

Please give some details of what is actually happening.
Include a [minimum complete verifiable example] with:

- playbook / task
- configuration file / list
- error

<!--- Paste verbatim command output between triple backticks -->

```console (error)

```
---

## STEPS TO REPRODUCE

<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->

<!--- Paste example playbooks or commands between triple backticks below -->

```yaml (playbook/task)

```

```yaml (config/list/array/variables)

```

<!--- HINT: You can paste gist.github.com links for larger files -->

<!--- [minimum complete verifiable example]: http://stackoverflow.com/help/mcve -->

---

## Code of Conduct
*Read the Ansible Code of Conduct first.*

- [ ] I agree to follow the [Ansible Community Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: false # default is true
contact_links:
- name: 📝 Ansible Community Code of Conduct
url: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html
about: Be nice to other members of the community. Behave.
- name: 💬 Talk to Steering Committee
url: https://redhat.enterprise.slack.com/archives/C07TAP5PJ8K
about: Reach out to the Red Hat Community
56 changes: 56 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: ✨ Feature request
about: Suggest an idea for this project
title: 'RFE:'
labels: enhancement, new
assignees: ''

---

## Issue Summary

*Provide a concise description of the issue.*

---

## Steps to Reproduce

1. **Step 1**:
2. **Step 2**:
3. **Step 3**:

---

## Expected Behavior

**Describe the solution you'd like**
*A clear and concise description of what you want to happen.*

**Describe alternatives you've considered**
*A clear and concise description of any alternative solutions or features you've considered.*

---

## Actual Behavior

*Describe what actually happened.*

---

## Environment Details

- **OS**:
- **Ansible version** (if applicable):
- **Other relevant information**:

---

## Additional Context
*Add any other context or screenshots about the feature request here.*

---

## Code of Conduct
*Read the Ansible Code of Conduct first.*

- [ ] I agree to follow the [Ansible Community Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Summary

<!-- Use prefix such as NEW, CHG. FIX for the commits -->

## Connected merge requests

<!-- Paste links to related MRs or remove this section. -->

* showroom-inventory!xxx

## Functional test

<!--
Paste a link to the Ansible Automation Platform Controller job.
If not possible, paste ansible-playbook output.
-->
9 changes: 9 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Security Policy

## Supported Versions

Only the latest version is supported.

## Reporting a Vulnerability

For any issues or concerns, please contact: [@rhis-code-admins](https://github.com/orgs/redhat-cop/teams/rhis-code-admins)
3 changes: 3 additions & 0 deletions .github/ansible-code-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
schedule:
interval: "weekly"
65 changes: 65 additions & 0 deletions .github/disabled_workflows/ansible-lint-self-hosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: Ansible Lint on Self-Hosted Runner
run-name: ansible-lint validation on PR-${{ github.event.pull_request.number }}
on:
pull_request:
branches: ["main", "devel"]
jobs:
prepare-container:
name: Prepare for container
runs-on: [self-hosted]
steps:
- name: prepare environment for container
run: |
export XDG_RUNTIME_DIR=/run/user/$(id -u)
sudo rm -rf /opt/actions-runner/_work/_temp/_github_home/.cache/

ansible-lint:
name: Ansible Lint
runs-on: [self-hosted]
needs: prepare-container
container:
image: ubuntu:22.04
options: --memory-swap "4g" --memory "3g" --security-opt label:disable
env:
DOCKER_HOST: unix:$XDG_RUNTIME_DIR/podman/podman.sock
steps:
- name: Prepare Container
run: |
apt-get -y update
apt-get -y install --no-install-recommends wget
apt-get -y install git lsb-release
env:
DEBIAN_FRONTEND: noninteractive

- name: Git checkout
uses: actions/checkout@v4

- name: Populate ansdible config
run: |
cat <<EOF > ansible.cfg
[defaults]
collections_path = ./collections:./imported/collections
roles_path = ./roles:./imported:./imported/roles

[galaxy]
server_list = automation_hub_published, automation_hub_validated, galaxy

[galaxy_server.automation_hub_published]
url=https://console.redhat.com/api/automation-hub/content/published/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=${{ secrets.RH_AUTOMATION_HUB_TOKEN }}

[galaxy_server.automation_hub_validated]
url=https://console.redhat.com/api/automation-hub/content/validated/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=${{ secrets.RH_AUTOMATION_HUB_TOKEN }}

[galaxy_server.galaxy]
url=https://galaxy.ansible.com/
EOF

- name: Run ansible-lint
uses: ansible/ansible-lint@main
with:
working_directory: /__w/rhis-code/rhis-code
40 changes: 40 additions & 0 deletions .github/workflows/ansible-lint-github-hosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Ansible Lint on GitHub-Hosted Runner
run-name: ansible-lint validation on PR-${{ github.event.pull_request.number }}
on:
pull_request:
branches: ["main", "devel"]
jobs:
ansible-lint:
name: Ansible Lint
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Populate ansible config
run: |
cat <<EOF > ansible.cfg
[defaults]
collections_path = ./collections:./imported/collections
roles_path = ./roles:./imported:./imported/roles

[galaxy]
server_list = automation_hub_published, automation_hub_validated, galaxy

[galaxy_server.automation_hub_published]
url=https://console.redhat.com/api/automation-hub/content/published/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=${{ secrets.RH_AUTOMATION_HUB_TOKEN }}

[galaxy_server.automation_hub_validated]
url=https://console.redhat.com/api/automation-hub/content/validated/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=${{ secrets.RH_AUTOMATION_HUB_TOKEN }}

[galaxy_server.galaxy]
url=https://galaxy.ansible.com/
EOF

- name: Run ansible-lint
uses: ansible/ansible-lint@main
Loading