Skip to content

Ansible template repository with CI, linting, containerization, and more...

Notifications You must be signed in to change notification settings

TheDevOpsHub/ansible-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Template Repository

This repository serves as a template for Ansible projects, including features for CI, linting, and containerization.

Structure

  • .github/workflows/: CI workflows for GitHub Actions
  • group_vars/: Group variables
  • host_vars/: Host variables
  • roles/: Ansible roles
  • inventories/: Inventory files
  • Dockerfile: Dockerfile for containerizing Ansible
  • playbooks/: Ansible playbooks
  • tests/: Test playbooks
  • ansible.cfg: Ansible configuration
  • requirements.yml: Ansible Galaxy requirements

Getting Started

  1. Clone the repository:

    git clone https://github.com/TheDevOpsHub/ansible-template.git
    cd ansible-template
  2. Build Docker image:

    docker build -t ansible-playbook -f Dockerfile .
  3. Run Ansible Playbook:

    docker run --rm ansible-playbook playbooks/example_playbook.yaml

Continuous Integration

GitHub Actions are configured to lint and test your Ansible playbooks on each push or pull request.

Linting

Ansible Lint is used to ensure best practices in your Ansible playbooks. The linting is automatically run in the CI pipeline.

Containerization

A Dockerfile is included to containerize Ansible, ensuring consistency across environments.

Run a specific playbook

ansible-playbook playbooks/example_playbook.yml --tags example_tag

ansible-playbook playbooks/example_system_checks_role.yaml --tags system_checks_tag

About

Ansible template repository with CI, linting, containerization, and more...

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published