Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pgeraghty committed Sep 26, 2019
1 parent b91d0cc commit c739633
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 5 additions & 2 deletions lib/ansible/ad_hoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'json'

module Ansible
# Ansible Ad-Hoc methods
module Methods
# executable that runs Ansible Ad-Hoc commands
BIN = 'ansible'
Expand Down Expand Up @@ -51,10 +52,12 @@ def parse_host_vars(host, inv, filter = 'hostvars[inventory_hostname]')

# Provides static access to Ad-Hoc methods
module AdHoc
include Ansible::Config
include Ansible::Methods
include Config
include Methods

extend self

# @see Methods#one_off
alias :run :one_off
end
end
9 changes: 5 additions & 4 deletions lib/ansible/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Config
SKIP_HOSTVARS = %w(ansible_version inventory_dir inventory_file inventory_hostname inventory_hostname_short group_names groups omit playbook_dir)
VERSION = `ansible --version`.split("\n").first.split.last rescue nil # nil when Ansible not installed

# Default configuration options
DefaultConfig = Struct.new(:env, :extra_vars, :params) do
# @!attribute env
# @return [Hash] environment variables
Expand All @@ -20,16 +21,16 @@ def initialize
'ANSIBLE_HOST_KEY_CHECKING' => 'False'
}

@params = {
debug: false
}

@extra_vars = {
# skip creation of .retry files
'retry_files_enabled' => 'False'
}
# TODO support --ssh-common-args, --ssh-extra-args
# e.g. ansible-playbook --ssh-common-args="-o ServerAliveInterval=60" -i inventory install.yml

@params = {
debug: false
}
end

# Pass additional options to Ansible
Expand Down
1 change: 1 addition & 0 deletions lib/ansible/playbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'ansible/safe_pty'

module Ansible
# Ansible Playbook methods
module PlaybookMethods
# executable that runs Ansible Playbooks
BIN = 'ansible-playbook'
Expand Down

0 comments on commit c739633

Please sign in to comment.