Class: Kitchen::Driver::Wpar

Inherits:
Base
  • Object
show all
Defined in:
lib/kitchen/driver/wpar.rb

Overview

Wpar driver for Kitchen.

noinspection RubyDefParenthesesInspection,SpellCheckingInspection

Author:

Instance Method Summary collapse

Instance Method Details

#create(state) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/kitchen/driver/wpar.rb', line 56

def create(state)
  if wpar_exists?(state)
    raise ActionFailed, 'wpar already exists !'
  end

  cmd = build_mkwpar_command()
  ssh_command(cmd, :stderr)

  unless wpar_exists?(state)
    raise ActionFailed, 'Cannot create wpar !'
  end
  state[:hostname]= config[:wpar_address] || config[:wpar_name]
  copy_key()

  # Ensure sshd is a defined service and is running so that
  # kitchen can connect to the host and do work.
  unless sshd_service_exists?
    create_sshd_service
  end

  unless sshd_service_running?
    start_sshd_service
  end

  unless pam_supports_sshd?
    configure_pam
  end
end