vagrant-terraform 0.3.3 → 0.4.1

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: 6374a96c7b447abb47a19205790c36eb49389f2b7e46a34ab69c56bdc4558195
4
- data.tar.gz: 7a0420fef4700d63638b185d153141eea6c124ab6404dbfa66c8dc0b4e5fc8f4
3
+ metadata.gz: ac7e77588766896f79c56df92b0f4a80c4c32d0f943ff31c081a522282bf4e22
4
+ data.tar.gz: a438198f169bda35c681dcddc500bee82338027929dfdedc99929541e56ec9b4
5
5
  SHA512:
6
- metadata.gz: a98d66dcc11e74364b003bc61f68b40173b9b8a44c212c2bf4dde1c82d91ea266202c7d08ab305c15327a648c45210f295c26b12f40806c4237fc3857fadaae6
7
- data.tar.gz: 64aa8e29e36a066d28731f0cd6a59875af08ff9d39e49f39a240d18a9b7be32add0d69c56cceaf6d5c7dff4b3ebaa938c1714718dab072951183e706f66bb91b
6
+ metadata.gz: 31c5bd26aae0ba38a0741995f0838d7ce0462ccaa871cec418a5be6f1e13dea28db1336ed452b36aaf8c7e3d2544e64f69daa17d28b76e81b390b93074a4d84f
7
+ data.tar.gz: 0412a3352225bf4d5cb93f83ccd53524d9ad98a61bbceafe0d063174f338229fdccf3951c419954a226d70f63ee466d89661a71034dc059d21977c6c94b64e11
@@ -1,16 +1,15 @@
1
1
  name: Ruby Gem
2
- on:
2
+ on:
3
3
  push:
4
4
  tags:
5
5
  - release/*
6
6
 
7
7
  jobs:
8
8
  build:
9
- name: Build + Publish
9
+ name: Build
10
10
  runs-on: ubuntu-latest
11
11
  permissions:
12
12
  contents: read
13
- packages: write
14
13
 
15
14
  steps:
16
15
  - uses: actions/checkout@v4
@@ -19,14 +18,40 @@ jobs:
19
18
  with:
20
19
  ruby-version: 3.3.6
21
20
 
21
+ - name: Build gem
22
+ run: gem build *.gemspec
23
+
24
+ - name: Upload gem artifact
25
+ uses: actions/upload-artifact@v4
26
+ with:
27
+ name: gem
28
+ path: '*.gem'
29
+ retention-days: 1
30
+
31
+ publish:
32
+ name: Publish
33
+ needs: build
34
+ runs-on: ubuntu-latest
35
+ permissions:
36
+ contents: read
37
+
38
+ steps:
39
+ - name: Download gem artifact
40
+ uses: actions/download-artifact@v4
41
+ with:
42
+ name: gem
43
+
44
+ - name: Set up Ruby 3.3.6
45
+ uses: ruby/setup-ruby@v1
46
+ with:
47
+ ruby-version: 3.3.6
48
+
22
49
  - name: Publish to RubyGems
23
50
  run: |
24
51
  mkdir -p $HOME/.gem
25
52
  touch $HOME/.gem/credentials
26
53
  chmod 0600 $HOME/.gem/credentials
27
54
  printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
28
- gem build *.gemspec
29
55
  gem push *.gem
30
56
  env:
31
57
  GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
32
-
data/README.md CHANGED
@@ -114,6 +114,7 @@ Vagrant.configure("2") do |config|
114
114
  terraform.disk_size = '15 GB'
115
115
  terraform.target_node = 'pve1'
116
116
  terraform.storage_domain = '[STORAGE_NAME]'
117
+ terraform.vmid = '10000-9999999' # Randomly select a VMID in this range. Optional, defaults to first free
117
118
  terraform.nameserver = '1.1.1.1 1.0.0.1'
118
119
  terraform.searchdomain = 'example.com'
119
120
  end
@@ -50,6 +50,7 @@ resource "proxmox_vm_qemu" "#{vmname.gsub(/\./, '-')}" {
50
50
  tags = ""
51
51
  clone = "#{config.template}"
52
52
  full_clone = #{config.full_clone}
53
+ #{config.vmid ? "vmid = \"#{config.vmid}\"" : ""}
53
54
  cores = #{config.cpu_cores.to_i}
54
55
  cpu_type = "#{config.cpu_type}"
55
56
  memory = #{Filesize.from("#{config.memory_size} B").to_f('MB').to_i}
@@ -28,6 +28,7 @@ module VagrantPlugins
28
28
  attr_accessor :os_type
29
29
  attr_accessor :full_clone
30
30
  attr_accessor :serial_port
31
+ attr_accessor :vmid
31
32
 
32
33
  def initialize
33
34
  @api_url = UNSET_VALUE
@@ -52,6 +53,7 @@ module VagrantPlugins
52
53
  @os_type = UNSET_VALUE
53
54
  @full_clone = UNSET_VALUE
54
55
  @serial_port = UNSET_VALUE
56
+ @vmid = UNSET_VALUE
55
57
  end
56
58
 
57
59
  def finalize!
@@ -78,6 +80,27 @@ module VagrantPlugins
78
80
  @full_clone = true if @full_clone == UNSET_VALUE
79
81
  @serial_port = false if @serial_port == UNSET_VALUE
80
82
 
83
+ @vmid = nil if @vmid == UNSET_VALUE
84
+
85
+ if @vmid != nil
86
+ if @vmid.is_a?(String) && @vmid.include?('-')
87
+ begin
88
+ range = @vmid.split('-').map(&:to_i)
89
+ raise if range.size != 2 || range[0] > range[1] || range[0] < 10000 || range[1] > 999999999
90
+ @vmid = rand(range[0]..range[1])
91
+ rescue
92
+ raise "Invalid vmid range format or out of allowed bounds (10000-999999999): #{@vmid}"
93
+ end
94
+ else
95
+ begin
96
+ @vmid = @vmid.to_i
97
+ raise if @vmid < 10000 || @vmid > 999999999
98
+ rescue
99
+ raise "Invalid vmid value or out of allowed bounds (10000-999999999): #{@vmid}"
100
+ end
101
+ end
102
+ end
103
+
81
104
  unless disk_size.nil?
82
105
  begin
83
106
  @disk_size = Filesize.from(@disk_size).to_f('B').to_i
@@ -1,6 +1,6 @@
1
1
  module VagrantPlugins
2
2
  module TerraformProvider
3
- VERSION = '0.3.3'
3
+ VERSION = '0.4.1'
4
4
  end
5
5
  end
6
6
 
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.3.3
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mika Båtsman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-21 00:00:00.000000000 Z
11
+ date: 2026-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: filesize