forked from SUSE/susemanager-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaws_mirror.tf
169 lines (137 loc) · 3.22 KB
/
aws_mirror.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
159
160
161
162
163
164
165
166
167
168
169
// Mandatory variables for terracumber
variable "URL_PREFIX" {
type = string
default = "https://ci.suse.de/view/Manager/view/Manager-4.3/job/SUSEManager-4.3-AWS"
}
// Not really used as this is for --runall parameter, and we run cucumber step by step
variable "CUCUMBER_COMMAND" {
type = string
default = "export PRODUCT='SUSE-Manager' && run-testsuite"
}
variable "CUCUMBER_GITREPO" {
type = string
default = "https://github.com/SUSE/spacewalk.git"
}
variable "CUCUMBER_BRANCH" {
type = string
default = "Manager-4.3"
}
variable "CUCUMBER_RESULTS" {
type = string
default = "/root/spacewalk/testsuite"
}
variable "MAIL_SUBJECT" {
type = string
default = "Results Manager4.3-Master-MU $status: $tests scenarios ($failures failed, $errors errors, $skipped skipped, $passed passed)"
}
variable "MAIL_TEMPLATE" {
type = string
default = "../mail_templates/mail-template-jenkins.txt"
}
variable "MAIL_SUBJECT_ENV_FAIL" {
type = string
default = "Results Uyuni-Master: Environment setup failed"
}
variable "MAIL_TEMPLATE_ENV_FAIL" {
type = string
default = "../mail_templates/mail-template-jenkins-env-fail.txt"
}
variable "MAIL_FROM" {
type = string
default = "[email protected]"
}
variable "MAIL_TO" {
type = string
default = "[email protected]"
}
// sumaform specific variables
variable "SCC_USER" {
type = string
}
variable "SCC_PASSWORD" {
type = string
}
variable "GIT_USER" {
type = string
default = null
// Not needed for master, as it is public
}
variable "GIT_PASSWORD" {
type = string
default = null
// Not needed for master, as it is public
}
variable "REGION" {
type = string
default = null
}
variable "AVAILABILITY_ZONE" {
type = string
default = null
}
variable "KEY_FILE" {
type = string
default = "/home/jenkins/.ssh/testing-suma.pem"
}
variable "KEY_NAME" {
type = string
default = "testing-suma"
}
variable "ALLOWED_IPS" {
type = list(string)
default = []
}
variable "SERVER_REGISTRATION_CODE" {
type = string
default = null
}
variable "PROXY_REGISTRATION_CODE" {
type = string
default = null
}
variable "NAME_PREFIX" {
type = string
default = "aws-mirror"
}
locals {
domain = "suma.ci.aws"
}
provider "aws" {
region = var.REGION
}
module "base" {
source = "./modules/base"
cc_username = var.SCC_USER
cc_password = var.SCC_PASSWORD
name_prefix = var.NAME_PREFIX
testsuite = true
use_avahi = false
use_eip_bastion = false
provider_settings = {
availability_zone = var.AVAILABILITY_ZONE
region = var.REGION
ssh_allowed_ips = var.ALLOWED_IPS
key_name = var.KEY_NAME
key_file = var.KEY_FILE
route53_domain = local.domain
bastion_host = "${var.NAME_PREFIX}-bastion.${local.domain}"
}
}
module "mirror" {
source = "./modules/mirror"
base_configuration = module.base.configuration
disable_cron = true
provider_settings = {
public_instance = true
}
image = "opensuse155o"
}
output "bastion_public_name" {
value = lookup(module.base.configuration, "bastion_host", null)
}
output "aws_mirrors_private_name" {
value = module.mirror.configuration.hostnames
}
output "aws_mirrors_public_name" {
value = module.mirror.configuration.public_names
}