Guest User

Untitled

a guest
Feb 19th, 2015
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.79 KB | None | 0 0
  1. ~/devstack/heat.yaml
  2.  
  3. heat_template_version: 2013-05-23
  4.  
  5. parameters:
  6.         key_name:
  7.                 type: string
  8.                 label: Key Name
  9.                 description: Name of key-pair to be used for compute instance
  10.         image:
  11.                 type: string
  12.                 label: Image ID
  13.                 description: Image to be used for compute instance
  14.         flavor:
  15.                 type: string
  16.                 label: Instance Type
  17.                 description: Type of instance (flavor) to be used
  18.  
  19. resources:
  20.         config:
  21.                 type: OS::Heat::SoftwareConfig
  22.                 properties:
  23.                         group: puppet
  24.                         inputs:
  25.                                 - name: foo
  26.                                 - name: bar
  27.                         outputs:
  28.                                 - name: result
  29.                         config:
  30.                 get_file: example-puppet-manifest.pp
  31.  
  32.         deployment:
  33.                 type: OS::Heat::SoftwareDeployment
  34.         properties:
  35.                         config:
  36.                                 get_resource: config
  37.                         server:
  38.                                 get_resource: server
  39.                         input_values:
  40.                                 foo: fooooo
  41.                                 bar: baaaaa
  42.  
  43.         server:
  44.                 type: OS::Nova::Server
  45.                 properties:
  46.                         image: {get_param: image}
  47.                         flavor: {get_param: flavor}
  48.                         key_name: {get_param: key_name}
  49.                         user_data_format: SOFTWARE_CONFIG
  50.  
  51. outputs:
  52.         result:
  53.                 value:
  54.                         get_attr: [deployment, result]
  55.         stdout:
  56.                 value:
  57.                         get_attr: [deployment, deploy_stdout]
  58.  
  59.  
  60. ~/devstack/example-puppet-manifest.pp
  61.  
  62. file { 'barfile':
  63.    ensure  => file,
  64.     mode    => '0644',
  65.     path    => '/tmp/$::bar',
  66.     content => '$::foo',
  67. }
  68.  
  69. file { 'output_result':
  70.    ensure  => file,
  71.     path    => '$::heat_outputs_path.result',
  72.     mode    => '0644',
  73.     content => 'The file /tmp/$::bar contains $::foo',
  74. }
  75.  
  76. Image Creation
  77.  
  78. export ELEMENTS_PATH=\
  79. tripleo-image-elements/elements:\
  80. heat-templates/hot/software-config/elements
  81.  
  82. diskimage-builder/bin/disk-image-create vm \
  83. fedora \
  84. heat-config \
  85. os-collect-config \
  86. os-refresh-config \
  87. os-apply-config \
  88. heat-config-script \
  89. heat-config-cfn-init \
  90. -o fedora-software-config.qcow2
  91. glance image-create --disk-format qcow2 --container-format bare \
  92. --name fedora-software-config < \
  93. fedora-software-config.qcow2
  94.  
  95.  
  96. heat stack creation command
  97.  
  98. heat stack-create heat-puppet1 --template-file heat.yaml -P key_name=heat_key -P image=fedora-software-config -P flavor=m1.small
Advertisement
Add Comment
Please, Sign In to add comment