Search code examples
ubuntuantopenstackdevstackopenstack-heat

Openstack (devstack) Heat template to create vm and app on it


Is it possible, using heat template, create VM instance (eg:. ubuntu) and install on it some application? I want create ubuntu instance and install on it apache ant using heat template


Solution

  • You can use the user_data section of the Server resource to specify a script that installs software.

    buildslave:
        type: OS::Nova::Server
        properties:
          ..
          ..
          user_data: |
               #!/bin/bash -v
               apt-get update
               apt-get install ant
    

    The script can also be external to the Heat template: