Skip to content

Ansible role skeleton template to generate role project repository with Cookiecutter

License

Notifications You must be signed in to change notification settings

f-bn/ansible-role-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

General informations

Ansible role skeleton template to generate role project repository with Cookiecutter.

Requirements

  • Ansible >= 9.x
  • Cookiecutter

References

How to bootstrap a new role project using Cookiecutter ?

First, you need to install Cookiecutter in your environment:

# Using pip package manager
$ pip3 install cookiecutter [options]
# Using brew (on MacOS)
$ brew install cookiecutter

Create an empty repository on your favorite Git platform, i.e with GitHub using the CLI:

$ gh repo create ansible-role-myrole [options]

Bootstrap a new project using Cookiecutter with the remote GitHub repository. You will be prompted to define the role name and other metadata:

$ cookiecutter gh:f-bn/ansible-role-template
  [1/6] Role name (): myrole
  [2/6] Short role description (): Ansible role to setup and configure...
  [3/6] Author name (f-bn): <enter>
  [4/6] Source code license (SPDX format)
    1 - MIT
    2 - BSD-3-Clause
    Choose from [1/2] (1): <enter>
  [5/6] Min. Ansible compatible version (9.0.0): <enter>
  [6/6] Issue tracker URL (https://github.com/f-bn/ansible-role-myrole/issues):

Finally, intialize a Git repository in the newly created folder by Cookiecutter and push the initial changes your repository:

$ cd myrole/
$ git init
$ git remote add origin git@github.com:f-bn/ansible-role-myrole.git
$ git push -u origin main

About

Ansible role skeleton template to generate role project repository with Cookiecutter

Topics

Resources

License

Stars

Watchers

Forks

Languages