public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: <kdevops@lists.linux.dev>
Cc: Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH 7/7] terraform: Remove OpenStack provider directory
Date: Fri, 31 Oct 2025 20:50:20 -0400	[thread overview]
Message-ID: <20251101005020.3492781-9-cel@kernel.org> (raw)
In-Reply-To: <20251101005020.3492781-1-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

Remove the entire terraform/openstack directory and all its files
including Kconfig, terraform configurations, and cloud provider setup.
This removes support for deploying kdevops on OpenStack clouds.

Generated-by: Claude AI
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/openstack/Kconfig                   |  66 -----------
 terraform/openstack/ansible_provision_cmd.tpl |   1 -
 terraform/openstack/clouds-public.yaml        |  19 ----
 terraform/openstack/main.tf                   | 107 ------------------
 terraform/openstack/output.tf                 |  28 -----
 terraform/openstack/output_minicloud.tf       |  51 ---------
 terraform/openstack/provider.tf               |  23 ----
 terraform/openstack/shared.tf                 |   1 -
 .../openstack/update_ssh_config_minicloud.tf  |  25 ----
 terraform/openstack/vars.tf                   |  46 --------
 10 files changed, 367 deletions(-)
 delete mode 100644 terraform/openstack/Kconfig
 delete mode 120000 terraform/openstack/ansible_provision_cmd.tpl
 delete mode 100644 terraform/openstack/clouds-public.yaml
 delete mode 100644 terraform/openstack/main.tf
 delete mode 100644 terraform/openstack/output.tf
 delete mode 100644 terraform/openstack/output_minicloud.tf
 delete mode 100644 terraform/openstack/provider.tf
 delete mode 120000 terraform/openstack/shared.tf
 delete mode 100644 terraform/openstack/update_ssh_config_minicloud.tf
 delete mode 100644 terraform/openstack/vars.tf

