Skip to content

Latest commit

 

History

History
301 lines (210 loc) · 8.74 KB

README.md

File metadata and controls

301 lines (210 loc) · 8.74 KB



Build Status Ansible Role Latest Version Ansible Quality Score Ansible Role Software License Commits since latest release

Ansible Role: Template

This is template, that is used to create roles for wayofdev project.

If you like/use this role, please consider starring it. Thanks!


🗂 Table of Contents


🌳 Directory Tree for Project

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

👨‍💻 IDE Support

Jetbrains products has great ansible language support together with OrchidE plugin.

⚠️ Notice: For ansible language support and autocompletion with OrchidE following additional File 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

📑 Requirements

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

🔧 Role Variables

Available variables are listed below, along with example values (see defaults/main.yml). Additional variables are stored in vars/main.yml.


→ Structure

---

tpl_key: value

📗 Example Playbook

---

- hosts: all
  connection: local

  vars:
    tpl_key: value

  roles:
    - wayofdev.homebrew
    - wayofdev.tpl

⚙️ Development

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

🧪 Testing

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:

→ on localhost

⚠️ 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

→ over SSH

# 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

📦 Dependencies

Installation handled by Makefile and requirments are defined in requirements.yml

→ for all

→ only macOS

→ only Linux


🧩 Compatibility

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

🤝 License

Licence


🙆🏼‍♂️ Author Information

This role was created in 2022 by lotyp / wayofdev.


🧱 Credits and Resources

Inspired by:

  • Some resources goes here if needed...

🫡 Contributors