{"id":16129974,"url":"https://github.com/jomrr/skeleton-ansible-role","last_synced_at":"2025-06-23T05:43:17.398Z","repository":{"id":49478572,"uuid":"192201229","full_name":"jomrr/skeleton-ansible-role","owner":"jomrr","description":"  Skeleton for use with ansible-galaxy to create a new ansible role.","archived":false,"fork":false,"pushed_at":"2024-07-18T19:12:25.000Z","size":250,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T10:04:06.323Z","etag":null,"topics":["ansible","ansible-skeleton","ansible-template"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jomrr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-16T14:33:57.000Z","updated_at":"2024-12-29T18:48:12.000Z","dependencies_parsed_at":"2024-07-18T23:28:15.841Z","dependency_job_id":"f71d8d15-1872-456a-a709-3f30fcd7f6e6","html_url":"https://github.com/jomrr/skeleton-ansible-role","commit_stats":null,"previous_names":["jomrr/ansible-role-skeleton","jomrr/skeleton-ansible-role"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jomrr%2Fskeleton-ansible-role","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jomrr%2Fskeleton-ansible-role/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jomrr%2Fskeleton-ansible-role/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jomrr%2Fskeleton-ansible-role/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jomrr","download_url":"https://codeload.github.com/jomrr/skeleton-ansible-role/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243933413,"owners_count":20370987,"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-skeleton","ansible-template"],"created_at":"2024-10-09T22:13:42.081Z","updated_at":"2025-03-18T14:30:51.330Z","avatar_url":"https://github.com/jomrr.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# skeleton-ansible-role\n\n![GitHub](https://img.shields.io/github/license/jomrr/skeleton-ansible-role) ![GitHub last commit](https://img.shields.io/github/last-commit/jomrr/skeleton-ansible-role) ![GitHub issues](https://img.shields.io/github/issues-raw/jomrr/skeleton-ansible-role) ![Travis (.com) branch](https://img.shields.io/travis/com/jomrr/skeleton-ansible-role/main?label=build)\n\n**[Molecule](https://molecule.readthedocs.io/en/latest/)-based role skeleton for use with ansible-galaxy to create a new ansible role.**\n\n\u003e This README does not explain how to use molecule. Please read the [docs](https://ansible.readthedocs.io/projects/molecule/) if you need to.\n\nTable of Contents\n\n- [skeleton-ansible-role](#skeleton-ansible-role)\n  - [Features](#features)\n  - [Quickstart](#quickstart)\n  - [Requirements](#requirements)\n    - [Docker Scenario (default)](#docker-scenario-default)\n    - [Libvirt Scenario (kvm)](#libvirt-scenario-kvm)\n    - [Podman Scenario (podman)](#podman-scenario-podman)\n    - [Tox Scenario (tox)](#tox-scenario-tox)\n    - [VirtualBox Scenario (vbox)](#virtualbox-scenario-vbox)\n  - [Usage](#usage)\n  - [Author and License](#author-and-license)\n\n## Features\n\n- include os specific variables\n  - first a `vars/{{ansible_os_family}}.yml` is included, automatically created when using this skeleton (e.g. `RedHat.yml` or `Archlinux.yml`)\n  - then the first found of the following, if you create them (e.g. `Fedora-31.yml`)\n    - `vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml`\n    - `vars/{{ ansible_distribution }}.yml`\n    - `vars/{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml`\n- install os specific packages\n- use predefined containers for testing, see [ansible-molecule-images](https://github.com/jomrr/ansible-molecule-images)\n- have a predefined README.md skeleton\n- use consistent comments in each `yml`-file\n\n```yaml\n---\n# role: ansible-role-foreman\n# file: defaults/main.yml\n\n# Default variables for foreman\n\n```\n\n**Listing 1:** Code Example of a newly generated role skeleton for `ansible-role-foreman`\n\n## Quickstart\n\n```shell\ngit clone https://github.com/jomrr/skeleton-ansible-role\nansible-galaxy role init --role-skeleton=./skeleton-ansible-role \u003crolename\u003e\n```\n\nFor a more convenient way see [Usage](#usage).\n\n## Requirements\n\nFor all scenarios the following is required\n\n- python3 (install via your os package manager)\n- [Ansible 2.17 or higher](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)\n\n```shell\npipx install ansible\n```\n\nThen you can install the required python3 modules for all scenarios as an unprivileged user with the folliwing command:\n\n```shell\npipx inject --indlcude-deps ansible ansible-lint molecule molecule-plugins[podman] molecule-plugins[vagrant] jmespath keyring\n```\n\n### Podman Scenario (default)\n\nFor running the default tests with molecule podman you just need to [install podman](https://podman.io/docs/installation).\n\n### Libvirt Scenario (kvm)\n\nTo use the predefined tests with vagrant libvirt you need to have the following packages installed:\n\n- qemu\n- virt-manager\n- libvirt-dev(el) package, dependnt on your os\n- [vagrant](http://vagrantup.com)\n\nYour user needs to be in the `libvirt` or `libvirtd` system group depending on your distribution, because the qemu system domain is used.\n\nAfter [installing vagrant](https://www.vagrantup.com/downloads.html) you need the [`vagrant-libvirt` plugin](https://github.com/vagrant-libvirt/vagrant-libvirt).\n\nYou can install it with:\n\n```shell\nvagrant plugin install vagrant-libvirt\n```\n\n### Podman Scenario (podman)\n\n[Podman](https://podman.io) should work out of the box, after it is installed.\n\nTo install it, see the [official instructions](https://podman.io/getting-started/installation.html) or you can also use my [ansible-role-podman](https://github.com/jomrr/ansible-role-podman).\n\n## Usage\n\nTo create a new ansible role with this skeleton, do the following:\n\n```shell\ngit clone https://github.com/jomrr/skeleton-ansible-role.git\nansible-galaxy role init --role-skeleton=./skeleton-ansible-role \u003crolename\u003e\n```\n\nIf you want to use it in a more convenient way, create a custom function e.g. in ~/.bashrc\n\n```shell\n# ansible-galaxy init with custom role-skeleton\nag-role() {\n    if [ -z \"$1\" ]; then\n        echo \"Please specify a role name that will be appended to \u003crolename\u003e\"\n        return 1\n    fi\n    ansible-galaxy role init --role-skeleton=${2:-'./skeleton-ansible-role'} $1\n}\n```\n\nThen you are able to issue for example\n\n```shell\nag-role dhcpd\n```\n\nto create a role skeleton for ansible-role-dhcpd.\n\n## Author(s) and License\n\n- :octocat:                 Author::    [jomrr](https://github.com/jomrr)\n- :triangular_flag_on_post: Copyright:: 2020, Jonas Mauer\n- :page_with_curl:          License::   [MIT](LICENSE)\n\nLicensed under [MIT License](http://opensource.org/licenses/mit-license.php).\nSee [LICENSE](https://github.com/jomrr/skeleton-ansible-role/blob/main/LICENSE) file in repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjomrr%2Fskeleton-ansible-role","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjomrr%2Fskeleton-ansible-role","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjomrr%2Fskeleton-ansible-role/lists"}