0

The user data section in HOT is to run shell command on new created nova instance, however, I want to run a local(the machine which runs heat stack-create command) shell command when perform "heat stack-create" command.

But after I read though the OpenStack HOT doc, I didn't find any syntax to support this.

gemfield
  • 3,228
  • 7
  • 27
  • 28
  • You can achieve it by having your own heat plugin and invoke it by calling something like OS::Gemfield::RunShellCmd. – dpaks Nov 30 '16 at 11:57
  • This will be an issue when deploy HOT template file to other OpenStack host, due to lack of the plugin. – gemfield Mar 03 '17 at 08:02

1 Answers1

1

There is no syntax to support this. Heat templates are processed on the server. There is also no guarantee that the submitting system even has a standard Unix shell (heat templates can be submitted via a web browser, or with tools other than the heat CLI).

If your deployment workflow requires coordinating some local action with the Heat deployment, your best bet is to use another tool (Ansible? A shell script?) to automate the workflow.

An alternative would be to have Heat (or your VMs) signal your local system using some sort of web hook, and have a web service running locally that would receive the signal and perform whatever action is appropriate.

larsks
  • 277,717
  • 41
  • 399
  • 399