Setup runner script for the simulator in HOT
[integration.git] / test / mocks / mass-pnf-sim / deployment / heat / heat.yaml
1 description: Heat template for deploying Mass PNF Simulator
2 heat_template_version: '2017-02-24'
3 parameters:
4   flavor_name:
5     description: Flavor name of the simulator instance. This should depend on the requested amount of simulator instances
6     type: string
7   image_name:
8     description: Name or id of the image (Debian family only)
9     type: string
10   key_name:
11     label: Key pair name for passwordless login to instance
12     type: string
13   float_net_id:
14     description: ID of the network with a pool of floating IPs
15     label: Floating IP network
16     type: string
17   instance_net_id:
18     type: string
19     description: Id of a private network for instance interface
20 resources:
21   config:
22     type: OS::Heat::SoftwareConfig
23     properties:
24       config:
25         get_file: cloud-config.yaml
26   sim_script:
27     type: OS::Heat::SoftwareConfig
28     properties:
29       config:
30         get_file: mass-pnf-sim_run.sh
31   sim_script_file:
32     type: OS::Heat::CloudConfig
33     properties:
34       cloud_config:
35         write_files:
36           - path: /root/mass-pnf-sim_run.sh
37             content:
38               get_attr: [sim_script, config]
39   simulator_floating_ip:
40     type: OS::Neutron::FloatingIP
41     properties:
42       floating_network:
43         get_param: float_net_id
44       port_id:
45         get_attr: [simulator, addresses, get_param: instance_net_id, 0, port]
46   cloud_config:
47     type: OS::Heat::MultipartMime
48     properties:
49       parts:
50         - config:
51             get_resource: config
52         - config:
53             get_resource: sim_script_file
54   simulator:
55     type: OS::Nova::Server
56     properties:
57       name: mass-pnf-simulator
58       key_name:
59         get_param: key_name
60       image:
61         get_param: image_name
62       flavor:
63         get_param: flavor_name
64       networks:
65         - network:
66             get_param: instance_net_id
67       user_data_format: RAW
68       user_data:
69         get_resource: cloud_config
70 outputs:
71   simulator_instance_id:
72     description: ID of the simulator instance
73     value:
74       get_resource: simulator
75   simulator_instance_fip:
76     description: Floating IP address of the simulator instance
77     value:
78       get_attr: [simulator_floating_ip, floating_ip_address]