Skip to content

Commit 18c8cb4

Browse files
removed reference to gluster 3.12 repository
1 parent 0a79b9b commit 18c8cb4

File tree

19 files changed

+194
-71
lines changed

19 files changed

+194
-71
lines changed

compute.tf

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,28 @@ module "storage" {
6666
cluster_name = "${local.cluster_name}" // optional. default: cluster
6767
public_ip = false // optional. default: true
6868

69-
}
69+
}
70+
71+
module "gpu" {
72+
73+
source = "modules/instance"
74+
75+
compartment_ocid = "${var.compartment_ocid}"
76+
instances = "${var.gpu_count}" // required. can be 0
77+
subnet_id = "${module.network.private-subnet-1-id}" // required
78+
ad = "${var.ad}" // required
79+
name = "${local.gpu_name}" // required
80+
ssh_key = "${tls_private_key.key.public_key_openssh}" // required
81+
shape = "${var.gpu_shape}" // required
82+
source_id = "${lookup(var.gpu_image, var.region)}" // required
83+
84+
// Optional parameters
85+
86+
bootstrap = "${data.template_file.gpu_template.rendered}"
87+
volumes = "${var.gpu_volumes}" // optional. default: 0
88+
volume_size = "${var.gpu_volume_size}" // optional. default: 50
89+
source_type = "image" // optional. default: image
90+
cluster_name = "${local.cluster_name}" // optional. default: cluster
91+
public_ip = false // optional. default: true
92+
93+
}

conf/gpu.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#cloud-config
2+
write_files:
3+
- encoding: b64
4+
content: ICAgICAgYC0vKysrKysrKysrKysrKysrKysvLS5gCiAgIGAvc3l5eXl5eXl5eXl5eXl5eXl5eXl5eXl5cy8uCiAgOnl5eXlvLy0uLi4uLi4uLi4uLi4uLi4tL295eXl5LwogL3l5eXMtICAgICAgICAgICAgICAgICAgICAgLm95eXkrCi55eXl5YCAgICAgICAgICAgICAgICAgICAgICAgYHN5eXktCjp5eXlvICAgICAgICAgICAgICAgICAgICAgICAgIC95eXkvIE9yYWNsZSBDbG91ZCBIUEMgY2x1c3RlciBkZW1vCi55eXl5YCAgICAgICAgICAgICAgICAgICAgICAgYHN5eXktIGh0dHBzOi8vZ2l0aHViLmNvbS9vY2ktaHBjL29jaS1ocGMtdGVycmFmb3JtLWFyY2gKIC95eXlzLiAgICAgICAgICAgICAgICAgICAgIC5veXl5byAgCiAgL3l5eXlvOi0uLi4uLi4uLi4uLi4uLi4tOm95eXl5L2AKICAgYC9zeXl5eXl5eXl5eXl5eXl5eXl5eXl5eXlzKy4KICAgICBgLjovK29vb29vb29vb29vb29vbysvOi5gCg==
5+
path: /etc/motd
6+
runcmd:
7+
- curl -L https://bootstrap.saltstack.com -o install_salt.sh
8+
- sudo sh install_salt.sh -A ${master_address} -j '{"autosign_grains":["server_id"],"conf_file":"/etc/salt/minion","default_include":"minion.d/*.conf","file_roots":{"base":["/srv/salt/"]},"grains":{"roles":${role}},"pillar_roots":{"base":["/srv/pillar"]},"pki_dir":"/etc/salt/pki/minion","beacons":{"status":[{"interval":600}]}}' git v2018.3.4

conf/salt.zip

13.7 KB
Binary file not shown.

constants.tf

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ variable "region" {}
66
variable "compartment_ocid" {}
77

88
locals {
9-
storage_name = "storage"
10-
headnode_role = ["master"]
11-
headnode_name = "headnode"
12-
compute_role = ["compute"]
13-
compute_name = "compute"
14-
fss_share_name = "share"
15-
storage_role = ["storage"]
9+
storage_name = "storage"
10+
storage_role = ["storage"]
11+
headnode_name = "headnode"
12+
headnode_role = ["master"]
13+
compute_name = "compute"
14+
compute_role = ["compute"]
15+
gpu_name = "gpu"
16+
gpu_role = ["gpu"]
17+
fss_share_name = "share"
1618
}
1719

1820
provider "oci" {

data.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ data "template_file" "storage_template" {
5656
role = "${jsonencode(concat(local.storage_role, var.additional_storage_roles, var.additional_role_all))}" }
5757
}
5858

59+
data "template_file" "gpu_template" {
60+
template = "${file("${path.module}/conf/gpu.tpl")}"
61+
vars {
62+
master_address = "${local.master_address}"
63+
role = "${jsonencode(concat(local.gpu_role, var.additional_gpu_roles, var.additional_role_all))}" }
64+
}
65+
66+
5967
resource "random_pet" "server" {
6068
length = 2
6169
separator = ""

fss.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ module "fss" {
66
ad = "${var.ad}"
77
cluster_name = "${local.cluster_name}"
88
share_name = "${local.fss_share_name}"
9-
}
9+
}

network.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module "network" {
2-
source = "modules/network"
2+
source = "modules/network"
33
compartment_ocid = "${var.compartment_ocid}"
4-
cidr_block = "${var.network_cidr}"
4+
cidr_block = "${var.network_cidr}"
55
cluster_name = "${local.cluster_name}" // optional. default: cluster
6-
}
6+
}

salt/_grains/oci_metadata.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@ def main():
1414
grains['oci_vnics'] = json.loads(requests.get(_metadata_url + 'vnics').text)
1515
except Exception:
1616
pass
17+
try:
18+
grains['identity'] = json.loads(requests.get(_metadata_url + 'identity').text)
19+
except Exception:
20+
pass
1721

1822
return grains

salt/salt/_modules/wpa_cert.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!py
2+
from OpenSSL import crypto
3+
import base64
4+
5+
def generate_pfx():
6+
7+
if __grains__['identity'] != None:
8+
identity = __grains__['identity']
9+
intermediate = crypto.load_certificate(crypto.FILETYPE_PEM, identity['intermediate.pem'])
10+
cert = crypto.load_certificate(crypto.FILETYPE_PEM, identity['cert.pem'])
11+
key = crypto.load_privatekey(crypto.FILETYPE_PEM, identity['key.pem'], "hic sunt leones")
12+
13+
cacerts = []
14+
cacerts.append(intermediate)
15+
16+
PKCS12 = crypto.PKCS12Type()
17+
PKCS12.set_ca_certificates(cacerts)
18+
PKCS12.set_certificate(cert)
19+
PKCS12.set_privatekey(key)
20+
21+
with open('/etc/wpa_supplicant/certs_bundle.pfx', "w") as f:
22+
f.write(PKCS12.export(passphrase="hic sunt leones"))
23+
return True
24+
else:
25+
return False
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
cert_schedule:
2+
schedule.present:
3+
- function: state.sls
4+
- job_args:
5+
- hpc.cluster.configuration.8021x_cert
6+
- seconds: 3600
7+
- splay: 10
8+
9+
wpa_cert.generate_pfx:
10+
module.run
11+
12+
wpa_supplicant:
13+
service:
14+
- running
15+
- watch:
16+
- module: wpa_cert.generate_pfx

0 commit comments

Comments
 (0)