tripleo-puppet-elements/elements/hiera
Diana Clarke 85f4604298 Remove nova.conf truncate/refresh workaround
truncate-nova-config was added as a workaround for the following
bug.

  Duplicate sections in generated config
  https://bugs.launchpad.net/oslo.config/+bug/1568820

This workaround is no longer needed, as the root causes are now
fixed in both nova and oslo-config.

This workaround is also unused, as it was recently changed and
accidentally installed in the wrong location (nested one level too
deep in configure.d, and maxdepth is 1 in dib-run-parts).

For example, compare configure.d/ in stable/newton vs master
(circa ocata), and note the path differences.

  newton: http://paste.openstack.org/show/601802/
  ocata: http://paste.openstack.org/show/601806/

  newton: configure.d/40-truncate-nova-config
  ocata: configure.d/40-truncate-nova-config/40-truncate-nova-config

But it was a happy accident because this workaround stripped the
comments from /etc/nova/nova.conf, but now they're back as of ocata.

Related-Bug: #1568820
Change-Id: Iddae03f2d66cf534908dad884af55e2ae7d18d4b
2017-03-07 16:27:31 -05:00
..
install.d Install hiera orc files via install.d 2016-11-30 22:14:35 -05:00
os-apply-config/etc/puppet Add a Hiera element 2015-01-09 14:27:02 -05:00
10-hiera-disable Install hiera orc files via install.d 2016-11-30 22:14:35 -05:00
40-hiera-datafiles Install hiera orc files via install.d 2016-11-30 22:14:35 -05:00
README.md Add a Hiera element 2015-01-09 14:27:02 -05:00
element-deps Remove nova.conf truncate/refresh workaround 2017-03-07 16:27:31 -05:00
pkg-map Add rubygems-deep_merge to package list 2016-03-21 19:03:07 +02:00

README.md

Configure Hiera for use w/ Puppet and Heat metadata.

Configuration

hiera:
  hierarchy: []
    - The order to load datafiles. This is configured in hiera.yaml.

  datafiles: {}
      Data files is a hash of filename -> {data/mappings} to inject
      into each named hiera datafile. There are three types:

    raw_data: contains static raw data to inject directly into this hiera
      datafile. Can be an inline string or imported via get_file in a
      Heat template.

    mapped_data: Name value pairs that will be injected into the
      hiera data file. Hiera name on the left, Hiera value on the right.

    oac_data: A hash of puppet -> OAC (os-apply-config) named key value
      pairs. Arbitrary os-apply-config data can be mapped to Hiera keys
      using this data. Hiera name on the left. The Hiera value is generated
      at os-refresh-config time via os-apply-config lookup of the value.

Example:

HieraConfig:
  type: OS::Heat::StructuredConfig
  properties:
    group: os-apply-config
    config:
      hiera:
        hierarchy:
          - heat_config_%{::deploy_config_name}
          - controller
          - common
        datafiles:
          controller:
            raw_data: {get_file: puppet/hieradata/controller.yaml}
            oac_data:
              bootstrap_nodeid: bootstrap_host.bootstrap_nodeid
          common:
            data: {get_file: puppet/hieradata/common.yaml}

HieraDeployment:
  type: OS::Heat::StructuredDeployment
  properties:
    server: {get_resource: MyServer}
    config: {get_resource: HieraConfig}
    signal_transport: NO_SIGNAL

In this example the 'hierarchy' config section controls the ordering of the hiera files within hiera.yaml. The 'datafiles' config section controls the actual hiera data files which gets injected into the node.

NOTE: This example makes use of a special heat_config_%{::deploy_config_name} heira datafile which gets generated via the heat-config-puppet element when enable_hiera is set to True. Since this file is injected automatically we don't specify it in 'datafiles' but we do have it listed in the 'hierarchy'. A FACTER_ variable is used to provide access to the ::deploy_config_name variable which is automatically set via the heat-config-puppet element when puppet apply is executed.