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