Class: Kitchen::Provisioner::YansiblePusher

Inherits:
Base
  • Object
show all
Defined in:
lib/kitchen/provisioner/yansible_pusher.rb

Overview

YansiblePusher is a Kitchen provisioner plugin for Ansible. It allows you to use Ansible playbooks to provision test instances in Test Kitchen.

Examples:

Using YansiblePusher in your kitchen.yml

provisioner:
  name: yansible_pusher
  playbook: playbooks/playbook.yml
  env_vars:
    MARIO: "MUSHROOM_KINGDOM"
    LINK: "HYRULE_KINGDOM"

See Also:

Author:

  • <MY_NAME>

Version:

  • 0.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#sandbox_pathObject (readonly)

Returns the value of attribute sandbox_path.



43
44
45
# File 'lib/kitchen/provisioner/yansible_pusher.rb', line 43

def sandbox_path
  @sandbox_path
end

Instance Method Details

#init_commandObject



50
51
52
53
# File 'lib/kitchen/provisioner/yansible_pusher.rb', line 50

def init_command
  # No initialization command needed on the remote instance
  nil
end

#install_commandObject



45
46
47
48
# File 'lib/kitchen/provisioner/yansible_pusher.rb', line 45

def install_command
  # No initialization command needed on the remote instance
  nil
end

#prepare_commandObject



55
56
57
58
# File 'lib/kitchen/provisioner/yansible_pusher.rb', line 55

def prepare_command
  # No preparation command needed on the remote instance
  nil
end

#run_commandObject



60
61
62
63
64
65
66
67
68
# File 'lib/kitchen/provisioner/yansible_pusher.rb', line 60

def run_command
  begin
    create_sandbox
    run_ansible
  ensure
    cleanup_sandbox
  end
  ensure_windows_exit_code if windows_instance?
end