Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

NodeUserData continues even if one SoftwareConfig fails

I am using first boot scripts to generate and configure parameters for my environment.

I have a first-boot.yaml file, that contains a MultipartMime.

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

The generate resource is a python script, and generate some values and places them in a file.

generate:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config: | 
        #!/bin/python
        ....

Now this works fine for most scenarios. But sometimes the python script fails because it couldn't find the desired file.

At this point i want my Stack creation (overcloud deployment) to fail. But it keeps going and then the configure script also fails. Can anyone please tell me how to add checks here that ensures that python script exited with status code 0.

NodeUserData continues even if one SoftwareConfig fails

I am using first boot scripts to generate and configure parameters for my environment.

I have a first-boot.yaml file, that contains a MultipartMime.

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

The generate resource is a python script, and generate some values and places them in a file. Similarly the configure resource is a bash script that will read the values and configure them.

generate:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config: | 
        #!/bin/python
        ....

Now this works fine for most scenarios. But sometimes the python script fails because it couldn't find the desired file.

At this point i want my Stack creation (overcloud deployment) to fail. But it keeps going and then the configure script also fails. Can anyone please tell me how to add checks here that ensures that python script exited with status code 0. 0.