Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
b7af3527
Verified
Commit
b7af3527
authored
Dec 27, 2020
by
Frederik Schwan
Browse files
move handling of machines into variables
parent
053fa0fc
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
tf-stage1/archlinux.tf
View file @
b7af3527
This diff is collapsed.
Click to expand it.
tf-stage1/templates.tf
0 → 100644
View file @
b7af3527
# This files contains template handling for the main archlinux.tf file
resource
"hetznerdns_record"
"archlinux_org_gitlab_pages_cname"
{
for_each
=
{
for
p
in
var
.
archlinux_org_gitlab_pages
:
p
.
name
=
>
p
}
zone_id
=
hetznerdns_zone
.
archlinux
.
id
name
=
each
.
value
.
name
value
=
"pages.archlinux.org."
type
=
"CNAME"
}
resource
"hetznerdns_record"
"archlinux_org_gitlab_pages_verification_code_txt"
{
for_each
=
{
for
p
in
var
.
archlinux_org_gitlab_pages
:
p
.
name
=
>
p
}
zone_id
=
hetznerdns_zone
.
archlinux
.
id
name
=
"_gitlab-pages-verification-code.
${
each
.
value
.
name
}
"
value
=
"gitlab-pages-verification-code=
${
each
.
value
.
verification_code
}
"
type
=
"TXT"
}
resource
"hetznerdns_record"
"pkgbuild_org_a"
{
for_each
=
local
.
pkgbuild_com_a_aaaa
zone_id
=
hetznerdns_zone
.
pkgbuild
.
id
name
=
each
.
key
ttl
=
lookup
(
local
.
pkgbuild_com_a_aaaa
[
each
.
key
],
"ttl"
,
null
)
value
=
each
.
value
.
ipv4_address
type
=
"A"
}
resource
"hetznerdns_record"
"pkgbuild_org_aaaa"
{
for_each
=
local
.
pkgbuild_com_a_aaaa
zone_id
=
hetznerdns_zone
.
pkgbuild
.
id
name
=
each
.
key
ttl
=
lookup
(
local
.
pkgbuild_com_a_aaaa
[
each
.
key
],
"ttl"
,
null
)
value
=
each
.
value
.
ipv6_address
type
=
"AAAA"
}
resource
"hetznerdns_record"
"archlinux_org_a"
{
for_each
=
local
.
archlinux_org_a_aaaa
zone_id
=
hetznerdns_zone
.
archlinux
.
id
name
=
each
.
key
ttl
=
lookup
(
local
.
archlinux_org_a_aaaa
[
each
.
key
],
"ttl"
,
null
)
value
=
each
.
value
.
ipv4_address
type
=
"A"
}
resource
"hetznerdns_record"
"archlinux_org_aaaa"
{
for_each
=
local
.
archlinux_org_a_aaaa
zone_id
=
hetznerdns_zone
.
archlinux
.
id
name
=
each
.
key
ttl
=
lookup
(
local
.
archlinux_org_a_aaaa
[
each
.
key
],
"ttl"
,
null
)
value
=
each
.
value
.
ipv6_address
type
=
"AAAA"
}
resource
"hetznerdns_record"
"archlinux_org_cname"
{
for_each
=
var
.
archlinux_org_cname
zone_id
=
hetznerdns_zone
.
archlinux
.
id
name
=
each
.
key
ttl
=
lookup
(
var
.
archlinux_org_cname
[
each
.
key
],
"ttl"
,
null
)
value
=
each
.
value
.
value
type
=
"CNAME"
}
resource
"hcloud_rdns"
"rdns_ipv4"
{
for_each
=
local
.
machines
server_id
=
hcloud_server
.
machine
[
each
.
key
].
id
ip_address
=
hcloud_server
.
machine
[
each
.
key
].
ipv4_address
dns_ptr
=
each
.
key
}
resource
"hcloud_rdns"
"rdns_ipv6"
{
for_each
=
local
.
machines
server_id
=
hcloud_server
.
machine
[
each
.
key
].
id
ip_address
=
hcloud_server
.
machine
[
each
.
key
].
ipv6_address
dns_ptr
=
each
.
key
}
resource
"hcloud_server"
"machine"
{
for_each
=
local
.
machines
name
=
each
.
value
.
domain
image
=
data
.
hcloud_image
.
archlinux
.
id
server_type
=
each
.
value
.
server_type
lifecycle
{
ignore_changes
=
[
image
]
}
}
resource
"hetznerdns_record"
"machine_a"
{
for_each
=
local
.
machines
zone_id
=
lookup
(
local
.
machines
[
each
.
key
],
"zone"
,
hetznerdns_zone
.
archlinux
.
id
)
name
=
each
.
value
.
domain
ttl
=
lookup
(
local
.
machines
[
each
.
key
],
"ttl"
,
null
)
value
=
hcloud_server
.
machine
[
each
.
key
].
ipv4_address
type
=
"A"
}
resource
"hetznerdns_record"
"machine_aaaa"
{
for_each
=
local
.
machines
zone_id
=
lookup
(
local
.
machines
[
each
.
key
],
"zone"
,
hetznerdns_zone
.
archlinux
.
id
)
name
=
each
.
value
.
domain
ttl
=
lookup
(
local
.
machines
[
each
.
key
],
"ttl"
,
null
)
value
=
hcloud_server
.
machine
[
each
.
key
].
ipv6_address
type
=
"AAAA"
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment