Module: Ansible::Config
Defined Under Namespace
Classes: DefaultConfig
Constant Summary collapse
- PATH =
'lib/ansible/'- SKIP_HOSTVARS =
IP_OR_HOSTNAME = /((25|2[0-9]|?[0-9]?)(.(25|2[0-9]|?[0-9]?))3)$|^((([a-zA-Z0-9]|[a-zA-Z0-9-]*).)*([A-Za-z0-9]|[A-Za-z0-9-]*))n/
%w(ansible_version inventory_dir inventory_file inventory_hostname inventory_hostname_short group_names groups omit playbook_dir)- VERSION =
nil when Ansible not installed
`ansible --version`.split("\n").first.split.last rescue nil
Instance Method Summary collapse
Instance Method Details
#config ⇒ Object
51 52 53 |
# File 'lib/ansible/config.rb', line 51 def config @config || configure end |
#configure {|@config| ... } ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/ansible/config.rb', line 43 def configure @config ||= DefaultConfig.new yield(@config) if block_given? # allow chaining if block given block_given? ? self : @config end |