Skip to content

netops2devops/cookiecutter-ansible-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

About

A slightly opinionated cookiecutter template that creates a barebones Ansible project with static inventory mostly for my own personal use. The template creates a virtual environment (venv) and installs the following inside it

  • ansible
  • molecule for ansible role testing
  • molecule-docker run molecule tests inside a container
  • ansible-lint
  • flake8

Requirements

Usage

Create a new ansible project by running

cookiecutter https://github.com/netops2devops/cookiecutter-ansible-project.git

❯ cookiecutter cookiecutter-ansible-project
  [1/9] project_name (new-ansible-project):
  [2/9] project_short_description (My exciting new Ansible project):
  [3/9] full_name (Kapil Agrawal):
  [4/9] email ([email protected]):
  [5/9] vcs_username (netops2devops):
  [6/9] version (0.0.1):
  [7/9] ansible_version (latest):
  [8/9] setup_pre_commit_hooks [y/n] (y):
  [9/9] initialize_git [y/n] (y):

Barebones Ansible project gets created as shown below

❯ tree
.
β”œβ”€β”€ README.md
β”œβ”€β”€ ansible.cfg
β”œβ”€β”€ inventory
β”‚Β Β  β”œβ”€β”€ group_vars
β”‚Β Β  β”‚Β Β  └── all.yml
β”‚Β Β  β”œβ”€β”€ host_vars
β”‚Β Β  β”‚Β Β  └── dummy.yml
β”‚Β Β  └── hosts.ini
β”œβ”€β”€ playbooks
β”‚Β Β  └── playbook.yml
β”œβ”€β”€ poetry.lock
└── pyproject.toml

5 directories, 8 files

To create a new Ansible role

# source .venv/bin/activate 
.venv ❯ ansible-galaxy role init roles/new_role

Author

netops2devops (Kapil Agrawal)

About

A Cookiecutter template for bare-bones Ansible project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages