Ce contenu n'est pas disponible dans la langue sélectionnée.
10.3. Customizing Overcloud Post-Configuration
A situation might occur where you have completed the creation of your Overcloud but want to add additional configuration, either on initial creation or on a subsequent update of the Overcloud. In this case, you use the
OS::TripleO::NodeExtraConfigPost resource to apply configuration using the standard OS::Heat::SoftwareConfig types. This applies additional configuration after the main Overcloud configuration completes.
In this example, we first create a basic Heat template (
/home/stack/templates/nameserver.yaml) that runs a script to append each node's resolv.conf with a variable nameserver.
In this example, the `resources` section contains the following:
- ExtraConfig
- This defines a software configuration. In this example, we define a Bash
scriptand Heat replaces_NAMESERVER_IP_with the value stored in thenameserver_ipparameter. - ExtraDeployments
- This executes a software configuration, which is the software configuration from the
ExtraConfigresource. Note the following:- The
serversparameter is provided by the parent template and is mandatory in templates for this hook. input_valuescontains a parameter calleddeploy_identifier, which stores theDeployIdentifierfrom the parent template. This parameter provides a timestamp to the resource for each deployment update. This ensures the resource reapplies on subsequent overcloud updates.
Next, create an environment file (
/home/stack/templates/post_config.yaml) that registers our Heat template as the OS::TripleO::NodeExtraConfigPost: resource type.
To add the configuration, add the environment file to the stack when creating or updating the Overcloud. For example:
openstack overcloud deploy --templates -e /home/stack/templates/post_config.yaml
$ openstack overcloud deploy --templates -e /home/stack/templates/post_config.yaml
This adds the configuration to all nodes after the core configuration completes on either initial Overcloud creation or subsequent updates.
Important
You can only register the
OS::TripleO::NodeExtraConfigPost to only one Heat template. Subsequent usage overrides the Heat template to use.