Browse Source

Stop using puppet to configure VIPs in /etc/hosts

This patch drops use of the vip-hosts.yaml service which can
cause issues during deployment because puppet 'hosts' resources
overwrite the data in /etc/hosts. The only reason things seem to work
at all at the moment is because our hosts element in t-i-e runs
on each os-refresh-config iteration and re-adds the dropped hosts
entries.

To work around the issue we add a conditional which selectively
adds the extra hosts entries only if the AddVipsToEtcHosts is set
to true.

Closes-bug: 1645123

Change-Id: Ic6aaeb249a127df83894f32a704219683a6382b2
changes/48/403448/1
Dan Prince 5 years ago
parent
commit
933f1afefd
  1. 3
      environments/hyperconverged-ceph.yaml
  2. 4
      environments/use-dns-for-vips.yaml
  3. 7
      hosts-config.yaml
  4. 1
      overcloud-resource-registry-puppet.j2.yaml
  5. 77
      overcloud.j2.yaml
  6. 56
      puppet/services/vip-hosts.yaml
  7. 5
      roles_data.yaml

3
environments/hyperconverged-ceph.yaml

@ -25,5 +25,4 @@ parameter_defaults:
- OS::TripleO::Services::OpenDaylightOvs
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::FluentdClient
- OS::TripleO::Services::VipHosts
- OS::TripleO::Services::CephOSD
- OS::TripleO::Services::CephOSD

4
environments/use-dns-for-vips.yaml

@ -1,5 +1,5 @@
# A Heat environment file which can be used to disable the writing of the VIPs
# to the /etc/hosts file in the overcloud. Use this in case you have a working
# DNS server that you will provide for the overcloud.
resource_registry:
OS::TripleO::Services::VipHosts: OS::Heat::None
parameter_defaults:
AddVipsToEtcHosts: False

7
hosts-config.yaml

@ -3,7 +3,7 @@ description: 'All Hosts Config'
parameters:
hosts:
type: comma_delimited_list
type: string
resources:
@ -12,10 +12,7 @@ resources:
properties:
group: os-apply-config
config:
hosts:
list_join:
- "\n"
- {get_param: hosts}
hosts: {get_param: hosts}
outputs:
config_id:

1
overcloud-resource-registry-puppet.j2.yaml

@ -181,7 +181,6 @@ resource_registry:
OS::TripleO::Services::GnocchiApi: puppet/services/gnocchi-api.yaml
OS::TripleO::Services::GnocchiMetricd: puppet/services/gnocchi-metricd.yaml
OS::TripleO::Services::GnocchiStatsd: puppet/services/gnocchi-statsd.yaml
OS::TripleO::Services::VipHosts: puppet/services/vip-hosts.yaml
# Services that are disabled by default (use relevant environment files):
OS::TripleO::Services::FluentdClient: OS::Heat::None
OS::TripleO::LoggingConfiguration: puppet/services/logging/fluentd-config.yaml

77
overcloud.j2.yaml

