Browse Source

Use intersection of added vs deleted nodes instead of just deleted ones

There are cases when nailgun can send us data where there are nodes
included into list of added nodes and deleted ones. As a result, puppet
manifests failed with resource ensurance for present and absent hosts.
To avoid this situation, subtract added nodes from deleted prior to
actually deleting them from hosts.

Change-Id: I515f7fae4bbe67123d70572a4f861e879ec580f6
Closes-Bug: #1679522
Stanislaw Bogatkin 2 years ago
parent
commit
21c7651fe5
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      deployment/puppet/osnailyfacter/manifests/hosts/hosts.pp

+ 1
- 1
deployment/puppet/osnailyfacter/manifests/hosts/hosts.pp View File

@@ -8,7 +8,7 @@ class osnailyfacter::hosts::hosts {
8 8
   $host_resources = network_metadata_to_hosts($network_metadata)
9 9
   $messaging_host_resources = network_metadata_to_hosts($network_metadata, 'mgmt/messaging', $messaging_prefix)
10 10
 
11
-  $deleted_nodes = hiera('deleted_nodes', [])
11
+  $deleted_nodes = difference(hiera('deleted_nodes', []), keys($host_resources))
12 12
   $deleted_messaging_nodes = prefix($deleted_nodes, $messaging_prefix)
13 13
 
14 14
   Host {

Loading…
Cancel
Save