Skip to content

Instantly share code, notes, and snippets.

@tvlooy
Created September 16, 2016 17:19
Show Gist options
  • Save tvlooy/da95ae233e28515236e4d5892f896b5d to your computer and use it in GitHub Desktop.
Save tvlooy/da95ae233e28515236e4d5892f896b5d to your computer and use it in GitHub Desktop.
##
## openstack stack create -t example.heat.yml example-1
##
heat_template_version: 2016-04-08
description: |
Deploy example
resources:
server_root_pw:
type: OS::Heat::RandomString
nginx_config:
type: OS::Heat::SoftwareConfig
properties:
group: ansible
config: |
---
- name: Install and run Nginx
connection: local
hosts: localhost
tasks:
- name: Install Nginx
yum:
name: nginx
state: installed
- name: Start Nginx
service:
name: nginx
state: started
enabled: yes
deploy_nginx:
type: OS::Heat::SoftwareDeployment
properties:
config:
get_resource: nginx_config
server:
get_resource: server_www1
server_www1_floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network_id: public
server_www1:
type: OS::Nova::Server
properties:
name: www1
image: centos-7-64bit
flavor: small
key_name: my_openstack_key
admin_pass: { get_attr: [ server_root_pw, value ] }
user_data_format: SOFTWARE_CONFIG
association:
type: OS::Nova::FloatingIPAssociation
properties:
floating_ip: { get_resource: server_www1_floating_ip }
server_id: { get_resource: server_www1 }
outputs:
server_www1_ip:
description: The public IPv4 address of server www1
value:
get_attr: [ server_www1_floating_ip, floating_ip_address ]
server_root_pw:
description: Server root password
value:
get_attr: [ server_root_pw, value ]
@tvlooy
Copy link
Author

tvlooy commented Sep 16, 2016

The part that times out is the OS:Heat:SoftwareDeployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment