Skip to content

Commit

Permalink
Merge branch 'redhat-cop:devel' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-m-sullivan authored Nov 30, 2022
2 parents 7d8a160 + 5521dba commit c43e83c
Show file tree
Hide file tree
Showing 52 changed files with 648 additions and 142 deletions.
3 changes: 3 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Community Code of Conduct

Please see the [Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).
21 changes: 21 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,24 @@ If you feel like getting your hands dirty, feel free to make the change yourself
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)

Use Github [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).

For the full list of Ansible IRC and Mailing list, please see the
[Ansible Communication] page.
Release announcements will be made to the [Ansible Announce] list.

Possible security bugs should be reported via email
to <mailto:[email protected]>.

## Code of Conduct

As with all Ansible projects, we have a [Code of Conduct].

[ansible announce](https://groups.google.com/forum/#!forum/ansible-announce)
[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/)
[discussions](https://github.com/redhat-cop/controller_configuration/discussions)
[supported ansible versions](https://docs.ansible.com/ansible-core/devel/reference_appendices/release_and_maintenance.html#ansible-core-release-cycle)
77 changes: 77 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
name: Bug report
about: >
Create a bug report. Please test against the latest release before
submitting it. For anything else, please use discussions
link below.
labels: bug, new
---

<!--- 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 -->

# Issue Type

- Bug Report

# Ansible, Collection, Controller details

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

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

ansible-galaxy collection list

Controller version

```

- 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 -->

# 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
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
# 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: Feature requests
url: https://github.com/redhat-cop/controller_configuration/discussions/categories/ideas
about: Suggest an idea for this project
- name: Discussions
url: https://github.com/redhat-cop/controller_configuration/discussions
about: Any kind of questions should go on the forum.
- name: Ansible 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.
18 changes: 9 additions & 9 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<!-- markdownlint-disable MD041 -->
### What does this PR do?
<!--- markdownlint-disable MD041 -->
# What does this PR do?

Brief explanation of the code or documentation change you've made
<!--- Brief explanation of the code or documentation change you've made -->

### How should this be tested?
# How should this be tested?

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)
<!--- 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) -->

### Is there a relevant Issue open for this?
# Is there a relevant Issue open for this?

Provide a link to any open issues that describe the problem you are solving.
<!--- Provide a link to any open issues that describe the problem you are solving. -->
resolves #[number]

### Other Relevant info, PRs, etc
# Other Relevant info, PRs, etc

Please provide link to other PRs that may be related (blocking, resolves, etc. etc.)
<!--- Please provide link to other PRs that may be related (blocking, resolves, etc. etc.) -->
20 changes: 20 additions & 0 deletions .github/workflows/issue-close-inactive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# https://github.com/marketplace/actions/issues-helper
name: Check inactive

on:
schedule:
- cron: "0 6 * * *"

jobs:
close-inactive-issues:
runs-on: ubuntu-latest
steps:
- name: close-issues
uses: actions-cool/issues-helper@v3
with:
actions: 'close-issues'
token: ${{ secrets.GITHUB_TOKEN }}
labels: 'need info, inactive'
inactive-day: 7
...
21 changes: 21 additions & 0 deletions .github/workflows/issue-find-inactive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# https://github.com/marketplace/actions/issues-helper
name: Check inactive

on:
schedule:
- cron: "0 5 * * *"

jobs:
check-inactive:
runs-on: ubuntu-latest
steps:
- name: check-inactive
uses: actions-cool/issues-helper@v3
with:
actions: 'check-inactive'
token: ${{ secrets.GITHUB_TOKEN }}
inactive-day: 30
issue-state: open
exclude-labels: 'backlog, help wanted'
...
22 changes: 22 additions & 0 deletions .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# https://github.com/marketplace/actions/issues-helper
name: Issue Labeled

on:
issues:
types: [labeled]

jobs:
issue-labeled:
runs-on: ubuntu-latest
steps:
- name: Create comment
uses: actions-cool/issues-helper@v3
if: github.event.label.name == 'inactive' || github.event.label.name == 'need info'
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. Please ensure that you have filled out the issue template as much as possible and have answered any further questions asked. If you have not done so in the next 7 days this issue will be automatically closed.'
...
22 changes: 22 additions & 0 deletions .github/workflows/issue-remove-inactive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# https://github.com/marketplace/actions/issues-helper
name: Issue Remove Labels

on:
issues:
types: [edited, reopened, labeled]
issue_comment:
types: [created, edited]

jobs:
remove-inactive:
runs-on: ubuntu-latest
steps:
- name: remove inactive
if: github.event.issue.state == 'open' && github.event.issue.user != 'github-actions'
uses: actions-cool/issues-helper@v3
with:
actions: 'remove-labels'
issue-number: ${{ github.event.issue.number }}
labels: 'inactive'
...
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ More information about contributing can be found in our [Contribution Guidelines
## Code of Conduct

This collection follows the Ansible project's
[Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html).
[Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).
Please read and familiarize yourself with this document.

## Licensing
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/removed_ update_on_project_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
removed_features:
- update_on_project_update in inventory_source as an option due to the awx module no longer supports this option.
1 change: 1 addition & 0 deletions roles/filetree_read/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The following Variables set the organization where should be applied the configu
|`orgs:`|Acme|yes|This variable sets the organization where should be applied the configuration.|
|`dir_orgs_vars:`|orgs_vars|yes|This variable sets the directory path where the variables will be store.|
|`env:`|dev|yes|This variable sets the life-cycle environment to use.|
|`controller_location:`|''|no|This variable sets object localtion. It is useful when the configuration need to be replicated in an active/passive sites architecture|
|`filetree_controller_settings`|{{ dir_orgs_vars }}/{{ orgs }}/env/{{ env }}/controller_settings.d/|yes|Directory path to load controller object variables|
|`filetree_controller_organizations`|{{ dir_orgs_vars }}/{{ orgs }}/env/common/controller_organizations.d/|yes|Directory path to load controller object variables|
|`filetree_controller_labels`|{{ dir_orgs_vars }}/{{ orgs }}/env/common/controller_labels.d/|yes|Directory path to load controller object variables|
Expand Down
10 changes: 7 additions & 3 deletions roles/filetree_read/tasks/applications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@

- name: "Read Applications definitions"
ansible.builtin.include_vars:
file: "{{ item.path }}"
file: "{{ __read_applications_definitions_item.path }}"
loop: "{{ __list_files_controller_applications.files }}"
loop_control:
loop_var: __read_applications_definitions_item
register: __contents_filetree_controller_applications

- name: "Populate Applications list"
ansible.builtin.set_fact:
__populate_controller_applications: "{{ (__populate_controller_applications | default([])) + item.ansible_facts.controller_applications }}"
__populate_controller_applications: "{{ (__populate_controller_applications | default([])) + __populate_applications_list_item.ansible_facts.controller_applications }}"
loop: "{{ __contents_filetree_controller_applications.results }}"
when: __contents_filetree_controller_applications.results is defined and item.ansible_facts.controller_applications is defined
loop_control:
loop_var: __populate_applications_list_item
when: __contents_filetree_controller_applications.results is defined and __populate_applications_list_item.ansible_facts.controller_applications is defined

- name: "Set Applications Data Structure"
ansible.builtin.set_fact:
Expand Down
10 changes: 7 additions & 3 deletions roles/filetree_read/tasks/credential_input_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@

- name: "Read Credential Input Sources definitions"
ansible.builtin.include_vars:
file: "{{ item.path }}"
file: "{{ __read_input_sources_definitions_item.path }}"
loop: "{{ __list_files_controller_credential_input_sources.files }}"
loop_control:
loop_var: __read_input_sources_definitions_item
register: __contents_filetree_controller_credential_input_sources

- name: "Populate Credential Input Sources list"
ansible.builtin.set_fact:
__populate_controller_credential_input_sources: "{{ (__populate_controller_credential_input_sources | default([])) + item.ansible_facts.controller_credential_input_sources }}"
__populate_controller_credential_input_sources: "{{ (__populate_controller_credential_input_sources | default([])) + __populate_input_sources_list_item.ansible_facts.controller_credential_input_sources }}"
loop: "{{ __contents_filetree_controller_credential_input_sources.results }}"
when: __contents_filetree_controller_credential_input_sources.results is defined and item.ansible_facts.controller_credential_input_sources is defined
loop_control:
loop_var: __populate_input_sources_list_item
when: __contents_filetree_controller_credential_input_sources.results is defined and __populate_input_sources_list_item.ansible_facts.controller_credential_input_sources is defined

- name: "Set Credential Input Sources Data Structure"
ansible.builtin.set_fact:
Expand Down
10 changes: 7 additions & 3 deletions roles/filetree_read/tasks/credential_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@

- name: "Read Credential_Types definitions"
ansible.builtin.include_vars:
file: "{{ item.path }}"
file: "{{ __read_credentials_definitions_item.path }}"
loop: "{{ __list_files_controller_credential_types.files }}"
loop_control:
loop_var: __read_credentials_definitions_item
register: __contents_filetree_controller_credential_types

- name: "Populate Credential_Types list"
ansible.builtin.set_fact:
__populate_controller_credential_types: "{{ (__populate_controller_credential_types | default([])) + item.ansible_facts.controller_credential_types }}"
__populate_controller_credential_types: "{{ (__populate_controller_credential_types | default([])) + __populate_credentials_list_item.ansible_facts.controller_credential_types }}"
loop: "{{ __contents_filetree_controller_credential_types.results }}"
when: __contents_filetree_controller_credential_types.results is defined and item.ansible_facts.controller_credential_types is defined
loop_control:
loop_var: __populate_credentials_list_item
when: __contents_filetree_controller_credential_types.results is defined and __populate_credentials_list_item.ansible_facts.controller_credential_types is defined

- name: "Set Projects Data Structure"
ansible.builtin.set_fact:
Expand Down
39 changes: 36 additions & 3 deletions roles/filetree_read/tasks/credentials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,48 @@

- name: "Read Credentials definitions"
ansible.builtin.include_vars:
file: "{{ item.path }}"
file: "{{ __read_credentials_definitions_item.path }}"
loop: "{{ __list_files_controller_credentials.files }}"
loop_control:
loop_var: __read_credentials_definitions_item
register: __contents_filetree_controller_credentials

- name: "Populate Credentials list"
ansible.builtin.set_fact:
__populate_controller_credentials: "{{ (__populate_controller_credentials | default([])) + item.ansible_facts.controller_credentials }}"
__populate_controller_credentials: "{{ (__populate_controller_credentials | default([])) + __populate_credentials_list_item.ansible_facts.controller_credentials }}"
loop: "{{ __contents_filetree_controller_credentials.results }}"
when: __contents_filetree_controller_credentials.results is defined and item.ansible_facts.controller_credentials is defined
loop_control:
loop_var: __populate_credentials_list_item
when: __contents_filetree_controller_credentials.results is defined and __populate_credentials_list_item.ansible_facts.controller_credentials is defined

- name: "Segregated Credentials list when controller_location is defined"
when: controller_location is defined and __populate_controller_credentials is defined
block:
- name: "Populate Credentials list by _common objects"
ansible.builtin.set_fact:
__populate_controller_credentials_common: "{{ (__populate_controller_credentials_common | default([])) + [__populate_credentials_list_common_item] }}"
loop: "{{ __populate_controller_credentials }}"
loop_control:
loop_var: __populate_credentials_list_common_item
when: "__populate_credentials_list_common_item.controller_location is not defined"

- name: "Populate Credentials list by __site objects"
ansible.builtin.set_fact:
__populate_controller_credentials_site: "{{ (__populate_controller_credentials_site | default([])) + [__populate_credentials_list_site_item] }}"
loop: "{{ __populate_controller_credentials }}"
loop_control:
loop_var: __populate_credentials_list_site_item
when: "__populate_credentials_list_site_item.controller_location is defined and __populate_credentials_list_site_item.controller_location == controller_location"

- name: "Concatenate Credentials list common + site"
ansible.builtin.set_fact:
__populate_controller_credentials_total: "{{ __populate_controller_credentials_common | default([]) + __populate_controller_credentials_site }}"
when: __populate_controller_credentials_site is defined

- name: "Set Credentials Data Structure common + site concatenated"
ansible.builtin.set_fact:
__populate_controller_credentials: "{{ __populate_controller_credentials_total }}"
when: __populate_controller_credentials_total is defined

- name: "Set Credentials Data Structure"
ansible.builtin.set_fact:
Expand Down
Loading

0 comments on commit c43e83c

Please sign in to comment.