Adjust order of entries in /etc/hosts
Order of all entries will be fqdn before prefix-fqdn.
Change-Id: Ia203c457e76cc45b70532674f6366928acc09b48
Closes-bug: #1624143
(cherry picked from commit 9382a3eb5f
)
This commit is contained in:
parent
eafc500d13
commit
c8444e799b
|
@ -7,7 +7,6 @@ class osnailyfacter::hosts::hosts {
|
|||
$messaging_prefix = hiera('node_name_prefix_for_messaging')
|
||||
$host_resources = network_metadata_to_hosts($network_metadata)
|
||||
$messaging_host_resources = network_metadata_to_hosts($network_metadata, 'mgmt/messaging', $messaging_prefix)
|
||||
$host_hash = merge($host_resources, $messaging_host_resources)
|
||||
|
||||
$deleted_nodes = hiera('deleted_nodes', [])
|
||||
$deleted_messaging_nodes = prefix($deleted_nodes, $messaging_prefix)
|
||||
|
@ -16,8 +15,14 @@ class osnailyfacter::hosts::hosts {
|
|||
target => $hosts_file
|
||||
}
|
||||
|
||||
create_resources(host, $host_hash)
|
||||
# Bug LP1624143 : hosts should be consistently ordered
|
||||
create_resources(host, $host_resources, { tag => 'host_resources' } )
|
||||
create_resources(host, $messaging_host_resources, { tag => 'messaging_host_resources' } )
|
||||
|
||||
Host<| tag == 'host_resources' |> -> Host<| tag == 'messaging_host_resources' |>
|
||||
|
||||
if !empty($deleted_nodes) {
|
||||
ensure_resource(host, unique(concat($deleted_nodes, $deleted_messaging_nodes)), {ensure => absent})
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue