class Kitchen::Provisioner::Ansible::Config

Ansible Playbook provisioner.

Attributes

instance[RW]

Public Class Methods

new(config = {}) click to toggle source
# File lib/kitchen/provisioner/ansible/config.rb, line 165
def initialize(config = {})
  init_config(config)
end

Public Instance Methods

[](attr) click to toggle source
# File lib/kitchen/provisioner/ansible/config.rb, line 173
def [](attr)
  config[attr]
end
[]=(attr, val) click to toggle source
# File lib/kitchen/provisioner/ansible/config.rb, line 169
def []=(attr, val)
  config[attr] = val
end
calculate_path(path, type = :directory) click to toggle source
# File lib/kitchen/provisioner/ansible/config.rb, line 185
def calculate_path(path, type = :directory)
  unless instance
    fail 'Please ensure that an instance is provided before calling calculate_path'
  end

  base = config[:test_base_path]
  candidates = []
  candidates << File.join(base, instance.suite.name, 'ansible', path)
  candidates << File.join(base, instance.suite.name, path)
  candidates << File.join(base, path)
  candidates << File.join(Dir.pwd, path)
  candidates << File.join(Dir.pwd) if path == 'roles'

  candidates.find do |c|
    type == :directory ? File.directory?(c) : File.file?(c)
  end
end
key?(k) click to toggle source
# File lib/kitchen/provisioner/ansible/config.rb, line 177
def key?(k)
  config.key?(k)
end
keys() click to toggle source
# File lib/kitchen/provisioner/ansible/config.rb, line 181
def keys
  config.keys
end