Code Monkey home page Code Monkey logo

ansible_playbook_template's Introduction

ansible_playbook_template

An Ansible playbook template written in Jinja2 to quickly generate an Ansible playbook. The Ansible playbook can then be used within the Ansible Automation Platform or on the CLI.

ansible-galaxy is used to interact wtih the Jinja2 templates and generate the playbook and an inventory file.
A Makefile is used to further automate this process by simplifing the task, saving time, and avoiding errors.

Dependencies:

  • GNU make needs to be installed within the environment.
  • Two variables need to be defined on the CLI: repo_name, name
    • repo_name is the location of the newly created project repo. name is the name of the project.

Usage:

All playbook repos will have a play_ prefix. Please use underscores for name separation.

Generate a new play repo for an Apache install:

$ make repo_path=/root/Repos1 name=apache_install run

  • This will create a new play repo at /root/Repos1 with the name play_apache_install.

Remove same play repo, Apache install, in case of an error, etc.

$ make repo_path=/root/Repos1 name=apache_install clean

  • This will remove the created repository in its entirety. Be diligent.

Help:

$ make --help
$ ansible-galaxy init --help

ansible_playbook_template's People

Contributors

lafayettedevops avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.