This repository has been archived by the owner on Jan 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.tf
158 lines (145 loc) · 5.19 KB
/
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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
## Coreos
# Run script to download and extract image file befor uploading to glance
resource "null_resource" "download-extract-image-flatcar-stable-amd64" {
count = var.enable_flatcar_current_stable_amd64_qcow2 || var.enable_flatcar_current_stable_amd64_raw ? 1:0
provisioner "local-exec" {
command = "${path.module}/flatcar_image.sh stable"
}
}
resource "openstack_images_image_v2" "flatcar_current_stable_amd64_qcow2" {
count = var.enable_flatcar_current_stable_amd64_qcow2 ? 1:0
name = "flatcar-current-stable-amd64-qcow2"
local_file_path = pathexpand("~/.terraform/image_cache/stable/flatcar_production_openstack_image.img")
container_format = "bare"
disk_format = "qcow2"
visibility = "public"
depends_on = [
null_resource.download-extract-image-flatcar-stable-amd64,
]
properties = {
os_distro = "coreos"
}
}
resource "openstack_images_image_v2" "flatcar_current_00_stable_amd64_raw" {
count = var.enable_flatcar_current_stable_amd64_raw ? 1:0
name = "flatcar-current-stable-amd64-raw"
local_file_path = pathexpand("~/.terraform/image_cache/stable/flatcar_production_openstack_image.raw")
container_format = "bare"
disk_format = "raw"
visibility = "public"
depends_on = [
null_resource.download-extract-image-flatcar-stable-amd64,
]
properties = {
os_distro = "coreos"
}
}
resource "null_resource" "download-extract-image-flatcar-alpha-amd64" {
count = var.enable_flatcar_current_alpha_amd64_qcow2 || var.enable_flatcar_current_alpha_amd64_raw ? 1:0
provisioner "local-exec" {
command = "${path.module}/flatcar_image.sh alpha"
}
}
resource "openstack_images_image_v2" "flatcar_current_alpha_amd64_qcow2" {
count = var.enable_flatcar_current_alpha_amd64_qcow2 ? 1:0
name = "flatcar-current-alpha-amd64-qcow2"
local_file_path = pathexpand("~/.terraform/image_cache/alpha/flatcar_production_openstack_image.img")
container_format = "bare"
disk_format = "qcow2"
visibility = "public"
depends_on = [
null_resource.download-extract-image-flatcar-alpha-amd64,
]
properties = {
os_distro = "coreos"
key = "value"
}
}
resource "openstack_images_image_v2" "flatcar_current_alpha_amd64_raw" {
count = var.enable_flatcar_current_alpha_amd64_raw ? 1:0
name = "flatcar-current-alpha-amd64-raw"
local_file_path = pathexpand("~/.terraform/image_cache/alpha/flatcar_production_openstack_image.raw")
container_format = "bare"
disk_format = "raw"
visibility = "public"
depends_on = [
null_resource.download-extract-image-flatcar-alpha-amd64,
]
properties = {
os_distro = "coreos"
key = "value"
}
}
resource "null_resource" "download-extract-image-flatcar-beta-amd64" {
count = var.enable_flatcar_current_beta_amd64_qcow2 || var.enable_flatcar_current_beta_amd64_raw ? 1:0
provisioner "local-exec" {
command = "${path.module}/flatcar_image.sh beta"
}
}
resource "openstack_images_image_v2" "flatcar_current_beta_amd64_qcow2" {
count = var.enable_flatcar_current_alpha_amd64_qcow2 ? 1:0
name = "flatcar-current-beta-amd64-qcow2"
local_file_path = pathexpand("~/.terraform/image_cache/beta/flatcar_production_openstack_image.img")
container_format = "bare"
disk_format = "qcow2"
visibility = "public"
depends_on = [
null_resource.download-extract-image-flatcar-beta-amd64,
]
properties = {
key = "value"
os_distro = "coreos"
}
}
resource "openstack_images_image_v2" "flatcar_current_beta_amd64_raw" {
count = var.enable_flatcar_current_alpha_amd64_raw ? 1:0
name = "flatcar-current-beta-amd64-raw"
local_file_path = pathexpand("~/.terraform/image_cache/beta/flatcar_production_openstack_image.raw")
container_format = "bare"
disk_format = "raw"
visibility = "public"
depends_on = [
null_resource.download-extract-image-flatcar-beta-amd64,
]
properties = {
key = "value"
os_distro = "coreos"
}
}
# https://alpha.release.flatcar-linux.net/arm64-usr/current/flatcar_production_openstack_image.img.bz2
resource "null_resource" "download-extract-image-flatcar-alpha-arm64" {
count = var.enable_flatcar_current_alpha_arm64_qcow2 || var.enable_flatcar_current_alpha_arm64_raw ? 1:0
provisioner "local-exec" {
command = "${path.module}/flatcar_arm64_image.sh alpha"
}
}
resource "openstack_images_image_v2" "flatcar_current_alpha_arm64_qcow2" {
count = var.enable_flatcar_current_alpha_arm64_qcow2 ? 1:0
name = "flatcar-current-alpha-arm64-qcow2"
local_file_path = pathexpand("~/.terraform/image_cache/alpha/flatcar_production_openstack_image.img")
container_format = "bare"
disk_format = "qcow2"
visibility = "public"
depends_on = [
null_resource.download-extract-image-flatcar-alpha-arm64,
]
properties = {
os_distro = "coreos"
key = "value"
}
}
resource "openstack_images_image_v2" "flatcar_current_alpha_arm64_raw" {
count = var.enable_flatcar_current_alpha_arm64_raw ? 1:0
name = "flatcar-current-alpha-arm64-raw"
local_file_path = pathexpand("~/.terraform/image_cache/alpha/flatcar_production_openstack_image.raw")
container_format = "bare"
disk_format = "raw"
visibility = "public"
depends_on = [
null_resource.download-extract-image-flatcar-alpha-arm64,
]
properties = {
os_distro = "coreos"
key = "value"
}
}