Coder Social home page Coder Social logo

ansiblew's Introduction

ansible-wrapper

A simple ansible wrapper inspired by gradle-wrapper and maven-wrapper.

After installing ansible-wrapper, you can then replace a call to ansible-playbook with a call to ./ansiblew. E.g. to execute a playbook called web.yaml, you just run ./ansiblew web.yaml.

Install

Place a copy of the ansiblew script and the ansiblew.json configuration file into a directory. You can simplify the installation by running:

curl -sf https://raw.githubusercontent.com/flachnetz/ansiblew/master/get.sh | sh

Configuration

Edit ansiblew.json to configure the ansible version you want to use. You can also specify a list of extra python packages to install. This might be useful, if your ansible playbook includes modules depending on third-party modules.

{
  "ansible_version": "2.2.0.0-1",
  "requirements": ["requests==2.12.4"]
}

Update

You can update the wrapper by passing update as the only parameter: ./ansiblew update

Environment variables

Verbose logging can be enabled by setting the environment variable ANSIBLEW_VERBOSE to true. If you need to execute another ansible process, you can pass its name as ANSIBLEW_COMMAND, which defaults to ansible-playbook.

For example, to execute an ad-hoc command with ansible directly, run

ANSIBLEW_COMMAND=ansible ./ansiblew -m shell -a 'df -h /'

To create an encrypted ansible-vault file, run

ANSIBLEW_COMMAND=ansible-vault ./ansiblew create secrets.vault

If you want to provide a different ansiblew config file you can do it by setting the environment variable ANSIBLEW_CONFIG_FILE.

ansiblew's People

Contributors

oliverbestmann avatar matlockx 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.