Module: Ansible

Extended by:
Ansible
Includes:
Config, Methods, PlaybookMethods
Included in:
Ansible
Defined in:
lib/ansible-wrapper.rb,
lib/ansible/ad_hoc.rb,
lib/ansible/config.rb,
lib/ansible/output.rb,
lib/ansible/version.rb,
lib/ansible/playbook.rb,
lib/ansible/shortcuts.rb

Overview

A lightweight Ruby wrapper around Ansible that allows for ad-hoc commands and playbook execution. The primary purpose is to support easy streaming output.

Defined Under Namespace

Modules: AdHoc, Config, Methods, Output, Playbook, PlaybookMethods, SafePty

Constant Summary collapse

VERSION =
'0.3.0'

Constants included from PlaybookMethods

PlaybookMethods::BIN

Constants included from Methods

Methods::BIN

Constants included from Config

Config::PATH, Config::SKIP_HOSTVARS

Instance Method Summary collapse

Methods included from PlaybookMethods

#playbook, #stream

Methods included from Methods

#list_hosts, #one_off, #parse_host_vars

Methods included from Config

#config, #configure

Instance Method Details

#<<(cmd) ⇒ Object

shortcut to run a Playbook, streaming the output

Parameters:

  • cmd (String)

    the command-line to pass

See Also:



14
15
16
# File 'lib/ansible/shortcuts.rb', line 14

def <<(cmd)
  Playbook.stream cmd
end

#[](cmd) ⇒ Object

shortcut for executing an Ad-Hoc command

Parameters:

  • cmd (String)

    the command-line to pass

See Also:



7
8
9
# File 'lib/ansible/shortcuts.rb', line 7

def [](cmd)
  AdHoc.run cmd
end

#enable_shortcuts!Object

Enables shortcuts

See Also:

  • Ansible.ansible/shortcutsansible/shortcuts.rb


17
18
19
# File 'lib/ansible-wrapper.rb', line 17

def enable_shortcuts!
  require 'ansible/shortcuts'
end