Module: Orchestration::SSHProvision

Included in:
Host::Managed
Defined in:
app/models/orchestration/ssh_provision.rb

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object


2
3
4
5
6
7
8
# File 'app/models/orchestration/ssh_provision.rb', line 2

def self.included(base)
  base.send :include, InstanceMethods
  base.class_eval do
    after_validation :validate_ssh_provisioning, :queue_ssh_provision
    attr_accessor :template_file, :client
  end
end

Instance Method Details

#delSSHProvisionObject


100
# File 'app/models/orchestration/ssh_provision.rb', line 100

def delSSHProvision; end

#validate_ssh_provisioningObject


102
103
104
105
106
107
108
109
110
111
112
113
# File 'app/models/orchestration/ssh_provision.rb', line 102

def validate_ssh_provisioning
  return unless ssh_provision?
  return if Rails.env == "test"
  status = true
  begin
    template = configTemplate(:kind => "finish")
  rescue => e
    status = false
  end
  status = false if template.nil?
  failure(_("No finish templates were found for this host, make sure you define at least one in your %s settings") % os ) unless status
end