Class: Provisioner::Provisioner
- Inherits:
-
Object
- Object
- Provisioner::Provisioner
- Defined in:
- lib/provisioner/provisioner.rb
Direct Known Subclasses
Constant Summary collapse
- AVAILABLE_ACTIONS =
['create', 'delete']
Instance Method Summary collapse
- #delete_vapp ⇒ Object
- #execute(action) ⇒ Object
-
#initialize(options) ⇒ Provisioner
constructor
A new instance of Provisioner.
- #ssh ⇒ Object
- #ssh_to(hostname, &blk) ⇒ Object
Constructor Details
#initialize(options) ⇒ Provisioner
Returns a new instance of Provisioner.
8 9 10 11 |
# File 'lib/provisioner/provisioner.rb', line 8 def initialize [:created_by] = ENV['USER'] self. = end |
Instance Method Details
#delete_vapp ⇒ Object
132 133 |
# File 'lib/provisioner/provisioner.rb', line 132 def delete_vapp end |
#execute(action) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/provisioner/provisioner.rb', line 13 def execute(action) unless AVAILABLE_ACTIONS.include?(action) raise(ConfigurationError, "The action '#{action}' is not a valid action") end send(action) end |
#ssh ⇒ Object
66 67 68 69 70 71 72 |
# File 'lib/provisioner/provisioner.rb', line 66 def ssh @ssh ||= begin Provisioner.ssh_client.tap { |client| logger.debug "Using #{client} as my SSH client" } end end |
#ssh_to(hostname, &blk) ⇒ Object
74 75 76 77 78 79 80 |
# File 'lib/provisioner/provisioner.rb', line 74 def ssh_to hostname, &blk puts "Sshing to #{hostname}" ssh.start hostname, [:ssh_user], :config => [:ssh_config], &blk end |