<role>ExtraConfigPre doesn't work when both NodeExtraConfig and <role>ExtraConfigPre are set

Solution Verified - Updated -

Issue

  • Set NodeExtraConfig and <Role>ExtraConfigPre.
    In the following example, NodeExtraConfig and ControllerExtraConfigPre are set.

    (overcloud) [stack@undercloud-0 ~]$ cat virt/extraconfig.yaml 
    resource_registry:
      OS::TripleO::NodeExtraConfig: /home/stack/virt/nodeextraconfig.yaml
      OS::TripleO::ControllerExtraConfigPre: /home/stack/virt/ctlextraconfig.yaml
    
        ==> set both NodeExtraConfig and <role>ExtraConfigPre
    
    
    (overcloud) [stack@undercloud-0 ~]$ cat /home/stack/virt/nodeextraconfig.yaml
         :
      CustomExtraConfigPre:
        type: OS::Heat::SoftwareConfig
        properties:
          group: script
          config: |
            #!/bin/bash
            echo TEST NodeExtraConfig
            echo `date` TEST NodeExtraConfig >> /tmp/my_log
         :
    
    (overcloud) [stack@undercloud-0 ~]$ cat /home/stack/virt/ctlextraconfig.yaml
         :
      CustomExtraConfigPre:
        type: OS::Heat::SoftwareConfig
        properties:
          group: script
          config: |
            #!/bin/bash
            echo TEST ControllerExtraConfigPre
            echo `date` TEST ControllerExtraConfigPre >> /tmp/my_log
         :
    
  • Then run a deployment command.

    $ openstack overcloud deploy \
      :
    -e /home/stack/virt/extraconfig.yaml \
      :
    
  • However, only NodeExtraConfig works.
    ControllerExtraConfigPre doesn't work.

    2023-11-02 03:16:59,616 p=203819 u=stack n=ansible | 2023-11-02 03:16:59.616057 | 52540007-cc33-4bc6-fb94-00000000409c |       TASK | Output for async deployment CustomExtraDeploymentPre
    2023-11-02 03:16:59,681 p=203819 u=stack n=ansible | 2023-11-02 03:16:59.680465 | 52540007-cc33-4bc6-fb94-00000000409c |         OK | Output for async deployment CustomExtraDeploymentPre | controller-0 | result={
        "changed": false,
        "failed_when_result": false,
        "msg": [
            {
                "stderr": [
                    "[2023-11-02 03:16:56,213] (heat-config) [DEBUG] Running /usr/libexec/heat-config/hooks/script < /var/lib/heat-config/deployed/de6de80e-7979-4228-a913-b3c40dd8f9a3.json",
                    "[2023-11-02 03:16:56,264] (heat-config) [INFO] !!binary |",
                    "  eyJkZXBsb3lfc3Rkb3V0IjogIlRFU1QgTm9kZUV4dHJhQ29uZmlnXG4iLCAiZGVwbG95X3N0ZGVy",
                    "  ciI6ICIiLCAiZGVwbG95X3N0YXR1c19jb2RlIjogMH0=",
                    "",
                    "[2023-11-02 03:16:56,264] (heat-config) [DEBUG] b\"[2023-11-02 03:16:56,251] (heat-config) [INFO] deploy_identifier=1698894631\\n[2023-11-02 03:16:56,251] (heat-config) [INFO] deploy_server_id=4de650b0-810b-4975-8497-e5a4fe3311db\\n[2023-11-02 03:16:56,251] (heat-config) [INFO] deploy_action=CREATE\\n[2023-11-02 03:16:56,251] (heat-config) [INFO] deploy_stack_id=overcloud-Controller-ludk7w6uv65g-0-gt4e62oqzmmx-NodeExtraConfig-v3ioqkb5hawj-CustomExtraDeploymentPre-zfchaua2rxrb/48492639-75fc-4a8d-9df5-ca65230018ad\\n[2023-11-02 03:16:56,251] (heat-config) [INFO] deploy_resource_name=TripleOSoftwareDeployment\\n[2023-11-02 03:16:56,251] (heat-config) [INFO] deploy_signal_transport=NO_SIGNAL\\n[2023-11-02 03:16:56,251] (heat-config) [DEBUG] Running /var/lib/heat-config/heat-config-script/de6de80e-7979-4228-a913-b3c40dd8f9a3\\n[2023-11-02 03:16:56,256] (heat-config) [INFO] b'TEST NodeExtraConfig\\\\n'\\n[2023-11-02 03:16:56,256] (heat-config) [DEBUG] b''\\n[2023-11-02 03:16:56,256] (heat-config) [INFO] Completed /var/lib/heat-config/heat-config-script/de6de80e-7979-4228-a913-b3c40dd8f9a3\\n\"",
    
      ==> only "TEST NodeExtraConfig" is shown.
    
    (overcloud) [stack@undercloud-0 ~]$ ssh tripleo-admin@controller-0.ctlplane cat /tmp/my_log
    Thu Nov 2 03:16:56 AM UTC 2023 TEST NodeExtraConfig
    
      ==> only "TEST NodeExtraConfig" is shown.
    

Environment

  • Red Hat OpenStack Platform 17.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content