{"id":21664424,"url":"https://github.com/wayofdev/ansible-role-tpl","last_synced_at":"2025-04-12T00:17:13.013Z","repository":{"id":39971585,"uuid":"492580401","full_name":"wayofdev/ansible-role-tpl","owner":"wayofdev","description":"Ansible template for wayofdev roles.","archived":false,"fork":false,"pushed_at":"2023-09-04T15:35:04.000Z","size":138,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T00:17:03.120Z","etag":null,"topics":["ansible","ansible-molecule","ansible-role","ansible-role-skeleton","automation","linux","macos","molecule"],"latest_commit_sha":null,"homepage":"https://wayof.dev","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wayofdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"wayofdev"}},"created_at":"2022-05-15T19:12:58.000Z","updated_at":"2023-03-20T09:24:22.000Z","dependencies_parsed_at":"2022-07-10T14:46:41.445Z","dependency_job_id":null,"html_url":"https://github.com/wayofdev/ansible-role-tpl","commit_stats":null,"previous_names":[],"tags_count":7,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofdev%2Fansible-role-tpl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofdev%2Fansible-role-tpl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofdev%2Fansible-role-tpl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofdev%2Fansible-role-tpl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wayofdev","download_url":"https://codeload.github.com/wayofdev/ansible-role-tpl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248497817,"owners_count":21113984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-molecule","ansible-role","ansible-role-skeleton","automation","linux","macos","molecule"],"created_at":"2024-11-25T10:38:35.407Z","updated_at":"2025-04-12T00:17:12.981Z","avatar_url":"https://github.com/wayofdev.png","language":"Makefile","funding_links":["https://github.com/sponsors/wayofdev"],"categories":[],"sub_categories":[],"readme":"\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg width=\"456\" src=\"https://raw.githubusercontent.com/wayofdev/ansible-role-tpl/master/assets/logo.gh-light-mode-only.png#gh-light-mode-only\"\u003e\n\u003cimg width=\"456\" src=\"https://raw.githubusercontent.com/wayofdev/ansible-role-tpl/master/assets/logo.gh-dark-mode-only.png#gh-dark-mode-only\"\u003e\n\u003c/div\u003e\n\n\n\u003cbr\u003e\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://actions-badge.atrox.dev/wayofdev/ansible-role-tpl/goto\"\u003e\u003cimg alt=\"Build Status\" src=\"https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fwayofdev%2Fansible-role-tpl%2Fbadge\u0026style=flat-square\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://galaxy.ansible.com/wayofdev/tpl\"\u003e\u003cimg alt=\"Ansible Role\" src=\"https://img.shields.io/ansible/role/59587?style=flat-square\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/wayofdev/ansible-role-tpl/tags\"\u003e\u003cimg src=\"https://img.shields.io/github/v/tag/wayofdev/ansible-role-tpl?sort=semver\u0026style=flat-square\" alt=\"Latest Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://galaxy.ansible.com/wayofdev/homebrew\"\u003e\u003cimg alt=\"Ansible Quality Score\" src=\"https://img.shields.io/ansible/quality/59587?style=flat-square\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://galaxy.ansible.com/wayofdev/homebrew\"\u003e\u003cimg alt=\"Ansible Role\" src=\"https://img.shields.io/ansible/role/d/59587?style=flat-square\"/\u003e\u003c/a\u003e\n\u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/wayofdev/ansible-role-tpl.svg?style=flat-square\u0026color=blue\" alt=\"Software License\"/\u003e\u003c/a\u003e\n\u003ca href=\"#\"\u003e\u003cimg alt=\"Commits since latest release\" src=\"https://img.shields.io/github/commits-since/wayofdev/ansible-role-tpl/latest?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n# Ansible Role: Template\n\nThis is template, that is used to create roles for wayofdev project.\n\nIf you **like/use** this role, please consider **starring** it. Thanks!\n\n\u003cbr\u003e\n\n## 🗂 Table of Contents\n\n   * [Directory Tree for Project](#-directory-tree-for-project)\n   * [IDE Support](#-ide-support)\n   * [Requirements](#-requirements)\n   * [Role Variables](#-role-variables)\n      * [Structure](#-structure)\n   * [Example Playbook](#-example-playbook)\n   * [Development](#-development)\n   * [Testing](#-testing)\n      * [on localhost](#-on-localhost)\n      * [over SSH](#-over-ssh)\n   * [Dependencies](#-dependencies)\n      * [for all](#-for-all)\n      * [only macOS](#-only-macos)\n      * [only Linux](#-only-linux)\n   * [Compatibility](#-compatibility)\n   * [License](#-license)\n   * [Author Information](#-author-information)\n   * [Credits and Resources](#-credits-and-resources)\n   * [Contributors](#-contributors)\n\n\u003cbr\u003e\n\n## 🌳 Directory Tree for Project\n\nRepository uses default structure, sugested by [Ansible Documentation](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html)\n\n```\n├── 📄 Makefile\n├── 📄 README.md\n├── 🗂 assets\n├── 🗂 contrib\n│   └── poetry-bin\n├── 🗂 defaults\n│   └── 📄 main.yml\n├── 🗂 files\n├── 🗂 handlers\n│   └── 📄 main.yml\n├── 🗂 meta\n│   └── 📄 main.yml\n├── 🗂 molecule\n│   ├── 🗂 _partials\n│   │   ├── 🗂 playbooks\n│   │   │   ├── 📄 converge.yml\n│   │   │   ├── 🗂 defaults\n│   │   │   └── 📄 verify.yml\n│   │   ├── 📄 ssh_config\n│   │   ├── 🗂 tasks\n│   │   │   └── 📄 setup.yml\n│   │   └── 🗂 vars\n│   │       └── 📄 main.yml\n│   ├── 🗂 default\n│   │   └── 📄 molecule.yml\n│   ├── 🗂 default-macos-on-localhost\n│   │   └── 📄 molecule.yml\n│   └── 🗂 default-macos-over-ssh\n│       └── 📄 molecule.yml\n├── 📄 pyproject.toml\n├── 📄 requirements.yml\n├── 🗂 tasks\n│   └── 📄 main.yml\n├── 🗂 templates\n└── 🗂 vars\n    └── 📄 main.yml\n```\n\n\u003cbr\u003e\n\n## 👨‍💻 IDE Support\n\nJetbrains products has great ansible language support together with [OrchidE plugin](https://plugins.jetbrains.com/plugin/12626-orchide--ansible-language-support).\n\n\u003e :warning: **Notice**: For ansible language support and autocompletion with [OrchidE](https://www.orchide.dev/pages/dokumentation) following additional `File Type Patterns` should be added.\n\nOpen Preferences → Languages \u0026 Frameworks → OrchidE → File Type Patterns:\n\n| Ansible Type | Regex Pattern                 | Pattern Type |\n| ------------ | ----------------------------- | ------------ |\n| RoleTask     | `.*/tasks/.*\\.ya?ml`          | Include      |\n| RoleTask     | `.*/handlers/.*\\.ya?ml`       | Include      |\n| Variable     | `.*/tests/defaults/.*\\.ya?ml` | Include      |\n| Variable     | `.*/defaults/.*\\.ya?ml`       | Include      |\n| Variable     | `.*/meta/.*\\.ya?ml`           | Include      |\n| Variable     | `.*/vars/.*\\.ya?ml`           | Include      |\n\n\u003cbr\u003e\n\n## 📑 Requirements\n\n* 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).\n* Compatible OS. See [compatibility](#-compatibility) table.\n* Role has dependencies on third-party roles on different operating systems. See `requirements.yml` and [dependencies](#-dependencies) section.\n\n\u003cbr\u003e\n\n## 🔧 Role Variables\n\nAvailable variables are listed below, along with example values (see `defaults/main.yml`). Additional variables are stored in `vars/main.yml`.\n\n\u003cbr\u003e\n\n### → Structure\n\n```yaml\n---\n\ntpl_key: value\n```\n\n\u003cbr\u003e\n\n## 📗 Example Playbook\n\n```yaml\n---\n\n- hosts: all\n  connection: local\n\n  vars:\n    tpl_key: value\n\n  roles:\n    - wayofdev.homebrew\n    - wayofdev.tpl\n```\n\n\u003cbr\u003e\n\n## ⚙️ Development\n\nTo install dependencies and start development you can check contents of our `Makefile`\n\n**Install** [poetry](https://github.com/python-poetry/poetry) using [poetry-bin](https://github.com/gi0baro/poetry-bin) and all dev python dependencies:\n\n```bash\n$ make install\n```\n\n**Install** only python dependencies, assuming that you already have poetry:\n\n```bash\n$ make install-deps\n```\n\n**Install** all git hooks:\n\n```bash\n$ make hooks\n```\n\n**Lint** all role files:\n\n```bash\n$ make lint\n```\n\n\u003cbr\u003e\n\n## 🧪 Testing\n\nYou 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:\n\n### → on localhost\n\n\u003e :warning: **Notice**: By defaut all tests are ran against your local machine!\n\n```bash\n# run molecule tests on localhost\n$ poetry run molecule test --scenario-name default-macos-on-localhost -- -vvv\n\n# or with make command\n$ make m-local\n\n# choose which tags will be included\n$ export TASK_TAGS=\"tpl-install,tpl-update\"; make m-local\n\n# runs molecule with docker driver\n$ poetry run molecule test --scenario-name default -- -vvv\n\n# or with make file\n$ make m-linux\n```\n\n\u003cbr\u003e\n\n### → over SSH\n\n```bash\n# run molecule scenarios against remote machines over SSH\n# this will need VM setup and configuration\n$ poetry run molecule test --scenario-name default-macos-over-ssh -- -vvv\n\n$ make m-remote\n\n# tags also can be passed\n$ export TASK_TAGS=\"tpl-install,tpl-update\"\n$ make m-remote\n```\n\n\u003cbr\u003e\n\n## 📦 Dependencies\n\nInstallation handled by `Makefile` and requirments are defined in `requirements.yml`\n\n### → for all\n\n  - [ansible.community.general](https://docs.ansible.com/ansible/latest/collections/community/general/index.html)\n\n### → only macOS\n\n  - [elliotweiser.osx-command-line-tools](https://galaxy.ansible.com/elliotweiser/osx-command-line-tools/)\n  - [wayofdev.homebrew](https://galaxy.ansible.com/wayofdev/homebrew)\n\n### → only Linux\n\n  - [geerlingguy.git](https://galaxy.ansible.com/geerlingguy/git)\n\n\u003cbr\u003e\n\n## 🧩 Compatibility\n\nThis role has been tested on these systems:\n\n| system / container | tag      |\n| :----------------- | -------- |\n| macos              | monterey |\n| macos              | big-sur  |\n| ubuntu             | jammy    |\n| ubuntu             | focal    |\n| debian             | bullseye |\n| debian             | buster   |\n| fedora             | 36       |\n| fedora             | 35       |\n| centos             | 8        |\n| centos             | 7        |\n\n\u003cbr\u003e\n\n## 🤝 License\n\n[![Licence](https://img.shields.io/github/license/wayofdev/ansible-role-tpl.svg?style=for-the-badge\u0026color=blue)](./LICENSE)\n\n\u003cbr\u003e\n\n## 🙆🏼‍♂️ Author Information\n\nThis role was created in **2022** by [lotyp / wayofdev](https://github.com/wayofdev).\n\n\u003cbr\u003e\n\n## 🧱 Credits and Resources\n\n**Inspired by:**\n\n* Some resources goes here if needed...\n\n\u003cbr\u003e\n\n## 🫡 Contributors\n\n\u003cimg align=\"left\" src=\"https://img.shields.io/github/contributors-anon/wayofdev/ansible-role-homebrew?style=for-the-badge\"/\u003e\n\n\u003ca href=\"https://github.com/wayofdev/ansible-role-tpl/graphs/contributors\"\u003e\n  \u003cimg src=\"https://opencollective.com/wod/contributors.svg?width=890\u0026button=false\"\u003e\n\u003c/a\u003e\n\n\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayofdev%2Fansible-role-tpl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwayofdev%2Fansible-role-tpl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayofdev%2Fansible-role-tpl/lists"}