-
Notifications
You must be signed in to change notification settings - Fork 71
/
main.tf.azure.example
100 lines (74 loc) · 2.24 KB
/
main.tf.azure.example
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
locals {
name_prefix = "Tfs"
location = "francecentral"
key_file = "Private Key File"
public_key_location = "Public Key File"
}
provider "azurerm" {
features {}
}
module "base" {
source = "./modules/base"
cc_username = "*"
cc_password = "*"
name_prefix = local.name_prefix
// if you use name_prefix, make sure to update the server_configuration for clients/minions below
product_version = "uyuni-release"
provider_settings = {
location = local.location
ssh_allowed_ips = "*"
public_key_location = local.public_key_location
key_file = local.key_file
}
}
#================= Configuration with Mirror ================
# uncomment the following lines if you want to reuse an data disk snapshot
# data "azurerm_snapshot" "repodisk-snapshot" {
# name = "snapshot disk name"
# resource_group_name = "resource group for snapshot disk"
# }
// ================= END MIRROR =================
module "mirror" {
source = "./modules/mirror"
base_configuration = module.base.configuration
volume_provider_settings = {
# uncomment the following line if you want to reuse an data disk snapshot
# volume_snapshot = data.azurerm_snapshot.repodisk-snapshot
}
}
locals{
base_configuration = merge(module.base.configuration,
{
mirror = length(module.mirror.configuration["hostnames"]) > 0 ? module.mirror.configuration["hostnames"][0] : null
})
}
module "server" {
source = "./modules/server"
base_configuration = local.base_configuration
name = "server"
image = "suma41"
provider_settings = {
public_instance = true
vm_size = "Standard_B4ms"
os_disk_size = 100
}
}
module "minion" {
source = "./modules/minion"
base_configuration = local.base_configuration
name = "minion"
image = "opensuse154"
server_configuration = module.server.configuration
}
output "key_file" {
value = local.key_file
}
output "bastion_public_name" {
value = lookup(module.base.configuration, "bastion_host", null)
}
output "azure_server_private_name" {
value = module.server.configuration.hostname
}
output "azure_minion_private_names" {
value = module.minion.configuration.hostnames
}