From 42aa4259479e016836b85a31eb2e4f12d0f51560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix-Antoine=20Fortin?= Date: Fri, 20 Sep 2024 12:23:14 -0400 Subject: [PATCH] Remove "generate_ssh_key" parameter --- .../magic_castle/magic_castle_configuration.py | 5 ++--- .../main.tf.json | 1 - .../created.calculquebec.cloud/main.tf.json | 1 - .../terraform_plan.json | 17 +---------------- .../empty-state.calculquebec.cloud/main.tf.json | 1 - .../missingfloatingips.c3.ca/main.tf.json | 1 - .../terraform_plan.json | 17 +---------------- .../missingnodes.c3.ca/main.tf.json | 1 - .../noowner.calculquebec.cloud/main.tf.json | 1 - .../valid1.calculquebec.cloud/main.tf.json | 1 - 10 files changed, 4 insertions(+), 42 deletions(-) diff --git a/mchub/models/magic_castle/magic_castle_configuration.py b/mchub/models/magic_castle/magic_castle_configuration.py index 0f3039ac..7ac2c429 100644 --- a/mchub/models/magic_castle/magic_castle_configuration.py +++ b/mchub/models/magic_castle/magic_castle_configuration.py @@ -22,7 +22,6 @@ "source", "config_git_url", "config_version", - "generate_ssh_key", # Legacy fields "puppetenv_rev", ] @@ -82,7 +81,6 @@ def update_main_file(self, filename): "module": { "openstack": { "source": MAGIC_CASTLE_SOURCE["openstack"], - "generate_ssh_key": True, "config_git_url": MAGIC_CASTLE_PUPPET_CONFIGURATION_URL, "config_version": MAGIC_CASTLE_VERSION, **self.to_dict(), @@ -90,7 +88,8 @@ def update_main_file(self, filename): }, } main_tf_configuration["module"].update( - DnsManager(self._configuration["domain"]).get_magic_castle_configuration() + DnsManager(self._configuration["domain"] + ).get_magic_castle_configuration() ) with open(filename, "w") as main_terraform_file: diff --git a/tests/mock-clusters/buildplanning.calculquebec.cloud/main.tf.json b/tests/mock-clusters/buildplanning.calculquebec.cloud/main.tf.json index 29ad7dde..af2855c4 100644 --- a/tests/mock-clusters/buildplanning.calculquebec.cloud/main.tf.json +++ b/tests/mock-clusters/buildplanning.calculquebec.cloud/main.tf.json @@ -5,7 +5,6 @@ "module": { "openstack": { "source": "/home/mcu/magic_castle-openstack-11.8/openstack", - "generate_ssh_key": true, "puppetenv_rev": "11.8", "cluster_name": "buildplanning", "domain": "calculquebec.cloud", diff --git a/tests/mock-clusters/created.calculquebec.cloud/main.tf.json b/tests/mock-clusters/created.calculquebec.cloud/main.tf.json index 909ee53a..2f8b6094 100644 --- a/tests/mock-clusters/created.calculquebec.cloud/main.tf.json +++ b/tests/mock-clusters/created.calculquebec.cloud/main.tf.json @@ -5,7 +5,6 @@ "module": { "openstack": { "source": "git::https://github.com/ComputeCanada/magic_castle.git//openstack?ref=11.8", - "generate_ssh_key": true, "config_git_url": "https://github.com/ComputeCanada/puppet-magic_castle.git", "config_version": "11.8", "cluster_name": "created", diff --git a/tests/mock-clusters/created.calculquebec.cloud/terraform_plan.json b/tests/mock-clusters/created.calculquebec.cloud/terraform_plan.json index 1fff071e..9ef9bdcc 100644 --- a/tests/mock-clusters/created.calculquebec.cloud/terraform_plan.json +++ b/tests/mock-clusters/created.calculquebec.cloud/terraform_plan.json @@ -3402,9 +3402,6 @@ "domain": { "constant_value": "calculquebec.cloud" }, - "generate_ssh_key": { - "constant_value": true - }, "guest_passwd": { "constant_value": "password-123" }, @@ -4287,11 +4284,6 @@ "var.config_version" ] }, - "generate_ssh_key": { - "references": [ - "var.generate_ssh_key" - ] - }, "instances": { "references": [ "module.design.instances", @@ -4394,16 +4386,13 @@ }, "schema_version": 0, "count_expression": { - "references": [ - "var.generate_ssh_key" - ] + "references": [] } } ], "variables": { "config_git_url": {}, "config_version": {}, - "generate_ssh_key": {}, "instances": {}, "public_keys": {}, "puppetserver_ip": {}, @@ -4472,10 +4461,6 @@ ], "description": "List of login external firewall rules defined as map of 5 values name, from_port, to_port, ip_protocol and cidr" }, - "generate_ssh_key": { - "default": false, - "description": "If set to true, Terraform will generate an ssh key pair to connect to the cluster. Default: false" - }, "guest_passwd": { "default": "", "description": "Guest accounts common password. If left blank, the password is randomly generated." diff --git a/tests/mock-clusters/empty-state.calculquebec.cloud/main.tf.json b/tests/mock-clusters/empty-state.calculquebec.cloud/main.tf.json index 30620bb6..fdcb263a 100644 --- a/tests/mock-clusters/empty-state.calculquebec.cloud/main.tf.json +++ b/tests/mock-clusters/empty-state.calculquebec.cloud/main.tf.json @@ -5,7 +5,6 @@ "module": { "openstack": { "source": "git::https://github.com/ComputeCanada/magic_castle.git//openstack?ref=11.8", - "generate_ssh_key": true, "config_git_url": "https://github.com/ComputeCanada/puppet-magic_castle.git", "config_version": "11.8", "cluster_name": "empty-state", diff --git a/tests/mock-clusters/missingfloatingips.c3.ca/main.tf.json b/tests/mock-clusters/missingfloatingips.c3.ca/main.tf.json index 1a55c5ad..422540cc 100644 --- a/tests/mock-clusters/missingfloatingips.c3.ca/main.tf.json +++ b/tests/mock-clusters/missingfloatingips.c3.ca/main.tf.json @@ -5,7 +5,6 @@ "module": { "openstack": { "source": "git::https://github.com/ComputeCanada/magic_castle.git//openstack?ref=11.8", - "generate_ssh_key": true, "config_git_url": "https://github.com/ComputeCanada/puppet-magic_castle.git", "config_version": "11.8", "cluster_name": "missingfloatingips", diff --git a/tests/mock-clusters/missingfloatingips.c3.ca/terraform_plan.json b/tests/mock-clusters/missingfloatingips.c3.ca/terraform_plan.json index 4750b994..ea81f358 100644 --- a/tests/mock-clusters/missingfloatingips.c3.ca/terraform_plan.json +++ b/tests/mock-clusters/missingfloatingips.c3.ca/terraform_plan.json @@ -2836,9 +2836,6 @@ "domain": { "constant_value": "c3.ca" }, - "generate_ssh_key": { - "constant_value": true - }, "guest_passwd": { "constant_value": "password-123" }, @@ -3721,11 +3718,6 @@ "var.config_version" ] }, - "generate_ssh_key": { - "references": [ - "var.generate_ssh_key" - ] - }, "instances": { "references": [ "module.design.instances", @@ -3828,16 +3820,13 @@ }, "schema_version": 0, "count_expression": { - "references": [ - "var.generate_ssh_key" - ] + "references": [] } } ], "variables": { "config_git_url": {}, "config_version": {}, - "generate_ssh_key": {}, "instances": {}, "public_keys": {}, "puppetserver_ip": {}, @@ -3906,10 +3895,6 @@ ], "description": "List of login external firewall rules defined as map of 5 values name, from_port, to_port, ip_protocol and cidr" }, - "generate_ssh_key": { - "default": false, - "description": "If set to true, Terraform will generate an ssh key pair to connect to the cluster. Default: false" - }, "guest_passwd": { "default": "", "description": "Guest accounts common password. If left blank, the password is randomly generated." diff --git a/tests/mock-clusters/missingnodes.c3.ca/main.tf.json b/tests/mock-clusters/missingnodes.c3.ca/main.tf.json index 5eeabd1a..26ef8a54 100644 --- a/tests/mock-clusters/missingnodes.c3.ca/main.tf.json +++ b/tests/mock-clusters/missingnodes.c3.ca/main.tf.json @@ -5,7 +5,6 @@ "module": { "openstack": { "source": "git::https://github.com/ComputeCanada/magic_castle.git//openstack?ref=11.8", - "generate_ssh_key": true, "config_git_url": "https://github.com/ComputeCanada/puppet-magic_castle.git", "config_version": "11.8", "cluster_name": "missingnodes", diff --git a/tests/mock-clusters/noowner.calculquebec.cloud/main.tf.json b/tests/mock-clusters/noowner.calculquebec.cloud/main.tf.json index 67875b1a..a86d67c5 100644 --- a/tests/mock-clusters/noowner.calculquebec.cloud/main.tf.json +++ b/tests/mock-clusters/noowner.calculquebec.cloud/main.tf.json @@ -5,7 +5,6 @@ "module": { "openstack": { "source": "git::https://github.com/ComputeCanada/magic_castle.git//openstack?ref=11.8", - "generate_ssh_key": true, "config_git_url": "https://github.com/ComputeCanada/puppet-magic_castle.git", "config_version": "11.8", "cluster_name": "noowner", diff --git a/tests/mock-clusters/valid1.calculquebec.cloud/main.tf.json b/tests/mock-clusters/valid1.calculquebec.cloud/main.tf.json index 80b9edba..ac9e3582 100644 --- a/tests/mock-clusters/valid1.calculquebec.cloud/main.tf.json +++ b/tests/mock-clusters/valid1.calculquebec.cloud/main.tf.json @@ -5,7 +5,6 @@ "module": { "openstack": { "source": "git::https://github.com/ComputeCanada/magic_castle.git//openstack?ref=11.8", - "generate_ssh_key": true, "config_git_url": "https://github.com/ComputeCanada/puppet-magic_castle.git", "config_version": "11.8", "cluster_name": "valid1",