diff --git a/data/data/config.tf b/data/data/config.tf index bbcc55449c2..a5d4f50c93f 100644 --- a/data/data/config.tf +++ b/data/data/config.tf @@ -12,16 +12,6 @@ This applies only to cloud platforms. EOF } -variable "tectonic_worker_count" { - type = "string" - default = "3" - - description = < 0 { - if len(l.WorkerIPs) != workerCount { - return fmt.Errorf("length of WorkerIPs doesn't match worker count") - } - } else { - if ips, err := generateIPs("worker", network, workerCount, 50); err == nil { - l.WorkerIPs = ips - } else { - return err - } - } - return nil } diff --git a/pkg/tfvars/tfvars.go b/pkg/tfvars/tfvars.go index bfbbddebf7d..d73f68be4a8 100644 --- a/pkg/tfvars/tfvars.go +++ b/pkg/tfvars/tfvars.go @@ -19,7 +19,6 @@ type config struct { Name string `json:"tectonic_cluster_name,omitempty"` BaseDomain string `json:"tectonic_base_domain,omitempty"` Masters int `json:"tectonic_master_count,omitempty"` - Workers int `json:"tectonic_worker_count,omitempty"` IgnitionBootstrap string `json:"ignition_bootstrap,omitempty"` IgnitionMaster string `json:"ignition_master,omitempty"` @@ -42,15 +41,15 @@ func TFVars(cfg *types.InstallConfig, bootstrapIgn, masterIgn string) ([]byte, e } for _, m := range cfg.Machines { - var replicas int - if m.Replicas == nil { - replicas = 1 - } else { - replicas = int(*m.Replicas) - } - switch m.Name { case "master": + var replicas int + if m.Replicas == nil { + replicas = 1 + } else { + replicas = int(*m.Replicas) + } + config.Masters += replicas if m.Platform.AWS != nil { config.AWS.Master = aws.Master{ @@ -64,7 +63,6 @@ func TFVars(cfg *types.InstallConfig, bootstrapIgn, masterIgn string) ([]byte, e } } case "worker": - config.Workers += replicas if m.Platform.AWS != nil { config.AWS.Worker = aws.Worker{ IAMRoleName: m.Platform.AWS.IAMRoleName, @@ -107,7 +105,7 @@ func TFVars(cfg *types.InstallConfig, bootstrapIgn, masterIgn string) ([]byte, e Image: cfg.Platform.Libvirt.DefaultMachinePlatform.Image, MasterIPs: masterIPs, } - if err := config.Libvirt.TFVars(config.Masters, config.Workers); err != nil { + if err := config.Libvirt.TFVars(config.Masters); err != nil { return nil, errors.Wrap(err, "failed to insert libvirt variables") } if err := config.Libvirt.UseCachedImage(); err != nil {