-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-ansible-template_single_file.yaml
99 lines (91 loc) · 2.09 KB
/
example-ansible-template_single_file.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
heat_template_version: 2013-05-23
parameters:
key_name:
type: string
default: test_key
flavor:
type: string
default: m1.heat
image:
type: string
default: fedora-software-config
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
config:
type: OS::Heat::SoftwareConfig
properties:
group: ansible
inputs:
- name: foo
- name: bar
outputs:
- name: result
config: |
# get_file: config-scripts/example-ansible-template.ansible
- name: Hello Ansible - quick start
connection: local
hosts: localhost
tasks:
- name: Hello touch_file
shell: echo {{ foo }} >> /tmp/{{ bar }}
- name: Hello echo
shell: echo "The file /tmp/{{ bar }} contains {{ foo }}" >> {{ heat_outputs_path }}.result
deployment:
type: OS::Heat::SoftwareDeployment
properties:
config:
get_resource: config
server:
get_resource: server
input_values:
foo: fooooo
bar: baaaaa
other_deployment:
type: OS::Heat::SoftwareDeployment
properties:
config:
get_resource: config
server:
get_resource: server
input_values:
foo: fu
bar: barmy
actions:
- CREATE
- UPDATE
- SUSPEND
- RESUME
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}
user_data_format: SOFTWARE_CONFIG
outputs:
result:
value:
get_attr: [deployment, result]
stdout:
value:
get_attr: [deployment, deploy_stdout]
stderr:
value:
get_attr: [deployment, deploy_stderr]
status_code:
value:
get_attr: [deployment, deploy_status_code]
other_result:
value:
get_attr: [other_deployment, result]