Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/x86-39/ansible_collection_diademiemi.template
Repository template for an Ansible collection with automatic GitHub Actions Molecule tests on changed roles
https://github.com/x86-39/ansible_collection_diademiemi.template
ansible ansible-collection ansible-collections boilerplate github-actions molecule template
Last synced: about 1 month ago
JSON representation
Repository template for an Ansible collection with automatic GitHub Actions Molecule tests on changed roles
- Host: GitHub
- URL: https://github.com/x86-39/ansible_collection_diademiemi.template
- Owner: x86-39
- License: mit
- Created: 2023-05-04T22:37:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-07T11:28:24.000Z (7 months ago)
- Last Synced: 2024-11-08T10:54:50.019Z (about 2 months ago)
- Topics: ansible, ansible-collection, ansible-collections, boilerplate, github-actions, molecule, template
- Language: Shell
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
Ansible Collection - diademiemi.template
========================================
Documentation for the collection template.Contents
========Roles
------
Role | Description | CI Status
--- | --- | ---Click on the role to see the README for that role.
Collection Structure
--------------This collection makes use of my [Ansible Role Template repository](https://github.com/diademiemi/ansible_role_%74emplate.git). The `add-role.sh` script downloads this Template and generates a new role with the name specified. If a `molecule/default/molecule.yml` file is present, it will be ran with GitHub Actions.
Usage:
```bash
export NEW_ROLE_NAME="new_role"
./add-role.sh ${NEW_ROLE_NAME}
```Using Template
--------------
To use this template for a new role, run```bash
export NEW_ROLE_NAME="NEW_NAME"
export GITHUB_USER="diademiemi"
export GALAXY_API_KEY="YOUR_API_KEY"find . -type f -exec sed -i "s/diademiemi/${GITHUB_USER}/g" {} + # Do not run this more than once
find . -type f -exec sed -i "s/template/${NEW_ROLE_NAME}/g" {} + # Do not run this more than once# Assumes repo is named ansible_role_${NEW_ROLE_NAME}
gh secret set GALAXY_API_KEY -R ${GITHUB_USER}/ansible_collection_${GITHUB_USER}.${NEW_COLLECTION_NAME} -a actions -b ${GALAXY_API_KEY}# Remove this section from README.md
sed -i "/Using Template/Q" README.md
```This is also provided as a script as `replace.sh`.