Class: VagrantPlugins::DelphixEngine::Provisioner

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/vagrant-delphix/provisioner.rb

Instance Method Summary collapse

Methods included from Util

#get_config

Constructor Details

#initialize(machine, config) ⇒ Provisioner

Returns a new instance of Provisioner.



11
12
13
14
15
16
# File 'lib/vagrant-delphix/provisioner.rb', line 11

def initialize(machine, config)
  super(machine, config)
  
  @config = get_config(machine)
  
end

Instance Method Details

#provisionObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/vagrant-delphix/provisioner.rb', line 18

def provision
  
  # set the DE url
  Delphix.url = @config.engine_url
  Delphix.debug = @config.trace

  # authenticate the connection
  Delphix.authenticate!(@config.engine_user,@config.engine_password)
  
  # lookup the environment
  environments = Delphix.environments
  environment = environments.lookup_by_name @config.env_name
   
  if environment == nil
    # ceate a new environment
    environment = Delphix::Environment.create @config.env_name, @config.env_ip, @config.env_port, @config.toolkit_path, @config.user, @config.password
  else
    # enable the environment
    environment.enable
  end
  
end