Este contenido no está disponible en el idioma seleccionado.

Chapter 10. Creating Custom Configuration


In some cases, you might want to provide configuration for additional applications that integrate with your Red Hat Enterprise Linux OpenStack Platform environment. This custom configuration requires additional Heat templates included with your Overcloud stack. This section examines some of the custom configuration operations available to you.

10.1. Customizing Configuration on First Boot

The director provides a mechanism to perform configuration on all nodes upon the initial creation of the Overcloud. The director achieves this through cloud-init, which you can call using the OS::TripleO::NodeUserData resource type.
In this example, In this example, we aim to update the nameserver with a custom IP address on all nodes. 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 specific nameserver. We use the OS::TripleO::MultipartMime resource type to send the configuration script.
heat_template_version: 2014-10-16

description: >
  Extra hostname configuration

resources:
  userdata:
    type: OS::Heat::MultipartMime
    properties:
      parts:
      - config: {get_resource: nameserver_config}

  nameserver_config:
    type: OS::Heat::SoftwareConfig
    properties:
      config: |
        #!/bin/bash
        echo "nameserver 192.168.1.1" >> /etc/resolv.conf

outputs:
  OS::stack_id:
    value: {get_resource: userdata}
Copy to Clipboard Toggle word wrap
Next, create an environment file (/home/stack/templates/firstboot.yaml) that registers our Heat template as the OS::TripleO::NodeUserData resource type.
resource_registry:
  OS::TripleO::NodeUserData: /home/stack/templates/nameserver.yaml
Copy to Clipboard Toggle word wrap
To add the first boot configuration, add the environment file to the stack when first creating the Overcloud. For example:
$ openstack overcloud deploy --templates -e /home/stack/templates/firstboot.yaml
Copy to Clipboard Toggle word wrap
The -e applies the environment file to the Overcloud stack.
This adds the configuration to all nodes when they are first created and boot for the first time. Subsequent inclusions of these templates, such as updating the Overcloud stack, does not run these scripts.

Important

You can only register the OS::TripleO::NodeUserData to only one Heat template. Subsequent usage overrides the Heat template to use.
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat