Revision history [back]

click to hide/show revision 1
initial version

You can do any operation by utilizing the user_data attribute and run shell scripting See example:

 MyHost:
    type: OS::Nova::Server
    properties:
      name: MyHost
      image: { get_param: db_image }
      flavor: { get_param: db_flavor }
      key_name: { get_param: key_name }
      networks:
        - port: { get_resource: MyHost_port }
      user_data:
        str_replace:
          template: |
            #!/bin/bash -x
            mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
            /bin/sed -e "s/PasswordAuthentication no/PasswordAuthentication yes/g" /etc/ssh/sshd_config.bak >> /etc/ssh/sshd_config

You can do any operation by utilizing the user_data attribute and run shell scripting See example:

 MyHost:
    type: OS::Nova::Server
    properties:
      name: MyHost
      image: { get_param: db_image }
      flavor: { get_param: db_flavor }
      key_name: { get_param: key_name }
      networks:
        - port: { get_resource: MyHost_port }
      user_data:
        str_replace:
          template: |
            #!/bin/bash -x
            mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
            /bin/sed -e "s/PasswordAuthentication no/PasswordAuthentication yes/g" /etc/ssh/sshd_config.bak >> /etc/ssh/sshd_config

More infor: http://docs.openstack.org/developer/heat/template_guide/hot_spec.html