Giter VIP home page Giter VIP logo

ansible-gen's Introduction

Go Report Card codebeat badge

ansible-gen

A simple tool to scaffold Ansible projects according to the best practices described in the Ansible documentation.

Important!

If you use it, wherther you like it or not, please drop me a line in Twitter (@eljuanchosf) so I know that this thing is being useful. :)

Installation

Download release

You can download the latest release from here.

From source

If you want to compile from source, you have to have Golang installed. I used version 1.7.3 for development. Didn't try any other version.

I highly recomment gvm to manage your Go versions.

  1. Install Godep - Usually with go get github.com/tools/godep
  2. Run $ godep restore to install dependencies to your GOPATH
  3. Build ansible-gen using the included run.sh script:
$ ./run.sh build

TODO: Soon, compiled versions to download.

Usage

Global commands and options

USAGE:
   ansible-gen [global options] command [command options] [arguments...]

COMMANDS:
     project, p  Creates a new Ansible project
     role, r     Creates a new Ansible role
     help, h     Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --dry-run, -d  just print results, do not modify the filesystem
   --help, -h     show help
   --version, -v  print the version

New projects

NAME:
   ansible-gen project - Creates a new Ansible project

USAGE:
   ansible-gen project [command options] [arguments...]

OPTIONS:
   -c value    A comma separated list of the custom roles for the project
   -g value    A comma separated list of the Ansible Galaxy roles for the project
   --skip-git  Do not initialize a Git repository for the project

Galaxy roles

When you specify a list of Galaxy roles, a galaxy-roles.yml will be created with the appropriate format to install the roles with:

$ ansible-galaxy install -r galaxy-roles.yml

Example

$ ansible-gen p my-project -c backend-server,my-custom-role -g geerlingguy.redis,nickhammond.logrotate 

New roles

NAME:
   ansible-gen role - Creates a new Ansible role

USAGE:
   ansible-gen role [arguments...]

Example

$ ansible-gen r my-role 

Rationale

The idea was to experiment with some Golang features while developing something useful. The code can be better, I know, but this is learning project. All suggestion are welcome!

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

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.