Giter Site home page Giter Site logo

zsh-ansible's Introduction

Ansible add-ons for Zsh

The ans command is a simple wrapper around ansible to accomplish two things:

  1. Make it simpler to copy/paste between the YAML in playbooks and CLI

  2. Enable Zsh completion through simpler syntax (-m module -a 'arg1=val1 arg2=val2' is not very amenable to CLI completion)

Contains

  • ans -- simplified ansible command that's friendly for Zsh completion
  • _ans -- completion for the ansible command
  • ansible-skeleton -- for role creation (simpler than ansible-galaxy but not yet robust)

Installation

Set fpath in ~/.zshrc:

fpath+=/path/to/zsh-ansible

Usage

Lots of completions:

% ans «tab»
--- hosts group
appsvrs    dbsvrs     failovers

% ans appsvrs g«tab»
--- ansible module
gem:      -- Manage Ruby gems
get_url:  -- Downloads files from HTTP, HTTPS, or FTP to node
getent:   -- a wrapper to the unix getent utility
git:      -- Deploy software (or files) from git checkouts
group:    -- Add or remove groups

% ans appsvrs gem: «tab»
--- module arguments
executable=            -- Override the path to the gem executable
gem_source=            -- The path to a local gem used as installation ...
include_dependencies=  -- Whether to include dependencies or not.
name=                  -- [#REQUIRED#] The name of the gem to be managed.
pre_release=           -- Allow installation of pre-release versions ...
repository=            -- The repository from which the gem will be installed
state=                 -- The desired state of the gem. latest ensures ...
user_install=          -- Install gem in users local gems cache or for ...
version=               -- Version of the gem to be installed/removed.

% ans appsvrs gem: name=nokogiri state=installed -«tab»
--- option
-B  -- run asynchronously, failing after X seconds
-C  -- dont make any changes
-K  -- ask for sudo password
-M  -- specify path(s) to module library (default=None)
-P  -- set the poll interval if using -B (default=15)
-R  -- run operations with su as this user (default=root)
-S  -- run operations with su
-T  -- override the SSH timeout in seconds (default=10)
-U  -- desired sudo user (default=root)
-c  -- connection type to use (default=smart)
-f  -- specify number of parallel processes to use (default=5)
-h  -- show this help message and exit
-i  -- specify inventory host file (default=hosts)
-k  -- ask for SSH password
-l  -- further limit selected hosts to an additional pattern
-o  -- condense output
-s  -- run operations with sudo (nopasswd)
-t  -- log output to this directory
-u  -- connect as this user
-v  -- verbose mode (-vvv for more, -vvvv to enable connection debugging)

Example of updating all bases:

% ans failovers yum: 'name=*' state=latest -b -vv

zsh-ansible's People

Watchers

James Cloos 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.