-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathignition.tf
67 lines (56 loc) · 1.58 KB
/
ignition.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Configure the Packet Provider
provider "packet" {
auth_token = "${var.packet_api_key}"
}
# Create a new SSH key
resource "packet_ssh_key" "ignitionkey" {
name = "ignitionkey"
public_key = "${file("${var.ssh_private_key}.pub")}"
}
# Create a project
resource "packet_project" "ignition" {
name = "Ignition"
}
# Create a device and add it to ignition
resource "packet_device" "ignition" {
hostname = "${var.hostname}"
plan = "${var.packet_machine_type}"
facility = "${var.packet_location}"
operating_system = "ubuntu_16_04_image"
billing_cycle = "hourly"
project_id = "${packet_project.ignition.id}"
connection {
type = "ssh"
user = "root"
port = 22
timeout = "1200"
private_key = "${file("${var.ssh_private_key}")}"
}
# Copies the provison folder to /root/provison
provisioner "file" {
source = "env.yaml"
destination = "/root/env.yaml"
}
# Copies the provison folder to /root/provison
provisioner "file" {
source = "./provision"
destination = "/root"
}
provisioner "remote-exec" {
inline = [
"cd provision && sh launch.sh"
]
}
}
output "Fuel" {
value = "https://${packet_device.ignition.network.0.address}.xip.io:8443"
}
output "Horizon" {
value = "https://${packet_device.ignition.network.0.address}.xip.io"
}
output "User" {
value = "admin"
}
output "Password" {
value = "Password is defined in the file env.yaml"
}