File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ data "template_file" "init_config" {
18
18
ssh_keys = local.all_keys
19
19
local_admin = var.local_admin
20
20
local_admin_passwd = var.local_admin_passwd
21
- hostname = format (" ${ var . vm_hostname_prefix } %02d" , count. index + 1 )
21
+ hostname = format (" ${ var . vm_hostname_prefix } %02d" , count. index + var . index_start )
22
22
time_zone = var.time_zone
23
23
}
24
24
}
@@ -39,7 +39,7 @@ data "template_cloudinit_config" "init_config" {
39
39
base64_encode = false
40
40
41
41
part {
42
- filename = format (" init%02d.cfg" , count. index + 1 )
42
+ filename = format (" init%02d.cfg" , count. index + var . index_start )
43
43
content_type = " text/cloud-config"
44
44
content = data. template_file . init_config [count . index ]. rendered
45
45
}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ terraform {
11
11
12
12
resource "libvirt_domain" "virt-machine" {
13
13
count = var. vm_count
14
- name = format (" ${ var . vm_hostname_prefix } %02d" , count. index + 1 )
14
+ name = format (" ${ var . vm_hostname_prefix } %02d" , count. index + var . index_start )
15
15
memory = var. memory
16
16
vcpu = var. vcpu
17
17
autostart = true
@@ -22,7 +22,7 @@ resource "libvirt_domain" "virt-machine" {
22
22
network_interface {
23
23
bridge = var. bridge
24
24
wait_for_lease = true
25
- hostname = format (" ${ var . vm_hostname_prefix } %02d" , count. index + 1 )
25
+ hostname = format (" ${ var . vm_hostname_prefix } %02d" , count. index + var . index_start )
26
26
}
27
27
28
28
xml {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ resource "libvirt_volume" "volume-qcow2" {
16
16
17
17
resource "libvirt_cloudinit_disk" "commoninit" {
18
18
count = var. vm_count
19
- name = format (" ${ var . vm_hostname_prefix } _init%2d.iso" , count. index + var . index_start )
19
+ name = format (" ${ var . vm_hostname_prefix } _init%2d.iso" , count. index + 1 )
20
20
user_data = data. template_cloudinit_config . init_config [count . index ]. rendered
21
21
network_config = data. template_file . network_config [count . index ]. rendered
22
22
pool = var. pool
You can’t perform that action at this time.
0 commit comments