-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
35 lines (30 loc) · 872 Bytes
/
main.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
# terraform {
# backend "consul" {
# path = "openshift/terraform_state"
# }
# }
# Configure the OpenStack Provider
provider "openstack" {
user_name = "${var.OS_USERNAME}"
tenant_name = "${var.OS_TENANT_NAME}"
password = "${var.OS_PASSWORD}"
auth_url = "${var.OS_AUTH_URL}"
insecure = "false"
}
resource "openstack_compute_keypair_v2" "ssh-keypair" {
name = "k8s-keypair"
public_key = "${file(var.public_key_file)}"
}
data "template_file" "setup_consul" {
template = "${file("files/setup_consul.sh")}"
vars {
join_server_ip = "${var.consul_join_ip}"
datacenter = "${var.consul_datacenter}"
encrypt_key = "${var.consul_encrypt_key}"
consul_download_url = "${var.consul_download_url}"
}
}
data "openstack_images_image_v2" "centos7" {
name = "CentOS 7"
most_recent = true
}