Browse Source

Conditionalize rndc changes

The changes to allow configuration of more rndc options had a
cross-repo dependency on the tripleo-heat-templates changes that
made use of the new options.  Unfortunately, the puppet changes
landed first and are now broken because necessary inputs are not
being provided.  This change conditionalizes the new configurations
so that if the parameters aren't passed we won't attempt to do
invalid configuration.

Closes-Bug: #1788907
Change-Id: Ia82f1c6be0d5504498e77a90268cad8abecdeae2
(cherry picked from commit 3add939d4c)
tags/9.4.0
Ben Nemec 1 year ago
parent
commit
0134f91b94
2 changed files with 18 additions and 12 deletions
  1. 12
    8
      manifests/profile/base/designate.pp
  2. 6
    4
      manifests/profile/base/designate/worker.pp

+ 12
- 8
manifests/profile/base/designate.pp View File

@@ -126,14 +126,18 @@ class tripleo::profile::base::designate (
126 126
         'ssl'       => $oslomsg_notify_use_ssl_real,
127 127
       }),
128 128
     }
129
-    class { '::designate::backend::bind9':
130
-      rndc_controls => {
131
-        $rndc_host => {
132
-          'port'              => $rndc_port,
133
-          'keys'              => $rndc_keys,
134
-          'allowed_addresses' => $rndc_allowed_addresses,
135
-        }
136
-      },
129
+    if ($rndc_host and $rndc_allowed_addresses) {
130
+      class { '::designate::backend::bind9':
131
+        rndc_controls => {
132
+          $rndc_host => {
133
+            'port'              => $rndc_port,
134
+            'keys'              => $rndc_keys,
135
+            'allowed_addresses' => $rndc_allowed_addresses,
136
+          }
137
+        },
138
+      }
139
+    } else {
140
+      include ::designate::backend::bind9
137 141
     }
138 142
     include ::designate::config
139 143
   }

+ 6
- 4
manifests/profile/base/designate/worker.pp View File

@@ -29,14 +29,16 @@
29 29
 #
30 30
 class tripleo::profile::base::designate::worker (
31 31
   $step = Integer(hiera('step')),
32
-  $rndc_key = hiera('designate_rndc_key'),
32
+  $rndc_key = hiera('designate_rndc_key', false),
33 33
 ) {
34 34
   include ::tripleo::profile::base::designate
35 35
 
36 36
   if $step >= 4 {
37
-    file { 'designate rndc key':
38
-      path    => '/etc/rndc.key',
39
-      content => template('tripleo/designate/rndc.key.erb')
37
+    if $rndc_key {
38
+      file { 'designate rndc key':
39
+        path    => '/etc/rndc.key',
40
+        content => template('tripleo/designate/rndc.key.erb')
41
+      }
40 42
     }
41 43
     include ::designate::worker
42 44
   }

Loading…
Cancel
Save