无法在热/热模板中运行脚本



我无法使用加热模板执行脚本并请求一些输入。

OpenStack->部署AWS实例

我的热模板 -

heat_template_version: 2013-05-23
description: >
  Created 4/20/17 by aa@gmail.com. For Cloud admin@MSS Adaptive Security
parameters:
  flavor:
    type: string
    description: 'Flavor to be used for compute instance'
  key_name:
    type: string
    description: 'For most clouds, the name of the key-pair to be used for the compute instance; for VMware clouds, the contents of the public SSH key for the compute instance'
  availability_zone1:
    type: string
    description: 'Name of availability zone in which to create the instance'
    default: 'nova'
  network-id__for__Itaas_testing:
    type: string
    description: 'Generated to reference ''Itaas_testing'' network.'
    default: 'vpc-f3f24490'
  subnet_id_subnet-faf1b19a:
    type: string
    description: 'Generated to reference subnet ''itaas_Private subnet''.'
    default: 'subnet-faf1b19a'
parameter_groups:
    - { label: 'Image Parameters', parameters: [flavor, key_name] }
    - { label: 'Network Parameters', parameters: [availability_zone1, network-id__for__Itaas_testing, subnet_id_subnet-faf1b19a] }
resources:
## REFERENCE {"Itaas_testing":{"type": "OS::Neutron::Net", "properties": {"network_id": "vpc-f3f24490", "external":"false", "subnets": [{"cidr":"10.0.0.0/24","availability_zone":"us-west-1a","name":"itaas_Public subnet","id":"subnet-4af4b42a"},{"cidr":"10.0.4.0/28","availability_zone":"us-west-1a","name":"itaas_Private subnet","id":"subnet-faf1b19b"}] }}}
  RHEL-7_0_HVM_GA-20141017-x86_64-1-Hourly2-GP2:
    type: OS::Nova::Server
    properties:
      networks:
          - port: { get_resource: RHEL-7_0_HVM_GA-20141017-x86_64-1-Hourly2-GP2__to__Itaas_testing__port  }
      name: "RHEL-7_0_HVM_GA-20141017-x86_64-1-Hourly2-GP2"
      image: "ami-33cdd876" # RHEL-7.0_HVM_GA-20141017-x86_64-1-Hourly2-GP2
      flavor: { get_param: flavor }
      key_name: { get_param: key_name }
      availability_zone: { get_param: availability_zone1 }
      metadata: 
        "__os_type__" : "Linux"
      user_data: https://raw.githubusercontent.com/AnishAnil/Learn-git/master/test.sh
  RHEL-7_0_HVM_GA-20141017-x86_64-1-Hourly2-GP2__to__Itaas_testing__port:
    type: OS::Neutron::Port
    properties:
      security_groups:
          - sg-1869137f  # sg-1869137f(itaas_testing_security_group_any_any_any)  
      network_id: { get_param: network-id__for__Itaas_testing }
      replacement_policy: AUTO   #TODO remove this if using HEAT version Icehouse!
      fixed_ips:
        - subnet: { get_param: subnet_id_subnet-faf1b19e }
outputs:
  blueprint_url:
    description: Blueprint Origin URL
    value:  https://ABCD:8443/landscaper/view/projects?open=a%40gmail.com_8caf420f_f24a_4c4d_83f8_cb9835d7b734-OrionContent/default/Adaptive_Security/ITSAAS_Baston.yml

提到的脚本文件包含以下数据:

#!/bin/sh
sudo mkdir /tmp/A1

您无法在字段user_data中直接使用URL。而是使用函数get_file加载内容:

user_data: { get_file: https://raw.githubusercontent.com/AnishAnil/Learn-git/master/test.sh }

检查热编排模板( Hot)规格。

传递命令时提及绝对路径

#!/bin/sh
/bin/bash/mkdir /tmp/A1

相关内容

  • 没有找到相关文章

最新更新