Deploying with Heat Templates¶
It is possible to use the --templates
and --environment-file
options to override specific templates or even deploy using a separate
set of templates entirely.
Deploying an Overcloud using the default templates¶
The --templates
option without an argument enables deploying using
the packaged Heat templates:
openstack overcloud deploy --templates
Note
The default location for the templates is /usr/share/openstack-tripleo-heat-templates.
Overriding specific templates with local versions¶
You may use heat environment files (via the --environment-file
or -e
option), combined with the --templates
option to override specific
templates, e.g to test a bugfix outside of the location of the packaged
templates.
The mapping between heat resource types and the underlying templates can be found in /usr/share/openstack-tripleo-heat-templates/overcloud-resource-registry-puppet.j2.yaml
Here is an example of copying a specific resource template and overriding so the deployment uses the local version:
mkdir local_templates
cp /usr/share/openstack-tripleo-heat-templates/puppet/controller-puppet.yaml local_templates
cat > override_templates.yaml << EOF
resource_registry:
OS::TripleO::Controller: local_templates/controller-puppet.yaml
EOF
openstack overcloud deploy --templates --environment-file override_templates.yaml
Note
The --environment-file
/-e
option may be specified multiple times,
if duplicate keys are specified in the environment files, the last one
takes precedence.
Note
You must also pass the environment files (again using the -e
or
--environment-file
option) whenever you make subsequent changes to the
overcloud, such as Scaling overcloud roles,
Deleting Overcloud Nodes or
Updating Content on Overcloud Nodes.
Using a custom location for all templates¶
You may specify a path to the --templates
option, such that the packaged
tree may be copied to another location, which is useful e.g for developer usage
where you wish to check the templates into a revision control system.
Note
Use caution when using this approach as you will need to rebase any local changes on updates to the openstack-tripleo-heat-templates package, and care will be needed to avoid modifying anything in the tree which the CLI tools rely on (such as top-level parameters). In many cases using the ExtraConfig interfaces or specific template overrides as outlined above may be preferable.
Here is an example of copying the entire tripleo-heat-templates tree to a local directory and launching a deployment using the new location:
cp -r /usr/share/openstack-tripleo-heat-templates /home/stack/
openstack overcloud deploy --templates /home/stack/openstack-tripleo-heat-templates