aboutsummaryrefslogtreecommitdiff
path: root/personal_infra/puppet/site
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2023-01-15 20:17:35 +0100
committeralex <alex@pdp7.net>2023-01-15 20:17:35 +0100
commit93c2ebba504ba843bcb0341d306d4cdc930bd61b (patch)
treec239d560ff0d5070bbad078bcc7d73bd556dc5e3 /personal_infra/puppet/site
parent91b860b256948067bd60b472821f164e140dd97a (diff)
Do not keep everything in 00-common.pp
Diffstat (limited to 'personal_infra/puppet/site')
-rw-r--r--personal_infra/puppet/site/00-common.pp27
-rw-r--r--personal_infra/puppet/site/01-tinc.pp26
2 files changed, 26 insertions, 27 deletions
diff --git a/personal_infra/puppet/site/00-common.pp b/personal_infra/puppet/site/00-common.pp
index b542eb9e..080c7547 100644
--- a/personal_infra/puppet/site/00-common.pp
+++ b/personal_infra/puppet/site/00-common.pp
@@ -1,28 +1 @@
include automatic_updates
-
-$tinc_hosts = lookup("groups.tinc")
-$tinc_other_hosts = $tinc_hosts.filter |$host_name| { $host_name != $facts["networking"]["fqdn"] }
-
-$tinc_locations = Hash($tinc_hosts.map |$host_name| { [
- lookup("hostvars.'$host_name'.network.tinc.location"),
- {
- subnet => lookup("hostvars.'$host_name'.network.self_internal_network"),
- address => lookup("hostvars.'$host_name'.network.public_hostname"),
- }
-] })
-
-$tinc_connect_to = $tinc_other_hosts.map |$host_name| { lookup("hostvars.'$host_name'.network.tinc.location") }
-
-$tinc_other_networks = $tinc_other_hosts.map |$host_name| { lookup("hostvars.'$host_name'.network.self_internal_network") }
-
-if 'tinc' in lookup("group_names") {
- class {'tinc':
- tinc_name => lookup("tinc_global.name"),
- tinc_location => lookup("network.tinc.location"),
- tinc_connect_to => $tinc_connect_to,
- tinc_locations => $tinc_locations,
- tinc_ip => lookup("network.self_internal_ip"),
- tinc_netmask => lookup("network.self_internal_netmask"),
- tinc_other_networks => $tinc_other_networks,
- }
-}
diff --git a/personal_infra/puppet/site/01-tinc.pp b/personal_infra/puppet/site/01-tinc.pp
new file mode 100644
index 00000000..148e5988
--- /dev/null
+++ b/personal_infra/puppet/site/01-tinc.pp
@@ -0,0 +1,26 @@
+$tinc_hosts = lookup("groups.tinc")
+$tinc_other_hosts = $tinc_hosts.filter |$host_name| { $host_name != $facts["networking"]["fqdn"] }
+
+$tinc_locations = Hash($tinc_hosts.map |$host_name| { [
+ lookup("hostvars.'$host_name'.network.tinc.location"),
+ {
+ subnet => lookup("hostvars.'$host_name'.network.self_internal_network"),
+ address => lookup("hostvars.'$host_name'.network.public_hostname"),
+ }
+] })
+
+$tinc_connect_to = $tinc_other_hosts.map |$host_name| { lookup("hostvars.'$host_name'.network.tinc.location") }
+
+$tinc_other_networks = $tinc_other_hosts.map |$host_name| { lookup("hostvars.'$host_name'.network.self_internal_network") }
+
+if 'tinc' in lookup("group_names") {
+ class {'tinc':
+ tinc_name => lookup("tinc_global.name"),
+ tinc_location => lookup("network.tinc.location"),
+ tinc_connect_to => $tinc_connect_to,
+ tinc_locations => $tinc_locations,
+ tinc_ip => lookup("network.self_internal_ip"),
+ tinc_netmask => lookup("network.self_internal_netmask"),
+ tinc_other_networks => $tinc_other_networks,
+ }
+}