{"id":29407255,"url":"https://github.com/tosin2013/molecule-podman-template","last_synced_at":"2026-05-18T05:44:26.338Z","repository":{"id":272293738,"uuid":"916112602","full_name":"tosin2013/molecule-podman-template","owner":"tosin2013","description":"This template provides a foundation for creating Ansible roles specifically designed for Red Hat Enterprise Linux (RHEL) 9.5 environments. It includes the basic structure and testing capabilities using Molecule with Podman as the container engine.","archived":false,"fork":false,"pushed_at":"2025-01-17T02:03:48.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T20:44:17.359Z","etag":null,"topics":["ansible","kvm","libvirt","molecule","rhel9"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tosin2013.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-13T13:34:51.000Z","updated_at":"2025-01-17T02:03:49.000Z","dependencies_parsed_at":"2025-10-24T20:38:15.644Z","dependency_job_id":null,"html_url":"https://github.com/tosin2013/molecule-podman-template","commit_stats":null,"previous_names":["tosin2013/molecule-podman-template"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tosin2013/molecule-podman-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tosin2013%2Fmolecule-podman-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tosin2013%2Fmolecule-podman-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tosin2013%2Fmolecule-podman-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tosin2013%2Fmolecule-podman-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tosin2013","download_url":"https://codeload.github.com/tosin2013/molecule-podman-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tosin2013%2Fmolecule-podman-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33166774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","kvm","libvirt","molecule","rhel9"],"created_at":"2025-07-11T00:41:26.643Z","updated_at":"2026-05-18T05:44:26.305Z","avatar_url":"https://github.com/tosin2013.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Role Template for RHEL 9.5 with Podman Testing\n\n[![License](https://img.shields.io/badge/License-GPL-blue.svg)](LICENSE)\n\nThis template provides a foundation for creating Ansible roles specifically designed for Red Hat Enterprise Linux (RHEL) 9.5 environments. It includes the basic structure and testing capabilities using Molecule with Podman as the container engine.\n\n## Table of Contents\n- [Documentation](#documentation)\n- [Architecture Overview](#architecture-overview)\n- [Requirements](#requirements)\n- [Getting Started](#getting-started)\n- [Role Variables](#role-variables)\n- [Dependencies](#dependencies)\n- [Example Playbook](#example-playbook)\n- [Testing](#testing)\n- [Troubleshooting](#troubleshooting)\n- [Contributing](#contributing)\n- [License](#license)\n- [Author Information](#author-information)\n\n## Documentation\n\nComprehensive documentation is available in the [docs](docs/) directory:\n\n- [Overview](docs/overview.md) - Project architecture and design\n- [Usage](docs/usage.md) - Installation and usage instructions\n- [Testing](docs/testing.md) - Detailed testing procedures\n- [Troubleshooting](docs/troubleshooting.md) - Common issues and solutions\n- [Contributing](docs/contributing.md) - Contribution guidelines\n- [API Reference](docs/api.md) - Role parameters and interfaces\n- [Changelog](docs/changelog.md) - Version history and release notes\n\n## Architecture Overview\n\nThis role provides comprehensive management of libvirt virtualization on RHEL systems. Key features include:\n\n- Virtual machine lifecycle management\n- Network configuration for libvirt\n- Storage pool management\n- User access control\n- Resource allocation management\n\nThe template follows standard Ansible role structure with additional Molecule testing configuration:\n\n```\nmolecule-podman-template/\n├── defaults/          # Default variables\n│   └── main.yml\n├── tasks/             # Main role tasks\n│   └── main.yml\n├── meta/              # Role metadata\n│   └── main.yml\n├── molecule/          # Molecule testing configuration\n│   └── default/\n│       ├── molecule.yml  # Test environment config\n│       ├── converge.yml  # Test playbook\n│       ├── verify.yml    # Test cases\n│       ├── prepare.yml   # Test environment setup\n│       └── Dockerfile    # Test container image\n└── tests/             # Integration tests\n    └── test.yml\n```\n\nThe testing infrastructure uses:\n- Podman as the container engine\n- UBI 9 (Universal Base Image) as the base container\n- Molecule for test orchestration\n- Ansible for role execution and verification\n\n## Requirements\n\n* Ansible 2.9 or higher\n* Python 3.9 or higher\n* Access to a RHEL 9.5 target system\n* Molecule\n* Podman (preferred container engine for RHEL)\n* UBI 9 container images access\n\n## Converting the Template\n\n1. Create your new role from this template:\n   ```bash\n   cp -r molecule-podman-template your-role-name\n   cd your-role-name\n   ```\n\n2. Update the role metadata in `meta/main.yml`:\n   * Set the proper role name\n   * Update platform information to include RHEL 9.5\n   * Add relevant tags and dependencies\n\n3. The molecule configuration in `molecule/default/molecule.yml` is already set up for RHEL 9.5 with Podman:\n   * Uses `registry.access.redhat.com/ubi9/ubi-init:latest`\n   * Configured with proper systemd support\n   * Includes necessary volume mounts and capabilities\n\n4. Implement your role logic:\n   * Add tasks in `tasks/main.yml`\n   * Define variables in `defaults/main.yml`\n   * Create handlers in `handlers/main.yml` if needed\n   * Add templates in `templates/` if needed\n\n5. Update testing:\n   * Modify `molecule/default/converge.yml` with your role\n   * Add tests to `molecule/default/verify.yml`\n\n## Role Variables\n\nDefine your variables in `defaults/main.yml`. Document each variable here:\n\n### Quick Reference Table\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| libvirt_networks | List of virtual networks to configure | [] |\n| libvirt_storage_pools | Storage pools configuration | [] |\n| libvirt_vms | Virtual machines to manage | [] |\n| libvirt_users | Users and permissions | [] |\n| libvirt_tls | TLS configuration | false |\n\n### Example Configuration\n\n```yaml\nlibvirt_networks:\n  - name: internal\n    bridge: virbr1\n    ip: 192.168.100.1\n    netmask: 255.255.255.0\n    dhcp:\n      start: 192.168.100.100\n      end: 192.168.100.200\n\nlibvirt_storage_pools:\n  - name: default\n    type: dir\n    target: /var/lib/libvirt/images\n\nlibvirt_vms:\n  - name: test-vm\n    memory: 2048\n    vcpu: 2\n    disks:\n      - size: 20G\n        pool: default\n    networks:\n      - network: internal\n\n### Common Variables\n\n```yaml\n# Target RHEL version\nrhel_version: \"9.5\"\n\n# System package configuration\nsystem_packages:\n  - vim-enhanced\n  - git\n  - curl\n\n# Service configuration\nservices:\n  - name: sshd\n    state: started\n    enabled: true\n\n# Firewall configuration\nfirewall:\n  ports:\n    - 22\n    - 80\n    - 443\n  services:\n    - ssh\n    - http\n    - https\n\n# User management\nusers:\n  - name: admin\n    groups: wheel\n    ssh_key: \"ssh-rsa AAAAB3NzaC1yc2E...\"\n```\n\n### Variable Usage Examples\n\n1. Override default packages:\n```yaml\nsystem_packages:\n  - vim-enhanced\n  - git\n  - curl\n  - htop\n  - tmux\n```\n\n2. Configure additional services:\n```yaml\nservices:\n  - name: sshd\n    state: started\n    enabled: true\n  - name: httpd\n    state: started\n    enabled: true\n```\n\n3. Add firewall rules:\n```yaml\nfirewall:\n  ports:\n    - 22\n    - 80\n    - 443\n    - 8080\n  services:\n    - ssh\n    - http\n    - https\n    - cockpit\n```\n\n### Best Practices\n\n- Use descriptive variable names\n- Group related variables together\n- Provide default values that work for most cases\n- Document each variable with comments in defaults/main.yml\n- Use YAML anchors and aliases for repeated structures\n\n## Dependencies\n\nList any role dependencies here. For example:\n\n```yaml\ndependencies: []\n```\n\n## Example Playbook\n\nHere's how to use this role in your playbook:\n\n```yaml\n- hosts: rhel_servers\n  become: true\n  roles:\n    - role: your-role-name\n      vars:\n        rhel_version: \"9.5\"\n```\n\n## Testing\n\nThis template uses Molecule with Podman for testing. The configuration is already set up for RHEL 9.5 compatibility. For detailed testing procedures and examples, see the [Testing Documentation](docs/testing.md).\n\n### Libvirt-Specific Testing Considerations\n\nWhen testing libvirt functionality, additional configurations may be required:\n\n1. Enable nested virtualization in your test environment\n2. Configure proper SELinux contexts for libvirt\n3. Set up required kernel modules\n4. Configure proper user permissions\n\nExample test configuration:\n\n```yaml\nscenario:\n  test_sequence:\n    - destroy\n    - create\n    - prepare\n    - converge\n    - verify\n    - destroy\n\nplatforms:\n  - name: libvirt-test\n    image: registry.access.redhat.com/ubi9/ubi-init:latest\n    privileged: true\n    volumes:\n      - /sys/fs/cgroup:/sys/fs/cgroup:ro\n    capabilities:\n      - SYS_ADMIN\n    tmpfs:\n      - /run\n      - /tmp\n    command: /sbin/init\n\n### Key Testing Features\n- Podman-based test environments\n- UBI 9 container images\n- Systemd support in containers\n- Comprehensive test verification\n\n### Quick Start\n```bash\n# Run complete test sequence\nmolecule test\n```\n\nFor more commands and detailed testing workflow, refer to the [Testing Documentation](docs/testing.md).\n\n## Security Considerations\n\nWhen using libvirt, consider the following security best practices:\n\n- Use TLS for remote connections\n- Implement proper SELinux policies\n- Restrict user permissions using polkit\n- Regularly update libvirt packages\n- Monitor virtual machine activity\n- Use secure storage backends\n\n## Troubleshooting\n\nFor common issues and solutions, refer to the [Troubleshooting Documentation](docs/troubleshooting.md). This includes:\n\n- Podman installation and configuration\n- UBI image access\n- SELinux context issues\n- Systemd in containers\n- Network configuration\n- Molecule debugging\n\n### Quick Diagnostics\n```bash\n# Check container status\npodman ps -a\n\n# View container logs\npodman logs \u003ccontainer\u003e\n\n# Inspect container configuration\npodman inspect \u003ccontainer\u003e\n```\n\n## Contributing\n\nWe welcome contributions! Please read our [Contribution Guidelines](docs/contributing.md) for details on how to:\n\n- Submit issues\n- Create pull requests\n- Follow coding standards\n- Write documentation\n\n## License\n\nGNU General Public License v3.0\n\n## Author Information\n\nTosin Akinosho\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftosin2013%2Fmolecule-podman-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftosin2013%2Fmolecule-podman-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftosin2013%2Fmolecule-podman-template/lists"}