Skip to content

Commit

Permalink
v1.0 (#2)
Browse files Browse the repository at this point in the history
* Create jekyll-gh-pages.yml

* docs 1.0

* init conversion

* Apply automatic changes

* Update jekyll-gh-pages.yml
  • Loading branch information
djdanielsson authored Mar 20, 2024
1 parent 427e62e commit df10248
Show file tree
Hide file tree
Showing 97 changed files with 10,405 additions and 451 deletions.
51 changes: 51 additions & 0 deletions .github/fix_readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
- name: Set collections
ansible.builtin.set_fact:
roles_list: []
r_roles: []

- name: Get collections
ansible.builtin.find:
path: "{{ r_tempfile.path }}/{{ outer_item}}/roles/"
file_type: directory
register: r_roles

- name: Set collections
ansible.builtin.set_fact:
roles_list: "{{ roles_list | default([]) + [item | ansible.builtin.basename] }}"
loop: "{{ r_roles['files'] | map(attribute='path') | flatten }}"

- name: Cleanup readme
ansible.builtin.lineinfile:
path: "{{ r_tempfile['path'] }}/{{ outer_item }}/roles/{{ item }}/README.md"
regex: '---'
state: absent
loop: "{{ roles_list }}"

- name: Remove join(',') that causes issues
ansible.builtin.replace:
path: "{{ r_tempfile['path'] }}/{{ outer_item }}/roles/{{ item }}/README.md"
regexp: "{{ _regex }}"
replace: ''
loop: "{{ roles_list }}"
vars:
_regex: \| map\(attribute='name'\) \| join\(','\)

- name: Update readme
ansible.builtin.lineinfile:
path: "{{ r_tempfile['path'] }}/{{ outer_item }}/roles/{{ item }}/README.md"
insertbefore: BOF
line: |
---
layout: default
---
loop: "{{ roles_list }}"

- name: Copy and rename readme
ansible.builtin.copy:
src: "{{ r_tempfile['path'] }}/{{ outer_item }}/roles/{{ item }}/README.md"
dest: "../_collections/{{ outer_item }}/{{ item }}.md"
remote_src: true
mode: "0644"
loop: "{{ roles_list }}"
...
94 changes: 94 additions & 0 deletions .github/index.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---

---

# Ansible Automation Platform Configuration as Code Collections

## Introduction

Several collections have been created by the Red Hat Communities of Practice to assist with configuring aspects of the Ansible Automation Platform (AAP) using configuration as code practices. This site will guide you through these collections, the use cases, how to use and strategies for scaling appropriately.

### Where to get and maintain this document

This document is published to [https://redhat-cop.github.io/aap_config_as_code_docs/](https://redhat-cop.github.io/aap_config_as_code_docs/), it is open source and its source code is maintained at [https://github.com/redhat-cop/aap_config_as_code_docs/](https://github.com/redhat-cop/aap_config_as_code_docs/).

## Getting Help

We are on the Ansible Forums and Matrix, if you want to discuss something, ask for help, or participate in the community, please use the #infra-config-as-code tag on the forum, or post to the chat in Matrix.

[Ansible Forums](https://forum.ansible.com/tag/infra-config-as-code)

[Matrix Chat Room](https://matrix.to/#/#aap_config_as_code:ansible.com)

## AAP Config as Code Collections
NOTE: Further documentation for these collections will be stored here.

Links to Ansible Automation Platform Collections

|Collection Name|Purpose|
|---------|---------|
|[awx.awx/Ansible.controller repo](https://github.com/ansible/awx/tree/devel/awx_collection)|Automation controller modules|
|[Ansible Hub Configuration](https://github.com/ansible/automation_hub_collection)|Automation hub configuration|

Links to other Validated Configuration Collections for Ansible Automation Platform

|Collection Name|Purpose|
|---------|---------|
|[Controller Configuration](https://github.com/redhat-cop/controller_configuration)|Automation controller configuration|
|[EE Utilities](https://github.com/redhat-cop/ee_utilities)|Execution Environment creation utilities|
|[AAP installation Utilities](https://github.com/redhat-cop/aap_utilities)|Ansible Automation Platform Utilities|
|[AAP Configuration Template](https://github.com/redhat-cop/aap_configuration_template)|Configuration Template for this suite|

{% if controller_config is defined %}
### Controller Configuration:
{% for each in controller_config | sort %}
* [{{ each | regex_replace('.md', '') }}](collections/controller_configuration/{{ each | regex_replace('.md', '.html') }})
{% endfor %}
{% endif %}

{% if galaxy_collection is defined %}
### Ansible Hub Configuration:
{% for each in galaxy_collection | sort %}
* [{{ each | regex_replace('.md', '') }}](collections/galaxy_collection/{{ each | regex_replace('.md', '.html') }})
{% endfor %}
{% endif %}

{% if eda_config is defined %}
### Event Driven Ansible Configuration:
{% for each in eda_config | sort %}
* [{{ each | regex_replace('.md', '') }}](collections/eda_config/{{ each | regex_replace('.md', '.html') }})
{% endfor %}
{% endif %}

{% if aap_utilities is defined %}
### AAP Installation Utilities:
{% for each in aap_utilities | sort %}
* [{{ each | regex_replace('.md', '') }}](collections/aap_utilities/{{ each | regex_replace('.md', '.html') }})
{% endfor %}
{% endif %}

{% if ee_utilities is defined %}
### Execution Environment Utilities:
{% for each in ee_utilities | sort %}
* [{{ each | regex_replace('.md', '') }}](collections/ee_utilities/{{ each | regex_replace('.md', '.html') }})
{% endfor %}
{% endif %}

## Contributing to this Documentation
We welcome community contributions to this documentation, or any of the mentioned collections. If you find problems, please open an issue and consider creating a PR against this, or any relevant, repository. More information about contributing can be found in our [Contribution Guidelines](CONTRIBUTE.html).

We have a community meeting every 4 weeks. Find the agenda in the issues and the calendar invitation below:

[Calendar](https://raw.githubusercontent.com/redhat-cop/controller_configuration/devel/docs/aap_config_as_code_public_meeting.ics)

## Code of Conduct

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

## Licensing

GNU General Public License v3.0 or later.

See [LICENSE](https://www.gnu.org/licenses/gpl-3.0.txt) to see the full text.
142 changes: 142 additions & 0 deletions .github/playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
- name: Generate index
hosts: localhost
connection: local
gather_facts: false
tasks:
- name: Create temporary direcotry
ansible.builtin.tempfile:
state: directory
suffix: temp
register: r_tempfile

- name: Create directories
ansible.builtin.file:
path: "{{ r_tempfile['path'] }}/{{ item }}"
state: directory
mode: "0755"
loop:
- controller_configuration
- galaxy_collection
- eda_configuration
- aap_utilities
- ee_utilities

- name: Clone controller_configuration
ansible.builtin.git:
repo: https://github.com/redhat-cop/controller_configuration.git
dest: "{{ r_tempfile['path'] }}/controller_configuration/"
single_branch: true
version: devel

- name: Clone galaxy_collection
ansible.builtin.git:
repo: https://github.com/ansible/galaxy_collection.git
dest: "{{ r_tempfile['path'] }}/galaxy_collection"
single_branch: true
version: devel

- name: Clone eda_configuration
ansible.builtin.git:
repo: https://github.com/redhat-cop/eda_configuration.git
dest: "{{ r_tempfile['path'] }}/eda_configuration"
single_branch: true
version: devel

- name: Clone aap_utilities
ansible.builtin.git:
repo: https://github.com/redhat-cop/aap_utilities.git
dest: "{{ r_tempfile['path'] }}/aap_utilities"
single_branch: true
version: devel

- name: Clone ee_utilities
ansible.builtin.git:
repo: https://github.com/redhat-cop/ee_utilities.git
dest: "{{ r_tempfile['path'] }}/ee_utilities"
single_branch: true
version: devel

- name: Get collections
ansible.builtin.find:
path: "{{ r_tempfile.path }}"
file_type: directory
register: r_directories

- name: Set collections
ansible.builtin.set_fact:
collection_list: "{{ collection_list | default([]) + [item | ansible.builtin.basename] }}"
loop: "{{ r_directories['files'] | map(attribute='path') | flatten }}"

- name: Loop through each collection
ansible.builtin.include_tasks: fix_readme.yml
loop: "{{ collection_list }}"
loop_control:
loop_var: outer_item

- name: Get list of files controller_config
ansible.builtin.find:
path: ../_collections/controller_configuration
file_type: file
patterns: '*.md'
register: r_controller_config

- name: Set file names controller_config
ansible.builtin.set_fact:
controller_config: "{{ controller_config | default([]) + [item | ansible.builtin.basename] }}"
loop: "{{ r_controller_config['files'] | map(attribute='path') | flatten }}"

- name: Get list of files galaxy_collection
ansible.builtin.find:
path: ../_collections/galaxy_collection
file_type: file
patterns: '*.md'
register: r_galaxy_collection

- name: Set file names galaxy_collection
ansible.builtin.set_fact:
galaxy_collection: "{{ galaxy_collection | default([]) + [item | ansible.builtin.basename] }}"
loop: "{{ r_galaxy_collection['files'] | map(attribute='path') | flatten }}"

- name: Get list of files eda_config
ansible.builtin.find:
path: ../_collections/eda_configuration
file_type: file
patterns: '*.md'
register: r_eda_config

- name: Set file names eda_config
ansible.builtin.set_fact:
eda_config: "{{ eda_config | default([]) + [item | ansible.builtin.basename] }}"
loop: "{{ r_eda_config['files'] | map(attribute='path') | flatten }}"

- name: Get list of files aap_utilities
ansible.builtin.find:
path: ../_collections/aap_utilities
file_type: file
patterns: '*.md'
register: r_aap_utilities

- name: Set file names aap_utilities
ansible.builtin.set_fact:
aap_utilities: "{{ aap_utilities | default([]) + [item | ansible.builtin.basename] }}"
loop: "{{ r_aap_utilities['files'] | map(attribute='path') | flatten }}"

- name: Get list of files ee_utilities
ansible.builtin.find:
path: ../_collections/ee_utilities
file_type: file
patterns: '*.md'
register: r_ee_utilities

- name: Set file names ee_utilities
ansible.builtin.set_fact:
ee_utilities: "{{ ee_utilities | default([]) + [item | ansible.builtin.basename] }}"
loop: "{{ r_ee_utilities['files'] | map(attribute='path') | flatten }}"

- name: Generate index template
ansible.builtin.template:
src: index.md.j2
dest: ../index.md
mode: "0644"
...
64 changes: 64 additions & 0 deletions .github/workflows/jekyll-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled

on:
# Runs on pushes targeting the default branch
push:
branches: ["devel"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Ansible
run: pip install ansible-core
- name: Run Ansible
run: cd .github; ansible-playbook playbook.yml
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Bundle install
run: bundle install
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- uses: stefanzweifel/git-auto-commit-action@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
43 changes: 0 additions & 43 deletions .github/workflows/make_docs.yml

This file was deleted.

Loading

0 comments on commit df10248

Please sign in to comment.