diff --git a/.gitlab-ci/terraform.yml b/.gitlab-ci/terraform.yml index 313de9638..1e45bd216 100644 --- a/.gitlab-ci/terraform.yml +++ b/.gitlab-ci/terraform.yml @@ -33,6 +33,8 @@ extends: .terraform_install stage: deploy-part2 when: manual + variables: + ANSIBLE_INVENTORY_UNPARSED_FAILED: "true" script: - terraform apply -auto-approve ../../contrib/terraform/$PROVIDER - ansible-playbook -i hosts ../../cluster.yml --become @@ -73,7 +75,7 @@ tf-packet-ubuntu16-default: TF_VAR_number_of_k8s_nodes: "1" TF_VAR_plan_k8s_masters: t1.small.x86 TF_VAR_plan_k8s_nodes: t1.small.x86 - TF_VAR_facilities: '["ewr1"]' + TF_VAR_facility: ewr1 TF_VAR_public_key_path: "" TF_VAR_operating_system: ubuntu_16_04 @@ -88,7 +90,7 @@ tf-packet-ubuntu18-default: TF_VAR_number_of_k8s_nodes: "1" TF_VAR_plan_k8s_masters: t1.small.x86 TF_VAR_plan_k8s_nodes: t1.small.x86 - TF_VAR_facilities: '["ams1"]' + TF_VAR_facility: ams1 TF_VAR_public_key_path: "" TF_VAR_operating_system: ubuntu_18_04 diff --git a/contrib/terraform/packet/kubespray.tf b/contrib/terraform/packet/kubespray.tf index 282601a39..e3b6bfc2f 100644 --- a/contrib/terraform/packet/kubespray.tf +++ b/contrib/terraform/packet/kubespray.tf @@ -15,7 +15,7 @@ resource "packet_device" "k8s_master" { count = "${var.number_of_k8s_masters}" hostname = "${var.cluster_name}-k8s-master-${count.index+1}" plan = "${var.plan_k8s_masters}" - facilities = "${var.facilities}" + facilities = ["${var.facility}"] operating_system = "${var.operating_system}" billing_cycle = "${var.billing_cycle}" project_id = "${var.packet_project_id}" @@ -28,7 +28,7 @@ resource "packet_device" "k8s_master_no_etcd" { count = "${var.number_of_k8s_masters_no_etcd}" hostname = "${var.cluster_name}-k8s-master-${count.index+1}" plan = "${var.plan_k8s_masters_no_etcd}" - facilities = "${var.facilities}" + facilities = ["${var.facility}"] operating_system = "${var.operating_system}" billing_cycle = "${var.billing_cycle}" project_id = "${var.packet_project_id}" @@ -41,7 +41,7 @@ resource "packet_device" "k8s_etcd" { count = "${var.number_of_etcd}" hostname = "${var.cluster_name}-etcd-${count.index+1}" plan = "${var.plan_etcd}" - facilities = "${var.facilities}" + facilities = ["${var.facility}"] operating_system = "${var.operating_system}" billing_cycle = "${var.billing_cycle}" project_id = "${var.packet_project_id}" @@ -54,7 +54,7 @@ resource "packet_device" "k8s_node" { count = "${var.number_of_k8s_nodes}" hostname = "${var.cluster_name}-k8s-node-${count.index+1}" plan = "${var.plan_k8s_nodes}" - facilities = "${var.facilities}" + facilities = ["${var.facility}"] operating_system = "${var.operating_system}" billing_cycle = "${var.billing_cycle}" project_id = "${var.packet_project_id}" diff --git a/contrib/terraform/packet/sample-inventory/cluster.tf b/contrib/terraform/packet/sample-inventory/cluster.tf index a17b7a696..2482194cf 100644 --- a/contrib/terraform/packet/sample-inventory/cluster.tf +++ b/contrib/terraform/packet/sample-inventory/cluster.tf @@ -10,7 +10,7 @@ packet_project_id = "Example-API-Token" public_key_path = "~/.ssh/id_rsa.pub" # cluster location -facilities = ["ewr1"] +facility = "ewr1" # standalone etcds number_of_etcd = 0 diff --git a/contrib/terraform/packet/variables.tf b/contrib/terraform/packet/variables.tf index 0d28fee31..e71b78bbf 100644 --- a/contrib/terraform/packet/variables.tf +++ b/contrib/terraform/packet/variables.tf @@ -19,8 +19,8 @@ variable "billing_cycle" { default = "hourly" } -variable "facilities" { - default = ["dfw2"] +variable "facility" { + default = "dfw2" } variable "plan_k8s_masters" { diff --git a/contrib/terraform/terraform.py b/contrib/terraform/terraform.py index efeb167b0..24a95622e 100755 --- a/contrib/terraform/terraform.py +++ b/contrib/terraform/terraform.py @@ -178,7 +178,6 @@ def packet_device(resource, tfvars=None): } # add groups based on attrs - groups.append('packet_facilities=' + attrs['facilities']) groups.append('packet_operating_system=' + attrs['operating_system']) groups.append('packet_locked=%s' % attrs['locked']) groups.append('packet_state=' + attrs['state'])