heat/heat_integrationtests/scenario/templates/test_server_software_config.yaml
Steve Baker 4737d8aafb Func test conf to specify boot config
This adds a functional test config option boot_config_env which
can specify a path to an environment file which defines boot config
resources for any test which needs the heat agent projects.

By default this value points to boot_config_none_env.yaml, which assumes
the image is already completely configured with the heat agent projects.

The aim is that in the gate jobs the following will be set:
boot_config_env=/opt/stack/new/heat-templates/hot/software-config/boot-config/test_image_env.yaml

And the image_ref will refer to the latest built image in
http://tarballs.openstack.org/heat-test-image/

Change-Id: I1fa09bf3a8be248829061b931dd773973732fa52
2015-03-12 08:57:38 +13:00

174 lines
3.9 KiB
YAML

heat_template_version: 2014-10-16
parameters:
key_name:
type: string
flavor:
type: string
image:
type: string
network:
type: string
signal_transport:
type: string
default: CFN_SIGNAL
software_config_transport:
type: string
default: POLL_SERVER_CFN
dep1_foo:
default: fooooo
type: string
dep1_bar:
default: baaaaa
type: string
dep2a_bar:
type: string
default: barrr
dep3_foo:
default: fo
type: string
dep3_bar:
default: ba
type: string
resources:
the_sg:
type: OS::Neutron::SecurityGroup
properties:
name: the_sg
description: Ping and SSH
rules:
- protocol: icmp
- protocol: tcp
port_range_min: 22
port_range_max: 22
cfg1:
type: OS::Heat::SoftwareConfig
properties:
group: script
inputs:
- name: foo
- name: bar
outputs:
- name: result
config: {get_file: cfg1.sh}
cfg2a:
type: OS::Heat::StructuredConfig
properties:
group: cfn-init
inputs:
- name: bar
config:
config:
files:
/tmp/cfn-init-foo:
content:
get_input: bar
mode: '000644'
cfg2b:
type: OS::Heat::SoftwareConfig
properties:
group: script
outputs:
- name: result
config: |
#!/bin/sh
echo -n "The file /tmp/cfn-init-foo contains `cat /tmp/cfn-init-foo` for server $deploy_server_id during $deploy_action" > $heat_outputs_path.result
cfg3:
type: OS::Heat::SoftwareConfig
properties:
group: puppet
inputs:
- name: foo
- name: bar
outputs:
- name: result
config: {get_file: cfg3.pp}
dep1:
type: OS::Heat::SoftwareDeployment
properties:
config:
get_resource: cfg1
server:
get_resource: server
input_values:
foo: {get_param: dep1_foo}
bar: {get_param: dep1_bar}
signal_transport: {get_param: signal_transport}
dep2a:
type: OS::Heat::StructuredDeployment
properties:
name: 10_dep2a
signal_transport: NO_SIGNAL
config:
get_resource: cfg2a
server:
get_resource: server
input_values:
bar: {get_param: dep2a_bar}
dep2b:
type: OS::Heat::SoftwareDeployment
properties:
name: 20_dep2b
config:
get_resource: cfg2b
server:
get_resource: server
signal_transport: {get_param: signal_transport}
dep3:
type: OS::Heat::SoftwareDeployment
properties:
config:
get_resource: cfg3
server:
get_resource: server
input_values:
foo: {get_param: dep3_foo}
bar: {get_param: dep3_bar}
signal_transport: {get_param: signal_transport}
cfg_user_data:
type: Heat::InstallConfigAgent
server:
type: OS::Nova::Server
properties:
image: {get_param: image}
flavor: {get_param: flavor}
key_name: {get_param: key_name}
security_groups:
- {get_resource: the_sg}
networks:
- network: {get_param: network}
user_data_format: SOFTWARE_CONFIG
software_config_transport: {get_param: software_config_transport}
user_data: {get_attr: [cfg_user_data, config]}
outputs:
res1:
value:
result: {get_attr: [dep1, result]}
stdout: {get_attr: [dep1, deploy_stdout]}
stderr: {get_attr: [dep1, deploy_stderr]}
status_code: {get_attr: [dep1, deploy_status_code]}
res2:
value:
result: {get_attr: [dep2b, result]}
stdout: {get_attr: [dep2b, deploy_stdout]}
stderr: {get_attr: [dep2b, deploy_stderr]}
status_code: {get_attr: [dep2b, deploy_status_code]}
res3:
value:
result: {get_attr: [dep3, result]}
stdout: {get_attr: [dep3, deploy_stdout]}
stderr: {get_attr: [dep3, deploy_stderr]}
status_code: {get_attr: [dep3, deploy_status_code]}