Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bluehalo/ansible-roles
Reusable Ansible roles
https://github.com/bluehalo/ansible-roles
Last synced: about 1 month ago
JSON representation
Reusable Ansible roles
- Host: GitHub
- URL: https://github.com/bluehalo/ansible-roles
- Owner: bluehalo
- License: mit
- Created: 2017-03-08T16:10:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-08T02:18:31.000Z (almost 2 years ago)
- Last Synced: 2024-04-11T00:42:09.209Z (9 months ago)
- Language: Jinja
- Size: 409 KB
- Stars: 63
- Watchers: 22
- Forks: 50
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ansible-roles
Reusable Ansible roles
# System Requirements
These roles have only been tested with:
* Mac OS X 10.12 (Sierra)
* Ansible versions:
* 2.1.1.0
* 2.3.0.0In addition, some of the roles specifically target the RedHat OS family,
including CentOS and Amazon Linux, and may not function for other host OS's.Other roles may assume EC2 dynamic inventory.
If you are interested in other versions or functionality, please provide patches.
# Getting Started
Each role contains a README describing its usage.
# Developer Guide
To create a new role:
1. Create a new role skeleton
```
$ ansible-galaxy init rolename
```This creates a directory structure like:
rolename/
.travis.yml
README.md
defaults/
files/
handlers/
meta/
tasks/
templates/
tests/
vars/2. Implement role functionality
The following links as guides for best practices in creating the role:
* https://galaxy.ansible.com/intro#share
* https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+ConventionsBe sure to fill-in the template README.md file
To test your new role:
1. Test syntax
```
$ ansible-playbook -i rolename/tests/inventory rolename/tests/test.yml --syntax-check
```2. Execute role and validate - this may not be possible locally and may require a container
```
$ ansible-playbook -i rolename/tests/inventory rolename/tests/test.yml --connection=local --sudo
```3. Execute role again and verify idempotence
```
$ ansible-playbook -i rolename/tests/inventory rolename/tests/test.yml --connection=local --sudo \
| grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) \
|| (echo 'Idempotence test: fail' && exit 1)
```