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" {
1818 ssh_keys = local.all_keys
1919 local_admin = var.local_admin
2020 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 )
2222 time_zone = var.time_zone
2323 }
2424}
@@ -39,7 +39,7 @@ data "template_cloudinit_config" "init_config" {
3939 base64_encode = false
4040
4141 part {
42- filename = format (" init%02d.cfg" , count. index + 1 )
42+ filename = format (" init%02d.cfg" , count. index + var . index_start )
4343 content_type = " text/cloud-config"
4444 content = data. template_file . init_config [count . index ]. rendered
4545 }
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ terraform {
1111
1212resource "libvirt_domain" "virt-machine" {
1313 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 )
1515 memory = var. memory
1616 vcpu = var. vcpu
1717 autostart = true
@@ -22,7 +22,7 @@ resource "libvirt_domain" "virt-machine" {
2222 network_interface {
2323 bridge = var. bridge
2424 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 )
2626 }
2727
2828 xml {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ resource "libvirt_volume" "volume-qcow2" {
1616
1717resource "libvirt_cloudinit_disk" "commoninit" {
1818 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 )
2020 user_data = data. template_cloudinit_config . init_config [count . index ]. rendered
2121 network_config = data. template_file . network_config [count . index ]. rendered
2222 pool = var. pool
You can’t perform that action at this time.
0 commit comments