This is template, that is used to create roles for wayofdev project.
If you like/use this role, please consider starring it. Thanks!
- Directory Tree for Project
- IDE Support
- Requirements
- Role Variables
- Example Playbook
- Development
- Testing
- Dependencies
- Compatibility
- License
- Author Information
- Credits and Resources
- Contributors
Repository uses default structure, sugested by Ansible Documentation
βββ π Makefile
βββ π README.md
βββ π assets
βββ π contrib
βΒ Β βββ poetry-bin
βββ π defaults
βΒ Β βββ π main.yml
βββ π files
βββ π handlers
βΒ Β βββ π main.yml
βββ π meta
βΒ Β βββ π main.yml
βββ π molecule
βΒ Β βββ π _partials
βΒ Β βΒ Β βββ π playbooks
βΒ Β βΒ Β βΒ Β βββ π converge.yml
βΒ Β βΒ Β βΒ Β βββ π defaults
βΒ Β βΒ Β βΒ Β βββ π verify.yml
βΒ Β βΒ Β βββ π ssh_config
βΒ Β βΒ Β βββ π tasks
βΒ Β βΒ Β βΒ Β βββ π setup.yml
βΒ Β βΒ Β βββ π vars
βΒ Β βΒ Β βββ π main.yml
βΒ Β βββ π default
βΒ Β βΒ Β βββ π molecule.yml
βΒ Β βββ π default-macos-on-localhost
βΒ Β βΒ Β βββ π molecule.yml
βΒ Β βββ π default-macos-over-ssh
βΒ Β βββ π molecule.yml
βββ π pyproject.toml
βββ π requirements.yml
βββ π tasks
βΒ Β βββ π main.yml
βββ π templates
βββ π vars
βββ π main.yml
Jetbrains products has great ansible language support together with OrchidE plugin.
β οΈ Notice: For ansible language support and autocompletion with OrchidE following additionalFile Type Patterns
should be added.
Open Preferences β Languages & Frameworks β OrchidE β File Type Patterns:
Ansible Type | Regex Pattern | Pattern Type |
---|---|---|
RoleTask | .*/tasks/.*\.ya?ml |
Include |
RoleTask | .*/handlers/.*\.ya?ml |
Include |
Variable | .*/tests/defaults/.*\.ya?ml |
Include |
Variable | .*/defaults/.*\.ya?ml |
Include |
Variable | .*/meta/.*\.ya?ml |
Include |
Variable | .*/vars/.*\.ya?ml |
Include |
- Up-to-date version of ansible. During maintenance/development, we stick to ansible versions and will use new features if they are available (and update
meta/main.yml
for the minimum version). - Compatible OS. See compatibility table.
- Role has dependencies on third-party roles on different operating systems. See
requirements.yml
and dependencies section.
Available variables are listed below, along with example values (see defaults/main.yml
). Additional variables are stored in vars/main.yml
.
---
tpl_key: value
---
- hosts: all
connection: local
vars:
tpl_key: value
roles:
- wayofdev.homebrew
- wayofdev.tpl
To install dependencies and start development you can check contents of our Makefile
Install poetry using poetry-bin and all dev python dependencies:
$ make install
Install only python dependencies, assuming that you already have poetry:
$ make install-deps
Install all git hooks:
$ make hooks
Lint all role files:
$ make lint
You can check Makefile
to get full list of commands for remote and local testing. For local testing you can use these comands to test whole role or separate tasks:
β οΈ Notice: By defaut all tests are ran against your local machine!
# run molecule tests on localhost
$ poetry run molecule test --scenario-name default-macos-on-localhost -- -vvv
# or with make command
$ make m-local
# choose which tags will be included
$ export TASK_TAGS="tpl-install,tpl-update"; make m-local
# runs molecule with docker driver
$ poetry run molecule test --scenario-name default -- -vvv
# or with make file
$ make m-linux
# run molecule scenarios against remote machines over SSH
# this will need VM setup and configuration
$ poetry run molecule test --scenario-name default-macos-over-ssh -- -vvv
$ make m-remote
# tags also can be passed
$ export TASK_TAGS="tpl-install,tpl-update"
$ make m-remote
Installation handled by Makefile
and requirments are defined in requirements.yml
This role has been tested on these systems:
system / container | tag |
---|---|
macos | monterey |
macos | big-sur |
ubuntu | jammy |
ubuntu | focal |
debian | bullseye |
debian | buster |
fedora | 36 |
fedora | 35 |
centos | 8 |
centos | 7 |
This role was created in 2022 by lotyp / wayofdev.
Inspired by:
- Some resources goes here if needed...