Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial OpenStack Support #117

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed resource names
  • Loading branch information
hfrenzel committed Sep 1, 2020
commit 6f013fc233638b66995c2fb76ceb624a7f25521f
14 changes: 7 additions & 7 deletions openstack/infra.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "local_file" "ssh_public_key_openssh" {

# Upload Ubuntu image
resource "openstack_images_image_v2" "rancher-ubuntu-image" {
name = "${var.prefix}-ubuntu-image"
name = "${var.prefix}-rancher-ubuntu-image"
image_source_url = "https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img"
container_format = "bare"
disk_format = "qcow2"
Expand All @@ -43,14 +43,14 @@ resource "openstack_compute_keypair_v2" "rancher-keypair" {

# OpenStack virtual network for quickstart resources
resource "openstack_networking_network_v2" "rancher-quickstart" {
name = "${var.prefix}-network"
name = "${var.prefix}-rancher-network"

tags = ["rancher-quickstart"]
}

# OpenStack internal subnet for quickstart resources
resource "openstack_networking_subnet_v2" "rancher-quickstart-internal" {
name = "rancher-quickstart-internal"
name = "${var.prefix}-rancher-quickstart-internal"
network_id = openstack_networking_network_v2.rancher-quickstart.id
cidr = var.network_cidr

Expand Down Expand Up @@ -85,7 +85,7 @@ resource "openstack_networking_floatingip_v2" "rancher-server-pip" {

# OpenStack network interface for quickstart resources
resource "openstack_networking_port_v2" "rancher-server-interface" {
name = "rancher-quickstart-interface"
name = "${var.prefix}-rancher-quickstart-interface"
network_id = openstack_networking_network_v2.rancher-quickstart.id

fixed_ip {
Expand Down Expand Up @@ -248,7 +248,7 @@ module "rancher_common" {
admin_password = var.rancher_server_admin_password

workload_kubernetes_version = var.workload_kubernetes_version
workload_cluster_name = "quickstart-openstack-custom"
workload_cluster_name = "${var.prefix}-quickstart-openstack-custom"
}

# Floating IP of quickstart node
Expand All @@ -260,7 +260,7 @@ resource "openstack_networking_floatingip_v2" "quickstart-node-pip" {

# OpenStack network interface for quickstart resources
resource "openstack_networking_port_v2" "quickstart-node-interface" {
name = "quickstart-node-interface"
name = "${var.prefix}-quickstart-node-interface"
network_id = openstack_networking_network_v2.rancher-quickstart.id

fixed_ip {
Expand Down Expand Up @@ -293,7 +293,7 @@ data "cloudinit_config" "quickstart-node-cloudinit" {

# OpenStack instance for creating a single node RKE cluster and installing the Rancher Server
resource "openstack_compute_instance_v2" "quickstart-node" {
name = "${var.prefix}-quickstart-node"
name = "${var.prefix}-rancher-quickstart-node"
flavor_name = var.instance_type
key_pair = openstack_compute_keypair_v2.rancher-keypair.name
user_data = data.cloudinit_config.quickstart-node-cloudinit.rendered
Expand Down