vagrant-terraform 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b91e84fbdc3a525218339936061f9350f02db124777bb7b07d1ac17229e02c6c
|
4
|
+
data.tar.gz: ae303b93001724e9696a22de69eca6f4d1822dc1063763a8d40aeaa1f9c73878
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c26f1555ad6de110ddac0b844eb50d34ce1dde3f93b8918ccf33ab4cd0848f4d54ff373ca973cbb2ae29bddb5e2f0481f00085beaacb9c3b690fb7989b05ad62
|
7
|
+
data.tar.gz: 6e381a75c334749f0d8f1368a4f781a17b2f125d528544a30a0406fbca0104546bf2bfe2784ca75d2eacd07380f823fd29d6dc00984819addd7bba2901583ee3
|
@@ -80,6 +80,7 @@ resource "proxmox_vm_qemu" "#{vmname.gsub(/\./, '-')}" {
|
|
80
80
|
}
|
81
81
|
}
|
82
82
|
}
|
83
|
+
%SERIAL%
|
83
84
|
nameserver = "#{config.nameserver}"
|
84
85
|
searchdomain = "#{config.searchdomain}"
|
85
86
|
%NETWORKS%
|
@@ -116,6 +117,18 @@ terraform {
|
|
116
117
|
ipconfig%IDX% = "%IP%"
|
117
118
|
END
|
118
119
|
|
120
|
+
serial_template = <<-END
|
121
|
+
serial {
|
122
|
+
id = 0
|
123
|
+
type = "socket"
|
124
|
+
}
|
125
|
+
END
|
126
|
+
if config.serial_port
|
127
|
+
main_tf = main_tf.gsub(/%SERIAL%/, serial_template)
|
128
|
+
else
|
129
|
+
main_tf = main_tf.gsub(/%SERIAL%/, '')
|
130
|
+
end
|
131
|
+
|
119
132
|
vagrantfile_networks = []
|
120
133
|
env[:machine].id = vmname
|
121
134
|
env[:machine].config.vm.networks.each_with_index do |network, idx|
|
@@ -150,8 +163,8 @@ END
|
|
150
163
|
env[:ui].info(" -- Target node: #{config.target_node}")
|
151
164
|
env[:ui].info(" -- Storage domain: #{config.storage_domain}")
|
152
165
|
env[:ui].info(" -- CPU Cores: #{config.cpu_cores}")
|
153
|
-
env[:ui].info(" -- Memory: #{Filesize.from("#{config.memory_size} B").to_f('
|
154
|
-
env[:ui].info(" -- Disk: #{Filesize.from("#{config.disk_size} B").to_f('
|
166
|
+
env[:ui].info(" -- Memory: #{Filesize.from("#{config.memory_size} B").to_f('MB').to_i} MB")
|
167
|
+
env[:ui].info(" -- Disk: #{Filesize.from("#{config.disk_size} B").to_f('GB').to_i} GB") unless config.disk_size.nil?
|
155
168
|
|
156
169
|
terraform_dir = env[:machine_tf_dir]
|
157
170
|
terraform_main_file = "#{terraform_dir}/main.tf"
|
@@ -171,6 +184,18 @@ END
|
|
171
184
|
raise e
|
172
185
|
end
|
173
186
|
|
187
|
+
# Terraform error message was 'clone failed: cfs-lock 'storage-qnap-nfs' error: got lock request timeout'
|
188
|
+
if e.message.gsub(ansi_escape_regex, '').include?("clone failed: cfs-lock")
|
189
|
+
env[:ui].info("Proxmox unable to get storage lock, retrying")
|
190
|
+
raise e
|
191
|
+
end
|
192
|
+
|
193
|
+
# Terraform error message was 'clone failed: 'storage-qnap-nfs'-locked command timed out - aborting'
|
194
|
+
if e.message.gsub(ansi_escape_regex, '').include?("command timed out")
|
195
|
+
env[:ui].info("Proxmox clone template, retrying")
|
196
|
+
raise e
|
197
|
+
end
|
198
|
+
|
174
199
|
if e.message.gsub(ansi_escape_regex, '') =~ /.*Error: [0-9 ]*unable to create VM [0-9]*: config file already exists/
|
175
200
|
env[:ui].info("Proxmox ID conflict, retrying")
|
176
201
|
raise e
|
@@ -35,6 +35,12 @@ module VagrantPlugins
|
|
35
35
|
return false
|
36
36
|
rescue Net::SSH::AuthenticationFailed
|
37
37
|
return true
|
38
|
+
rescue Errno::ECONNRESET
|
39
|
+
@logger.debug("Got connection reset")
|
40
|
+
return false
|
41
|
+
rescue StandardError => e
|
42
|
+
@logger.debug("Got error #{e.message}")
|
43
|
+
return false
|
38
44
|
end
|
39
45
|
return false
|
40
46
|
end
|
@@ -46,7 +52,7 @@ module VagrantPlugins
|
|
46
52
|
# Wait for VM to obtain an ip address.
|
47
53
|
env[:metrics]["instance_ip_time"] = Util::Timer.time do
|
48
54
|
env[:ui].info(I18n.t("vagrant_terraform.waiting_for_ip"))
|
49
|
-
for attempt in 1..
|
55
|
+
for attempt in 1..100
|
50
56
|
# If we're interrupted don't worry about waiting
|
51
57
|
next if env[:interrupted]
|
52
58
|
|
@@ -25,6 +25,7 @@ module VagrantPlugins
|
|
25
25
|
attr_accessor :searchdomain
|
26
26
|
attr_accessor :os_type
|
27
27
|
attr_accessor :full_clone
|
28
|
+
attr_accessor :serial_port
|
28
29
|
|
29
30
|
def initialize
|
30
31
|
@api_url = UNSET_VALUE
|
@@ -46,6 +47,7 @@ module VagrantPlugins
|
|
46
47
|
@searchdomain = UNSET_VALUE
|
47
48
|
@os_type = UNSET_VALUE
|
48
49
|
@full_clone = UNSET_VALUE
|
50
|
+
@serial_port = UNSET_VALUE
|
49
51
|
end
|
50
52
|
|
51
53
|
def finalize!
|
@@ -68,6 +70,7 @@ module VagrantPlugins
|
|
68
70
|
@searchdomain = '' if @searchdomain == UNSET_VALUE
|
69
71
|
@os_type = 'l26' if @os_type == UNSET_VALUE
|
70
72
|
@full_clone = true if @full_clone == UNSET_VALUE
|
73
|
+
@serial_port = false if @serial_port == UNSET_VALUE
|
71
74
|
|
72
75
|
unless disk_size.nil?
|
73
76
|
begin
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-terraform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mika Båtsman
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: filesize
|
@@ -69,7 +69,7 @@ homepage: https://github.com/mika-b/vagrant-terraform
|
|
69
69
|
licenses:
|
70
70
|
- MIT
|
71
71
|
metadata: {}
|
72
|
-
post_install_message:
|
72
|
+
post_install_message:
|
73
73
|
rdoc_options: []
|
74
74
|
require_paths:
|
75
75
|
- lib
|
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
87
|
rubygems_version: 3.5.22
|
88
|
-
signing_key:
|
88
|
+
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: This vagrant plugin provides the ability to create, control, and destroy
|
91
91
|
virtual machines under proxmox
|