diff --git a/terraform/openstack/Kconfig b/terraform/openstack/Kconfig
deleted file mode 100644
index 61167ad152d8..000000000000
--- a/terraform/openstack/Kconfig
+++ /dev/null
@@ -1,66 +0,0 @@
-if TERRAFORM_OPENSTACK
-
-config TERRAFORM_TERRAFORM_OPENSTACK_CLOUD_NAME
-	string "OpenStack cloud name on your clouds.yaml"
-	default "minicloud"
-	help
-	  This option sets the name of the cloud you will use which has
-	  configuration settings described on the file clouds.yaml.
-
-config TERRAFORM_TERRAFORM_OPENSTACK_INSTANCE_PREFIX
-	string "Openstack instance prefix name for resources"
-	default "example"
-	help
-	  This option will set a prefix name for openstack_compute_secgroup_v2.
-	  This will likely be removed or replaced in the future. This is only
-	  useful to distinguish one resource name right now.
-
-choice
-	prompt "Choose flavor name (machine type)"
-	default TERRAFORM_OPENSTACK_MINICLOUD_TINY
-
-config TERRAFORM_OPENSTACK_MINICLOUD_TINY
-	bool "minicloud.tiny"
-	depends on TARGET_ARCH_PPC64LE
-	help
-	  This option will set the Openstack flavor to minicloud.tiny.
-
-endchoice
-
-config TERRAFORM_OPENSTACK_FLAVOR
-	string "OpenStack flavor"
-	default "minicloud.tiny" if TERRAFORM_OPENSTACK_MINICLOUD_TINY
-	help
-	  This option will set the OpenStack flavor name.
-
-choice
-	prompt "Choose OpenStack image name"
-	default TERRAFORM_OPENSTACK_IMAGE_DEBIAN_10_PPC64LE
-
-config TERRAFORM_OPENSTACK_IMAGE_DEBIAN_10_PPC64LE
-	bool "Debian 10 ppc64le"
-	depends on TARGET_ARCH_PPC64LE
-	help
-	  This option sets the image name to Debian 10 ppc64le.
-
-endchoice
-
-config TERRAFORM_OPENSTACK_IMAGE_NAME
-	string "OpenStack image name"
-	default "Debian 10 ppc64le" if TERRAFORM_OPENSTACK_IMAGE_DEBIAN_10_PPC64LE && DISTRO_DEBIAN
-	help
-	  This option will set OpenStack image name to use.
-
-config TERRAFORM_OPENSTACK_SSH_PUBKEY_NAME
-	string "Name of already existing pubkey uploaded"
-	default "kdevops-pubkey"
-	help
-	  Name of already existing pubkey or the new one you are about to
-	  upload, this must be set
-
-config TERRAFORM_OPENSTACK_PUBLIC_NETWORK_NAME
-	string "Name of the public network"
-	default "public"
-	help
-	  Name of an already existing public network in the cluster.
-endif # TERRAFORM_OPENSTACK
diff --git a/terraform/openstack/ansible_provision_cmd.tpl b/terraform/openstack/ansible_provision_cmd.tpl
deleted file mode 120000
index 5c92657651f8..000000000000
--- a/terraform/openstack/ansible_provision_cmd.tpl
+++ /dev/null
@@ -1 +0,0 @@
-../ansible_provision_cmd.tpl
\ No newline at end of file
diff --git a/terraform/openstack/clouds-public.yaml b/terraform/openstack/clouds-public.yaml
deleted file mode 100644
index 1786a618aaf7..000000000000
--- a/terraform/openstack/clouds-public.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-clouds:
- minicloud:
-  auth:
-    auth_url: http://minicloud.parqtec.unicamp.br:5000/v3/
-    project_name: maria.quijote
-    user_domain_name: Default
-    project_domain_name: Default
-    username: maria.quijote
-    password: verysecret
-    # Set to True in your clouds.yaml to disable SSL certification verification
-    # if you really need it.
-    # verify: False
-  region_name: RegionOne
-  regions:
-    - name: RegionOne
-      values:
-        networks:
-          - name: public
-            routes_externally: true
diff --git a/terraform/openstack/main.tf b/terraform/openstack/main.tf
deleted file mode 100644
index c9037ca734f9..000000000000
--- a/terraform/openstack/main.tf
+++ /dev/null
@@ -1,107 +0,0 @@
-# Openstack terraform provider main
-
-resource "openstack_networking_network_v2" "kdevops_private_net" {
-	count		= var.private_net_enabled ? 1 : 0
-	name		= "kdevops_private_net"
-	admin_state_up	= "true"
-}
-
-resource "openstack_networking_subnet_v2" "kdevops_private_subnet" {
-	count		= var.private_net_enabled ? 1 : 0
-	name 		= "kdevops_private_subnet"
-	network_id	= "${openstack_networking_network_v2.kdevops_private_net[0].id}"
-	cidr		= format("%s/%d", var.private_net_prefix, var.private_net_mask)
-}
-
-resource "openstack_compute_secgroup_v2" "kdevops_security_group" {
-  name        = format("%s-%s", var.instance_prefix, "kdevops_security_group")
-  description = "security group for kdevops"
-
-  # SSH
-  rule {
-    from_port   = var.ssh_config_port
-    to_port     = var.ssh_config_port
-    ip_protocol = "tcp"
-    cidr        = "0.0.0.0/0"
-  }
-
-  # All TCP high ports
-  rule {
-    from_port   = 1024
-    to_port     = 65535
-    ip_protocol = "tcp"
-    cidr        = "0.0.0.0/0"
-  }
-}
-
-# You can upload your ssh key to the OpenStack interface and just set
-# ssh_config_pubkey_file = "" on your terraform.tfvars, this will just use the
-# already existing and uploaded key. Even if you already uplaoded the key,
-# if you set the ssh_config_pubkey_file variable to the same key, this will just
-# upload the same pubkey key again and just use the name in ssh_pubkey_name.
-#
-# If you haven't yet uploaded your key through the web interface, you can
-# set ssh_config_pubkey_file to your pubkey file path, and it will be uplaoded
-# and the key name associated with it. Once you 'terraform destroy' only
-# the public key resource will be destroyed.
-#
-# If you want to create a new random key this allows you to do that as well,
-# just set ssh_pubkey_data = "" and ssh_config_pubkey_file = "" in your
-# terraform.tfvars and a new key pair will be created for you on the fly.
-# However note that once this resource is destroyed the private key will
-# also be destroyed if you asked terraform to create a new key for you.
-resource "openstack_compute_keypair_v2" "kdevops_keypair" {
-  name       = var.ssh_pubkey_name
-  public_key = var.ssh_pubkey_data != "" ? var.ssh_pubkey_data : var.ssh_config_pubkey_file != "" ? file(var.ssh_config_pubkey_file) : ""
-}
-
-resource "openstack_compute_instance_v2" "kdevops_instances" {
-  count           = local.kdevops_num_boxes
-  name            = element(var.kdevops_nodes, count.index)
-  image_name      = var.image_name
-  flavor_name     = var.flavor_name
-  key_pair        = var.ssh_pubkey_name
-  security_groups = [openstack_compute_secgroup_v2.kdevops_security_group.name]
-  user_data = templatefile("${path.module}/../scripts/cloud-init.sh", {
-    user_data_log_dir = "/var/log/kdevops"
-    user_data_enabled = "yes"
-    ssh_config_user   = var.ssh_config_user
-    ssh_config_port   = var.ssh_config_port
-    new_hostname      = element(var.kdevops_nodes, count.index)
-  })
-  network {
-    name          = var.public_network_name
-  }
-}
-
-resource "openstack_compute_interface_attach_v2" "kdevops_net_attach" {
-  count           = var.private_net_enabled ? local.kdevops_num_boxes : 0
-  instance_id     = "${openstack_compute_instance_v2.kdevops_instances[count.index].id}"
-  network_id      = "${openstack_networking_network_v2.kdevops_private_net[0].id}"
-  # needed to work around race in openstack provider
-  depends_on	  = [openstack_networking_subnet_v2.kdevops_private_subnet]
-}
-
-resource "openstack_blockstorage_volume_v3" "kdevops_data_disk" {
-  count                = local.kdevops_num_boxes
-  name                 = format("kdevops-data-disk-%02d", count.index + 1)
-  size                 = 80
-}
-
-resource "openstack_blockstorage_volume_v3" "kdevops_scratch_disk" {
-  count                = local.kdevops_num_boxes
-  name                 = format("kdevops-scratch-disk-%02d", count.index + 1)
-  size                 = 80
-}
-
-resource "openstack_compute_volume_attach_v2" "kdevops_data_disk_attach" {
-  count                = local.kdevops_num_boxes
-  volume_id            = openstack_blockstorage_volume_v3.kdevops_data_disk[count.index].id
-  instance_id          = element(openstack_compute_instance_v2.kdevops_instances.*.id, count.index)
-}
-
-resource "openstack_compute_volume_attach_v2" "kdevops_scratch_disk_attach" {
-  count                = local.kdevops_num_boxes
-  volume_id            = openstack_blockstorage_volume_v3.kdevops_scratch_disk[count.index].id
-  instance_id          = element(openstack_compute_instance_v2.kdevops_instances.*.id, count.index)
-}
diff --git a/terraform/openstack/output.tf b/terraform/openstack/output.tf
deleted file mode 100644
index 1667521a4bfc..000000000000
--- a/terraform/openstack/output.tf
+++ /dev/null
@@ -1,28 +0,0 @@
-# All generic output goes here
-
-data "null_data_source" "group_hostnames_and_ips" {
-  count = local.kdevops_num_boxes
-  inputs = {
-    value = format(
-      "%30s  :  %s",
-      element(var.kdevops_nodes, count.index),
-      element(
-        openstack_compute_instance_v2.kdevops_instances.*.access_ip_v4,
-        count.index,
-      ),
-    )
-  }
-}
-
-output "kdevops_hosts_and_ipv4" {
-  value = data.null_data_source.group_hostnames_and_ips.*.outputs
-}
-
-# Each provider's output.tf needs to define a controller_ip_map. This
-# map is used to build the Ansible controller's ssh configuration.
-# Each map entry contains the node's hostname and public/private IP
-# address.
-output "controller_ip_map" {
-  description = "The IP addresses assigned to each instance"
-  value       = zipmap(var.kdevops_nodes[*], openstack_compute_instance_v2.kdevops_instances[*].access_ip_v4)
-}
diff --git a/terraform/openstack/output_minicloud.tf b/terraform/openstack/output_minicloud.tf
deleted file mode 100644
index cf2b5f900878..000000000000
--- a/terraform/openstack/output_minicloud.tf
+++ /dev/null
@@ -1,51 +0,0 @@
-# minicloud specific output
-
-locals {
-  ssh_key_i = format(
-    " %s%s ",
-    var.ssh_config_pubkey_file != "" ? "-i " : "",
-    var.ssh_config_pubkey_file != "" ? replace(var.ssh_config_pubkey_file, ".pub", "") : "",
-  )
-}
-
-# If using minicloud the public IPs are actually mapped to ports. This does
-# the tranlation for you.
-# https://github.com/Unicamp-OpenPower/minicloud/wiki/Getting-Started-with-Minicloud
-data "null_data_source" "group_hostnames_and_ports_v2" {
-  count = var.openstack_cloud != "minicloud" ? 0 : local.kdevops_num_boxes
-  inputs = {
-    value = format(
-      "%30s  :  %s%s%03d%s ",
-      element(var.kdevops_nodes, count.index),
-      "ssh debian@minicloud.parqtec.unicamp.br -p ",
-      element(
-        split(
-          ".",
-          element(
-            openstack_compute_instance_v2.kdevops_instances.*.access_ip_v4,
-            count.index,
-          ),
-        ),
-        2,
-      ),
-      ceil(
-        element(
-          split(
-            ".",
-            element(
-              openstack_compute_instance_v2.kdevops_instances.*.access_ip_v4,
-              count.index,
-            ),
-          ),
-          3,
-        ),
-      ),
-      local.ssh_key_i,
-    )
-  }
-}
-
-output "kdevops_minicloud_port_ip_access_v2" {
-  value = data.null_data_source.group_hostnames_and_ports_v2.*.outputs
-}
-
diff --git a/terraform/openstack/provider.tf b/terraform/openstack/provider.tf
deleted file mode 100644
index 6cc0145b8324..000000000000
--- a/terraform/openstack/provider.tf
+++ /dev/null
@@ -1,23 +0,0 @@
-terraform {
-  required_providers {
-    openstack = {
-      source  = "terraform-provider-openstack/openstack"
-      version = "~>1.47.0"
-    }
-    null = {
-      source  = "hashicorp/null"
-      version = "~>2.1"
-    }
-  }
-}
-
-provider "openstack" {
-  # We prefer this method as it means you also get to use standard openstack
-  # utilities that also use and share the same configuration files.
-  # First clouds-public.yaml is read, then clouds.yaml and last secure.yaml.
-  #
-  # For more details or examples see:
-  # https://docs.openstack.org/os-client-config/latest/user/configuration.html
-  # https://www.inovex.de/blog/managing-secrets-openstack-terraform/
-  cloud = var.openstack_cloud
-}
diff --git a/terraform/openstack/shared.tf b/terraform/openstack/shared.tf
deleted file mode 120000
index c10b6106ad1c..000000000000
--- a/terraform/openstack/shared.tf
+++ /dev/null
@@ -1 +0,0 @@
-../shared.tf
\ No newline at end of file
diff --git a/terraform/openstack/update_ssh_config_minicloud.tf b/terraform/openstack/update_ssh_config_minicloud.tf
deleted file mode 100644
index 4fd3f0851da7..000000000000
--- a/terraform/openstack/update_ssh_config_minicloud.tf
+++ /dev/null
@@ -1,25 +0,0 @@
-locals {
-  shorthosts_minicloud  = openstack_compute_instance_v2.kdevops_instances.*.name
-  ports_minicloud = [
-    for ip in openstack_compute_instance_v2.kdevops_instances.*.access_ip_v4 :
-    format("%s%03d", element(split(".", ip), 2, ), ceil(element(split(".", ip), 3, )))
-  ]
-}
-
-module "ssh_config_update_host_entries_minicloud" {
-  source  = "linux-kdevops/add-host-ssh-config/kdevops"
-  version = "3.0.0"
-
-  ssh_config               = var.ssh_config
-  update_ssh_config_enable = (var.openstack_cloud == "minicloud" && local.kdevops_num_boxes > 0) ? "true" : ""
-  cmd                      = "update"
-  shorthosts               = join(",", slice(local.shorthosts_minicloud, 0, local.kdevops_num_boxes))
-  hostnames                = "minicloud.parqtec.unicamp.br"
-  ports                    = join(",", slice(local.ports_minicloud, 0, local.kdevops_num_boxes))
-  user                     = var.ssh_config_user == "" ? "" : var.ssh_config_user
-  id                       = replace(var.ssh_config_pubkey_file, ".pub", "")
-  strict                   = var.ssh_config_use_strict_settings != "true" ? "" : "true"
-  use_backup               = var.ssh_config_backup != "true" || var.ssh_config == "/dev/null" ? "" : "true"
-  backup_postfix           = "kdevops"
-  kexalgorithms            = var.ssh_config_kexalgorithms == "" ? "" : var.ssh_config_kexalgorithms
-}
diff --git a/terraform/openstack/vars.tf b/terraform/openstack/vars.tf
deleted file mode 100644
index 1e6193124c52..000000000000
--- a/terraform/openstack/vars.tf
+++ /dev/null
@@ -1,46 +0,0 @@
-# This is a relatively new feature, reading cloud.yaml and friends. Even
-# though older openstack solutions don't support this, we keep things simple
-# and ask you to use these files for now.
-#
-# If its a public cloud we may add support for extra processing / output
-# for each one on its respective cloudname.tf file.
-variable "openstack_cloud" {
-  description = "Name of your cloud on clouds.yaml"
-  default     = "minicloud"
-}
-
-variable "ssh_pubkey_name" {
-  description = "Name of already existing pubkey or the new one you are about to upload, this must be set"
-  default     = "kdevops-pubkey"
-}
-
-variable "ssh_pubkey_data" {
-  description = "The ssh public key data"
-
-  # for instance it coudl be "ssh-rsa AAetcccc"
-  default = ""
-}
-
-variable "image_name" {
-  description = "Type of image"
-  default     = "Debian 10 ppc64le"
-}
-
-# Note: at least if using minicloud you're allowed 5 instances but only
-# 8 cores and 10 GiB of RAM. If you use minicloud.max you max out all
-# core limits right away. By default we use here the minicloud.tiny
-# to let at you at least create a few instances.
-variable "flavor_name" {
-  description = "Flavor of image"
-  default     = "minicloud.tiny"
-}
-
-variable "instance_prefix" {
-  description = "The prefix of the VM instance name"
-  default     = "my-fun"
-}
-
-variable "public_network_name" {
-  description = "The name of the network"
-  default     = "public"
-}
-- 
2.51.0


      parent reply	other threads:[~2025-11-01  0:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-01  0:50 [PATCH 0/7] Remove support for OpenStack-based clouds Chuck Lever
2025-11-01  0:50 ` [PATCH] CLAUDE.md: Suggest method for checking generated Kconfig files Chuck Lever
2025-11-01  0:50 ` [PATCH 1/7] docs: Remove OpenStack documentation Chuck Lever
2025-11-01  0:50 ` [PATCH 2/7] CLAUDE.md: Remove OpenStack from infrastructure list Chuck Lever
2025-11-01  0:50 ` [PATCH 3/7] kconfigs: Remove remaining OpenStack references Chuck Lever
2025-11-01  0:50 ` [PATCH 4/7] scripts: Remove OpenStack from terraform.Makefile Chuck Lever
2025-11-01  0:50 ` [PATCH 5/7] playbooks: Remove OpenStack ansible support Chuck Lever
2025-11-01  0:50 ` [PATCH 6/7] terraform: Remove OpenStack from Kconfig.providers Chuck Lever
2025-11-01  0:50 ` Chuck Lever [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251101005020.3492781-9-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=kdevops@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox