ansible-gen

command module
v0.0.0-...-8dd5ed4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2017 License: MIT Imports: 5 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL