include static_master class using hiera
authorPeter Palfrader <peter@palfrader.org>
Wed, 11 Sep 2019 08:45:15 +0000 (10:45 +0200)
committerPeter Palfrader <peter@palfrader.org>
Wed, 11 Sep 2019 08:45:15 +0000 (10:45 +0200)
hieradata/common.yaml
hieradata/nodes/dillon.debian.org.yaml
hieradata/nodes/fasolo.debian.org.yaml
hieradata/nodes/manziarly.debian.org.yaml [new file with mode: 0644]
hieradata/nodes/porta.debian.org.yaml [new file with mode: 0644]
hieradata/nodes/static-master-grnet-01.debian.org.yaml [new file with mode: 0644]
modules/roles/manifests/init.pp
modules/samhain/templates/samhainrc.erb
modules/tcp_bbr/manifests/init.pp

index d701810..5bcf861 100644 (file)
@@ -176,12 +176,6 @@ roles:
     - ticharich.debian.org
     - wilder.debian.org
     - wuiet.debian.org
-  static_master:
-    - dillon.debian.org
-    - fasolo.debian.org
-    - manziarly.debian.org
-    - porta.debian.org
-    - static-master-grnet-01.debian.org
   static_mirror:
     - klecker.debian.org
     - mirror-anu.debian.org
index 830ac9d..9801d22 100644 (file)
@@ -1,2 +1,3 @@
 classes:
   - roles::dsa_wiki_buildhost
+  - roles::static_master
index ebfdc3e..63ec7b2 100644 (file)
@@ -1,2 +1,3 @@
 classes:
-        - profile::ipsec::fasolo_storace
+  - profile::ipsec::fasolo_storace
+  - roles::static_master
diff --git a/hieradata/nodes/manziarly.debian.org.yaml b/hieradata/nodes/manziarly.debian.org.yaml
new file mode 100644 (file)
index 0000000..e8342a0
--- /dev/null
@@ -0,0 +1,2 @@
+classes:
+  - roles::static_master
diff --git a/hieradata/nodes/porta.debian.org.yaml b/hieradata/nodes/porta.debian.org.yaml
new file mode 100644 (file)
index 0000000..e8342a0
--- /dev/null
@@ -0,0 +1,2 @@
+classes:
+  - roles::static_master
diff --git a/hieradata/nodes/static-master-grnet-01.debian.org.yaml b/hieradata/nodes/static-master-grnet-01.debian.org.yaml
new file mode 100644 (file)
index 0000000..e8342a0
--- /dev/null
@@ -0,0 +1,2 @@
+classes:
+  - roles::static_master
index 3960f1e..dc1dee0 100644 (file)
@@ -116,10 +116,6 @@ class roles {
                include roles::syncproxy
        }
 
-       if has_role('static_master') {
-               include roles::static_master
-       }
-
        if has_role('static_mirror') {
                include roles::static_mirror
        } elsif has_role('static_source') {
index e72f5d4..f6829e6 100644 (file)
@@ -185,7 +185,7 @@ file=/etc/rc.local
 file=/etc/unbound
 file=/etc/dsa
 file=/etc/rabbitmq
-<% if scope.function_has_role(['static_mirror']) or scope.function_has_role(['static_source']) or scope.function_has_role(['static_master']) -%>
+<% if scope.function_has_role(['static_mirror']) or scope.function_has_role(['static_source']) or classes.include?("roles::static_master")  -%>
 file=/etc/ssh/userkeys
 file=/etc/ssh/userkeys/staticsync
 <% end -%>
index ab35b35..90b0e53 100644 (file)
@@ -24,7 +24,7 @@ class tcp_bbr {
                   has_role('security_mirror') or
                   has_role('security_upload') or
                   has_role('ssh.upload.d.o') or
-                  has_role('static_master') or
+                  defined(Class["roles::static_master"]) or
                   has_role('static_mirror') or
                   has_role('static_source') or
                   has_role('syncproxy') or