Commit f3581846 authored by Chris King's avatar Chris King
Browse files

Registration changes

* Change system to use rmt host and fingerprint
* Update variables and documentation to reflect change
parent ac4b1fa8
......@@ -22,6 +22,7 @@ provider "registry.terraform.io/terraform-provider-openstack/openstack" {
version = "1.35.0"
constraints = "~> 1.35.0"
hashes = [
"h1:dl0m5Ud6Caqx/FLDPHOWV1XbG2L7NntGZVOoLYAnOZI=",
"h1:k1SCosvSICWAgRkswl83KtCycN7iP9asejWDDEQEtuk=",
"zh:04cf8800c83289a28619ac9925bc03e0ccd624f0ed68284f8bd473cf48f05ef0",
"zh:15fc2e1ea6f87d11e15aad075f3bfb7013eb63f31637f1ee317c94686c9650ec",
......
......@@ -40,9 +40,8 @@
| `base_image_visibility` | string | no | `null` | Visibility of image. Must be one of "public", "private", "community", or "shared" |
| `osd_node_count` | number | no | 3 | Amount of OSD node(s) to provision |
| `public_network_dns` | list(string) | yes | | DNS to use for hosts |
| `sles_reg_code` | string | yes | | SUSE Enterprise registration code |
| `sles_reg_email` | string | yes | | email for use with SUSE registration |
| `sles_ses_reg` | string | yes | | code to register for the storage package in SUSE |
| `sles_rmt_host` | string | yes | | Host of a SUSE RMT server |
| `sles_rmt_fingerprint` | string | yes | | Fingerprint for SUSE RMT certificate |
| `osd_disk_sizes` | list(number) | no | \[8, 8\] | Amount/size of disks to add, in GB |
| `app_instance_count` | number | no | 0 | Additional instances to add for testing rgw, rbd, etc |
......@@ -29,9 +29,8 @@ resource "openstack_compute_instance_v2" "admin" {
user_data = templatefile("${path.module}/templates/cloud-init-admin.yml",
{
sles_reg_code = var.sles_reg_code
sles_reg_email = var.sles_reg_email
sles_ses_reg = var.sles_ses_reg
sles_rmt_host = var.sles_rmt_host
sles_rmt_fingerprint = var.sles_rmt_fingerprint
b64_json = base64encode(templatefile("${path.module}/templates/cluster.json", {
mon_bootstrap_ip = openstack_compute_instance_v2.mon[0].network[0].fixed_ip_v4
additional_hosts = openstack_compute_instance_v2.app.*.name
......@@ -80,9 +79,8 @@ resource "openstack_compute_instance_v2" "osd" {
user_data = templatefile("${path.module}/templates/cloud-init.yml",
{
sles_reg_code = var.sles_reg_code
sles_reg_email = var.sles_reg_email
sles_ses_reg = var.sles_ses_reg
sles_rmt_host = var.sles_rmt_host
sles_rmt_fingerprint = var.sles_rmt_fingerprint
})
block_device {
......@@ -132,9 +130,8 @@ resource "openstack_compute_instance_v2" "mon" {
user_data = templatefile("${path.module}/templates/cloud-init.yml",
{
sles_reg_code = var.sles_reg_code
sles_reg_email = var.sles_reg_email
sles_ses_reg = var.sles_ses_reg
sles_rmt_host = var.sles_rmt_host
sles_rmt_fingerprint = var.sles_rmt_fingerprint
})
block_device {
......@@ -172,9 +169,8 @@ resource "openstack_compute_instance_v2" "app" {
user_data = templatefile("${path.module}/templates/cloud-init.yml",
{
sles_reg_code = var.sles_reg_code
sles_reg_email = var.sles_reg_email
sles_ses_reg = var.sles_ses_reg
sles_rmt_host = var.sles_rmt_host
sles_rmt_fingerprint = var.sles_rmt_fingerprint
})
block_device {
......
......@@ -8,11 +8,13 @@ write_files:
owner: sles:users
runcmd:
- sudo SUSEConnect -r ${sles_reg_code} -e ${sles_reg_email}
- sudo SUSEConnect -p ses/7/x86_64 -r ${sles_ses_reg}
- curl ${sles_rmt_host}tools/rmt-client-setup --output /tmp/rmt-client-setup
- sudo sh /tmp/rmt-client-setup --fingerprint ${sles_rmt_fingerprint} --yes ${sles_rmt_host}
- sudo SUSEConnect -p ses/7/x86_64
- sudo zypper in -y salt-minion salt-master
- sudo sed -i 's/^#\(log_level_logfile:\).*/\1 info/' /etc/salt/minion
- sudo sed -i 's/^#\(master:\).*/\1 admin.openstack.internal/' /etc/salt/minion
- sudo systemctl enable salt-minion && sudo systemctl start salt-minion && sudo systemctl enable salt-master && sudo systemctl start salt-master
- sudo zypper in -y ceph-salt
- sudo systemctl restart salt-master.service
- sudo chown -R sles:users /home/sles/ # needed because the creation of cluster.json changes parent folder ownership to root:root
#cloud-config
runcmd:
- sudo SUSEConnect -r ${sles_reg_code} -e ${sles_reg_email}
- sudo SUSEConnect -p ses/7/x86_64 -r ${sles_ses_reg}
- curl ${sles_rmt_host}tools/rmt-client-setup --output /tmp/rmt-client-setup
- sudo sh /tmp/rmt-client-setup --fingerprint ${sles_rmt_fingerprint} --yes ${sles_rmt_host}
- sudo SUSEConnect -p ses/7/x86_64
- sudo zypper in -y salt-minion
- sudo sed -i 's/^#\(log_level_logfile:\).*/\1 info/' /etc/salt/minion
- sudo sed -i 's/^#\(master:\).*/\1 admin.openstack.internal/' /etc/salt/minion
......
......@@ -35,6 +35,5 @@ public_network_dns = ["8.8.8.8", "1.1.1.1"]
##
# suse registration details
sles_reg_code = "suse registration code"
sles_reg_email = "suse registration email"
sles_ses_reg = "suse storage extension registration code"
sles_rmt_host = "http://rmt.host.here.with.trailing.slash/"
sles_rmt_fingerprint = "AA:BB:CC:DD:EE:FF:GG:HH:II:JJ:KK:LL:MM:NN:OO:PP"
......@@ -55,19 +55,14 @@ variable "public_network_dns" {
description = "dns to use for hosts"
}
variable "sles_reg_code" {
variable "sles_rmt_host" {
type = string
description = "Code to register instance with SUSE connect"
description = "host for rmt server"
}
variable "sles_reg_email" {
variable "sles_rmt_fingerprint" {
type = string
description = "Email to use for SUSE registration"
}
variable "sles_ses_reg" {
type = string
description = "code to register for the storage package in SUSE"
description = "fingerprint for rmt server"
}
variable "osd_disk_sizes" {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment