Commit 44bbd751 authored by Chris King's avatar Chris King
Browse files

Render cluster.json to admin instance

* Add cluster.json template
* Add file provisioner to floating ip attachment to place cluster.json
  file onto admin node
parent 8c561b99
......@@ -3,6 +3,12 @@
* Install [terraform](https://www.terraform.io/downloads.html) 1.0 or greater
* Configure some application credentials in the [RC Openstack dashboard](https://dashboard.cloud.rc.uab.edu/identity/application_credentials/)
* Add a key pair (in the [Key Pairs](https://dashboard.cloud.rc.uab.edu/project/key_pairs) section)
* Add your private key to an ssh-agent session:
```bash
eval $(ssh-agent)
ssh-add ~/path/to/private/key
```
# Quickstart
......
......@@ -12,7 +12,7 @@ data "openstack_compute_flavor_v2" "m1_small" {
# template file cloud-init.yml
#
data "template_file" "cloud_init_admin_yml" {
template = file("${path.module}/templates/cloud-init-admin.yml")
vars = {
......@@ -31,6 +31,15 @@ data "template_file" "cloud_init_yml" {
}
}
# template file for cluster.json
data "template_file" "cluster_json" {
template = file("${path.module}/templates/cluster.json")
vars = {
mon_bootstrap_ip = openstack_compute_instance_v2.mon[0].network[0].fixed_ip_v4
}
}
# admin node
resource "openstack_compute_instance_v2" "admin" {
......@@ -57,11 +66,23 @@ resource "openstack_compute_instance_v2" "admin" {
network {
uuid = openstack_networking_network_v2.public_network.id
}
}
resource "openstack_compute_floatingip_associate_v2" "admin_association" {
floating_ip = openstack_compute_floatingip_v2.floating_ip.address
instance_id = openstack_compute_instance_v2.admin.id
provisioner "file" {
content = data.template_file.cluster_json.rendered
destination = "/home/sles/cluster.json"
connection {
type = "ssh"
user = "sles"
host = openstack_compute_floatingip_v2.floating_ip.address
}
}
}
# OSD nodes
......
{
"bootstrap_ceph_conf": {
"global": {
"cluster_network": "10.0.100.0/24"
}
},
"bootstrap_minion": "mon01",
"bootstrap_mon_ip": "${mon_bootstrap_ip}",
"container": {
"images": {
"ceph": "registry.suse.com/ses/7/ceph/ceph"
},
"registries_enabled": true
},
"dashboard": {
"password": "admin",
"password_update_required": false,
"username": "admin"
},
"minions": {
"admin": [
"admin"
],
"all": [
"mon01",
"osd02",
"mds01",
"osd01",
"osd03",
"admin"
],
"cephadm": [
"mon01",
"osd02",
"mds01",
"osd01",
"osd03",
"admin"
],
"latency": [],
"throughput": []
},
"ssh": {
"private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAmubZLzWK34JgVdarIYka65HxCS7W1MbviyVu9eIT4Oy3Crdj\nBWv/J10Rit/BMl4qS/fZoZ94HS+E9OIcH1mZoZnyKkwmJcQaNYyyQ3wV8gcBkbD2\ngznLr9GkDW2W39xdCd1wos0GkYxFlDnrnJsGM0F4Pntx1y6AbRz5wZhWx4sYN8gE\neu/Sje+vDz4GVCmSxud33eg7bGqIA3B6Bqa6A4Ynmnzt2UrXRfzKaUd2OkI0KRvF\nOpNfviH5qqEFJaY/kZKdxEEF3nPAJGDxIdRN7V+HYvdPfRHQ0AJ7mCCPf/lRhJFz\nCuZgSUn+8T9RDNs9N1qmAv2g1U2PFALl44bGGQIDAQABAoIBAAGUfj2liaua/FmT\nzX4TlHM3s2I5GJbmCpZ8RMP8UOCX+YwB7+AjyGAB6oZknudhH4RT3GPyKPr/O5d1\n4PyO4OrNk7NLwI3dELlgHIdksiKcYK84Q2N2SPYbqNU8O3BAIrDRke8PMVR1vlXz\nO0yHJkqKjevxPWmI/2VdiMypPaVeaUoqqBI5ZJBs2KWoms4QpW2M+gl3i9vps79G\nNBF2ekBlTSKmXKKf8GHIQXsRgXGcKm6xo2VL+vZaMedDddZvKvH/57EWD8ncOllV\nzbf841Oaur1jXi3FtYNc4XOzJNTL+Nkf/Db+JJK7PiAPzHlhlx+qVsojTfEzjWWa\nmBiVgUsCgYEAw83XRsKt9QsyDfZbv8qbrMwkZB4b7TMHI9gZRBD7+vyI0XOdaUW+\n2RFDlHjAf9fLn5Swnx7B24LpdNvjHT31HJeCOkTfI93m3G11gk7iQ3a2t/P7Egpv\nlFKDFlAiBiJ24j3a+1+JUOeVwhUHFimAKojq0zELELY5b8WH9M7pQR8Cg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EkXMK5mBJSf7xP1EM2z03WqYC/aDVTY8UAuXjhsYZ"
},
"time_server": {
"enabled": true,
"server_hosts": [
"pool.ntp.org"
]
}
}
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