Class: VagrantPlugins::Cloudcenter::Command::Init

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-cloudcenter/command/init.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.synopsisObject



5
6
7
# File 'lib/vagrant-cloudcenter/command/init.rb', line 5

def self.synopsis
  "Create inital Vagrant file"
end

Instance Method Details

#createInitFileObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/vagrant-cloudcenter/command/init.rb', line 12

def createInitFile()

	script = File.open("Vagrantfile", "w")
	
	script.puts "# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|

	config.vm.box = 'cloudcenter'

config.ssh.private_key_path = ['/Users/MYUSERNAME/.ssh/id_rsa','/Users/MYUSERNAME/.vagrant.d/insecure_private_key']
	config.ssh.insert_key = false

	config.vm.provider :cloudcenter do |cloudcenter|

cloudcenter.username = 'my_username'
cloudcenter.access_key = 'my_access_key'

cloudcenter.host = 'cloudcenter_host_address'
cloudcenter.deployment_config = 'sample_deployment_config.json'

cloudcenter.use_https = true
cloudcenter.ssl_ca_file = '/path/to/ca_file'

	end

	config.vm.synced_folder '.', '/opt/my_files/', type: 'rsync'

end"
	script.close   

end

#executeObject



48
49
50
51
52
# File 'lib/vagrant-cloudcenter/command/init.rb', line 48

def execute
  
			createInitFile()
			
end