@ -170,9 +170,50 @@ parameters:
description: >
Setting this to a unique value will re-run any deployment tasks which
perform configuration on a Heat stack-update.
AddVipsToEtcHosts:
default: True
type: boolean
description: >
Set to true to append per network Vips to /etc/hosts on each node.
conditions:
add_vips_to_etc_hosts: {equals : [{get_param: AddVipsToEtcHosts}, True]}
resources:
VipHosts:
type: OS::Heat::Value
properties:
type: string
value:
list_join:
- '\n'
- - str_replace:
template: IP HOST
params:
IP: {get_attr: [VipMap, net_ip_map, external]}
HOST: {get_param: CloudName}
- str_replace:
template: IP HOST
params:
IP: {get_attr: [VipMap, net_ip_map, ctlplane]}
HOST: {get_param: CloudNameCtlplane}
- str_replace:
template: IP HOST
params:
IP: {get_attr: [VipMap, net_ip_map, internal_api]}
HOST: {get_param: CloudNameInternal}
- str_replace:
template: IP HOST
params:
IP: {get_attr: [VipMap, net_ip_map, storage]}
HOST: {get_param: CloudNameStorage}
- str_replace:
template: IP HOST
params:
IP: {get_attr: [VipMap, net_ip_map, storage_mgmt]}
HOST: {get_param: CloudNameStorageManagement}
HeatAuthEncryptionKey:
type: OS::Heat::RandomString
@ -328,8 +369,15 @@ resources:
type: OS::TripleO::Hosts::SoftwareConfig
properties:
hosts:
list_join:
- '\n'
- - if:
- add_vips_to_etc_hosts
- {get_attr: [VipHosts, value]}
- ''
-
{% for role in roles %}
- list_join:
- list_join:
- '\n'
- {get_attr: [{{role.name}}, hosts_entry]}
{% endfor %}
@ -581,32 +629,7 @@ outputs:
list_join:
- "\n"
- - {get_attr: [hostsConfig, hosts_entries]}
-
- str_replace:
template: IP HOST
params:
IP: {get_attr: [VipMap, net_ip_map, external]}
HOST: {get_param: CloudName}
- str_replace:
template: IP HOST
params:
IP: {get_attr: [VipMap, net_ip_map, ctlplane]}
HOST: {get_param: CloudNameCtlplane}
- str_replace:
template: IP HOST
params:
IP: {get_attr: [VipMap, net_ip_map, internal_api]}
HOST: {get_param: CloudNameInternal}
- str_replace:
template: IP HOST
params:
IP: {get_attr: [VipMap, net_ip_map, storage]}
HOST: {get_param: CloudNameStorage}
- str_replace:
template: IP HOST
params:
IP: {get_attr: [VipMap, net_ip_map, storage_mgmt]}
HOST: {get_param: CloudNameStorageManagement}
- - {get_attr: [VipHosts, value]}
EnabledServices:
description: The services enabled on each role
value:

56
puppet/services/vip-hosts.yaml

@ -1,56 +0,0 @@
heat_template_version: 2016-04-08
description: >
If the deployer doesn't have a DNS server for the overcloud nodes. This will
populate the node-names and IPs for the VIPs of the overcloud.
parameters:
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
DefaultPasswords:
default: {}
type: json
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
outputs:
role_data:
description: role data for the VIP hosts role
value:
service_name: vip_hosts
config_settings:
tripleo::vip_hosts::hosts_spec:
external:
name: "%{hiera('cloud_name_external')}"
ip: "%{hiera('public_virtual_ip')}"
ensure: present
comment: FQDN of the external VIP
internal_api:
name: "%{hiera('cloud_name_internal_api')}"
ip: "%{hiera('internal_api_virtual_ip')}"
ensure: present
comment: FQDN of the internal api VIP
storage:
name: "%{hiera('cloud_name_storage')}"
ip: "%{hiera('storage_virtual_ip')}"
ensure: present
comment: FQDN of the storage VIP
storage_mgmt:
name: "%{hiera('cloud_name_storage_mgmt')}"
ip: "%{hiera('storage_mgmt_virtual_ip')}"
ensure: present
comment: FQDN of the storage mgmt VIP
ctlplane:
name: "%{hiera('cloud_name_ctlplane')}"
ip: "%{hiera('controller_virtual_ip')}"
ensure: present
comment: FQDN of the ctlplane VIP
step_config: |
include ::tripleo::vip_hosts

5
roles_data.yaml

@ -94,7 +94,6 @@
- OS::TripleO::Services::OpenDaylightOvs
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::FluentdClient
- OS::TripleO::Services::VipHosts
- OS::TripleO::Services::BarbicanApi
- OS::TripleO::Services::PankoApi
@ -122,7 +121,6 @@
- OS::TripleO::Services::OpenDaylightOvs
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::FluentdClient
- OS::TripleO::Services::VipHosts
- name: BlockStorage
ServicesDefault:
@ -136,7 +134,6 @@
- OS::TripleO::Services::TripleoFirewall
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::FluentdClient
- OS::TripleO::Services::VipHosts
- name: ObjectStorage
ServicesDefault:
@ -151,7 +148,6 @@
- OS::TripleO::Services::TripleoFirewall
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::FluentdClient
- OS::TripleO::Services::VipHosts
- name: CephStorage
ServicesDefault:
@ -165,4 +161,3 @@
- OS::TripleO::Services::TripleoFirewall
- OS::TripleO::Services::SensuClient
- OS::TripleO::Services::FluentdClient
- OS::TripleO::Services::VipHosts
Loading…
Cancel
Save