cbf 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/COPYING +202 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +18 -0
- data/README.md +80 -0
- data/Rakefile +8 -0
- data/bin/cbf +8 -0
- data/cbf.gemspec +26 -0
- data/lib/cbf/version.rb +3 -0
- data/lib/cbf.rb +76 -0
- data/lib/generators/heat.rb +146 -0
- data/lib/parsers/aeolus_v1.rb +169 -0
- data/lib/parsers/aeolus_v1.rng.xml +183 -0
- data/spec/parsers/aeolus_v1_spec.rb +63 -0
- data/spec/samples/aeolus_v1/drupal.xml +75 -0
- data/spec/samples/aeolus_v1/sample.xml +114 -0
- data/spec/samples/aeolus_v1/wordpress.xml +79 -0
- data/spec/spec_helper.rb +8 -0
- metadata +106 -0
@@ -0,0 +1,169 @@
|
|
1
|
+
# Copyright 2012 Red Hat, Inc.
|
2
|
+
# Licensed under the Apache License, Version 2.0, see README for details.
|
3
|
+
|
4
|
+
require 'nokogiri'
|
5
|
+
|
6
|
+
module CBF
|
7
|
+
module Parsers
|
8
|
+
class AeolusV1
|
9
|
+
class << self
|
10
|
+
|
11
|
+
def parse(input_data, options)
|
12
|
+
begin
|
13
|
+
doc = Nokogiri::XML(input_data) { |config| config.strict.nonet }
|
14
|
+
rescue Nokogiri::XML::SyntaxError
|
15
|
+
raise SyntaxError
|
16
|
+
end
|
17
|
+
validate!(doc)
|
18
|
+
|
19
|
+
assemblies = (doc / 'assemblies/assembly').map { |a| parse_assembly(a)}
|
20
|
+
assembly_params = (doc / 'assemblies/assembly').map { |a| parse_assembly_parameters(a) }.flatten
|
21
|
+
resource_params = (doc / 'parameters/parameter').map { |el| parse_parameter(el) }
|
22
|
+
{
|
23
|
+
:name => doc.root.attr('name'),
|
24
|
+
:description => (doc % 'description').text,
|
25
|
+
:resources => assemblies,
|
26
|
+
:services => (doc / 'services/service').map { |el| parse_service(el) },
|
27
|
+
:parameters => assembly_params + resource_params,
|
28
|
+
:files => (doc / '//executable|//files/file').map { |el| parse_file(el, resource_params) },
|
29
|
+
:outputs => (doc / 'assembly//return').map { |el| parse_return(el) },
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def validate!(doc)
|
36
|
+
schema_path = File.join(File.dirname(__FILE__), 'aeolus_v1.rng.xml')
|
37
|
+
schema = Nokogiri::XML::RelaxNG(open(schema_path))
|
38
|
+
errors = schema.validate(doc) || []
|
39
|
+
raise ValidationError unless errors.empty?
|
40
|
+
end
|
41
|
+
|
42
|
+
def parse_assembly(assembly)
|
43
|
+
name = assembly['name']
|
44
|
+
{
|
45
|
+
:name => name,
|
46
|
+
:type => :instance,
|
47
|
+
:hardware_profile => {:parameter => 'hardware_profile'},
|
48
|
+
:image => {:parameter => 'image'},
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
def parse_assembly_parameters(assembly)
|
53
|
+
[
|
54
|
+
assembly_parameter('image', assembly['name'], (assembly % 'image')['id']),
|
55
|
+
assembly_parameter('hardware_profile', assembly['name'], assembly['hwp']),
|
56
|
+
]
|
57
|
+
end
|
58
|
+
|
59
|
+
def assembly_parameter(name, assembly_name, default_value)
|
60
|
+
result = {
|
61
|
+
:type => :string,
|
62
|
+
:name => name,
|
63
|
+
:service => nil,
|
64
|
+
:resource => assembly_name,
|
65
|
+
|
66
|
+
}
|
67
|
+
result[:default] = default_value if default_value
|
68
|
+
|
69
|
+
result
|
70
|
+
end
|
71
|
+
|
72
|
+
def parse_service(service)
|
73
|
+
{
|
74
|
+
:name => service['name'],
|
75
|
+
:resource => service.ancestors('assembly').first['name'],
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
def parse_file(file, parameters)
|
80
|
+
assembly_name = file.ancestors('assembly').first['name']
|
81
|
+
service_name = file.ancestors('service').first['name']
|
82
|
+
|
83
|
+
result = {
|
84
|
+
:resource => assembly_name,
|
85
|
+
:service => service_name,
|
86
|
+
:location => File.join('/var/audrey/tooling/', service_name),
|
87
|
+
:owner => nil,
|
88
|
+
:group => nil,
|
89
|
+
:mode => '000644',
|
90
|
+
:executable => false,
|
91
|
+
}
|
92
|
+
|
93
|
+
url = file['url']
|
94
|
+
if url
|
95
|
+
result[:url] = url
|
96
|
+
result[:name] = File.basename(URI.parse(url).path)
|
97
|
+
else
|
98
|
+
contents = file % 'contents'
|
99
|
+
result[:name] = contents['name']
|
100
|
+
result[:contents] = contents.text
|
101
|
+
end
|
102
|
+
|
103
|
+
if file.name == 'executable'
|
104
|
+
result[:mode] = '000755'
|
105
|
+
result[:executable] = true
|
106
|
+
env_params = parameters.select do |p|
|
107
|
+
p[:resource] == assembly_name && p[:service] == service_name
|
108
|
+
end
|
109
|
+
result[:environment] = env_params.map do |p|
|
110
|
+
{
|
111
|
+
:name => "AUDREY_VAR_#{service_name}_#{p[:name]}",
|
112
|
+
:value => {:parameter => p[:name]},
|
113
|
+
}
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
result
|
118
|
+
end
|
119
|
+
|
120
|
+
def parse_parameter(parameter)
|
121
|
+
assembly_name = parameter.ancestors('assembly').first['name']
|
122
|
+
service_name = parameter.ancestors('service').first['name']
|
123
|
+
name = parameter['name']
|
124
|
+
|
125
|
+
result = {
|
126
|
+
:type => :string,
|
127
|
+
:name => name,
|
128
|
+
:service => service_name,
|
129
|
+
:resource => assembly_name,
|
130
|
+
:sensitive => false,
|
131
|
+
}
|
132
|
+
|
133
|
+
reference_el = parameter % 'reference'
|
134
|
+
if reference_el
|
135
|
+
result[:type] = :reference
|
136
|
+
result[:referenced_output] = {
|
137
|
+
:name => reference_el['parameter'],
|
138
|
+
:resource => reference_el['assembly'],
|
139
|
+
}
|
140
|
+
return result
|
141
|
+
end
|
142
|
+
|
143
|
+
value_el = parameter % 'value'
|
144
|
+
return result unless value_el
|
145
|
+
|
146
|
+
case value_el['type']
|
147
|
+
when 'scalar', nil, ''
|
148
|
+
result[:type] = :string
|
149
|
+
when 'password'
|
150
|
+
result[:type] = :string
|
151
|
+
result[:sensitive] = true
|
152
|
+
end
|
153
|
+
result[:default] = value_el.text
|
154
|
+
|
155
|
+
result
|
156
|
+
end
|
157
|
+
|
158
|
+
def parse_return(el)
|
159
|
+
{
|
160
|
+
:type => :facter,
|
161
|
+
:resource => el.ancestors('assembly').first['name'],
|
162
|
+
:name => el['name'],
|
163
|
+
}
|
164
|
+
end
|
165
|
+
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
@@ -0,0 +1,183 @@
|
|
1
|
+
<!--
|
2
|
+
|
3
|
+
Copyright (C) 2011 Red Hat, Inc.
|
4
|
+
Written by Greg Blomquist <gblomqui@redhat.com>
|
5
|
+
|
6
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
7
|
+
contributor license agreements. See the NOTICE file distributed with
|
8
|
+
this work for additional information regarding copyright ownership.
|
9
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
10
|
+
(the "License"); you may not use this file except in compliance with
|
11
|
+
the License. You may obtain a copy of the License at
|
12
|
+
|
13
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
|
15
|
+
Unless required by applicable law or agreed to in writing, software
|
16
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
See the License for the specific language governing permissions and
|
19
|
+
limitations under the License.
|
20
|
+
|
21
|
+
-->
|
22
|
+
|
23
|
+
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
|
24
|
+
|
25
|
+
<start>
|
26
|
+
<element name="deployable">
|
27
|
+
<optional>
|
28
|
+
<!-- make the version attribute optional for backwards compat -->
|
29
|
+
<attribute name="version">
|
30
|
+
<choice>
|
31
|
+
<value>1.0</value>
|
32
|
+
</choice>
|
33
|
+
</attribute>
|
34
|
+
</optional>
|
35
|
+
<attribute name="name"><text/></attribute>
|
36
|
+
<optional>
|
37
|
+
<attribute name="id"><text/></attribute>
|
38
|
+
</optional>
|
39
|
+
<optional>
|
40
|
+
<element name="description"><text/></element>
|
41
|
+
</optional>
|
42
|
+
<ref name="assemblies-definition"/>
|
43
|
+
</element>
|
44
|
+
</start>
|
45
|
+
|
46
|
+
<!-- Each assembly describes an instance to launch as part of this deployable
|
47
|
+
-->
|
48
|
+
<define name="assemblies-definition">
|
49
|
+
<element name="assemblies">
|
50
|
+
<oneOrMore>
|
51
|
+
<element name="assembly">
|
52
|
+
<attribute name="name"><text/></attribute>
|
53
|
+
<!-- the hwp is the hardware profile that will be matched against a
|
54
|
+
provider -->
|
55
|
+
<attribute name="hwp"><text/></attribute>
|
56
|
+
<!-- the image id corresponds to an image warehouse image id -->
|
57
|
+
<element name="image">
|
58
|
+
<attribute name="id"><text/></attribute>
|
59
|
+
<optional>
|
60
|
+
<attribute name="build"><text/></attribute>
|
61
|
+
</optional>
|
62
|
+
</element>
|
63
|
+
<optional>
|
64
|
+
<ref name="services-definition"/>
|
65
|
+
</optional>
|
66
|
+
<optional>
|
67
|
+
<ref name="return-values-definition"/>
|
68
|
+
</optional>
|
69
|
+
</element>
|
70
|
+
</oneOrMore>
|
71
|
+
</element>
|
72
|
+
</define>
|
73
|
+
|
74
|
+
<!-- services describe the configuration that should be included in the
|
75
|
+
launched instance -->
|
76
|
+
<define name="services-definition">
|
77
|
+
<element name="services">
|
78
|
+
<oneOrMore>
|
79
|
+
<element name="service">
|
80
|
+
<attribute name="name"><text/></attribute>
|
81
|
+
<optional>
|
82
|
+
<element name="description"><text/></element>
|
83
|
+
</optional>
|
84
|
+
<ref name="service-configuration-definition"/>
|
85
|
+
</element>
|
86
|
+
</oneOrMore>
|
87
|
+
</element>
|
88
|
+
</define>
|
89
|
+
|
90
|
+
<!-- service describes the executable, additional files, and runtime
|
91
|
+
parameters that should be propagated to the launched instance -->
|
92
|
+
<define name="service-configuration-definition">
|
93
|
+
<ref name="configuration-executable-definition"/>
|
94
|
+
<optional>
|
95
|
+
<element name="files">
|
96
|
+
<oneOrMore>
|
97
|
+
<ref name="configuration-file-definition"/>
|
98
|
+
</oneOrMore>
|
99
|
+
</element>
|
100
|
+
</optional>
|
101
|
+
<optional>
|
102
|
+
<element name="parameters">
|
103
|
+
<oneOrMore>
|
104
|
+
<ref name="configuration-parameter-definition"/>
|
105
|
+
</oneOrMore>
|
106
|
+
</element>
|
107
|
+
</optional>
|
108
|
+
</define>
|
109
|
+
|
110
|
+
<define name="configuration-executable-definition">
|
111
|
+
<element name="executable">
|
112
|
+
<choice>
|
113
|
+
<attribute name="url"><text/></attribute>
|
114
|
+
<element name="contents"><text/></element>
|
115
|
+
</choice>
|
116
|
+
</element>
|
117
|
+
</define>
|
118
|
+
|
119
|
+
<define name="configuration-file-definition">
|
120
|
+
<element name="file">
|
121
|
+
<choice>
|
122
|
+
<attribute name="url"><text/></attribute>
|
123
|
+
<element name="contents">
|
124
|
+
<attribute name="filename"><text/></attribute>
|
125
|
+
<text/>
|
126
|
+
</element>
|
127
|
+
</choice>
|
128
|
+
</element>
|
129
|
+
</define>
|
130
|
+
|
131
|
+
<define name="configuration-parameter-definition">
|
132
|
+
<element name="parameter">
|
133
|
+
<attribute name="name"><text/></attribute>
|
134
|
+
<!-- type is deprecated here, it's proper use is on the value
|
135
|
+
tag. it can be removed is 1.2 -->
|
136
|
+
<optional>
|
137
|
+
<attribute name="type">
|
138
|
+
<choice>
|
139
|
+
<!-- only supporting scalar and password types for now -->
|
140
|
+
<value>scalar</value>
|
141
|
+
<!-- password types simply indicate that the UI collecting the
|
142
|
+
value should obscure the input field's value -->
|
143
|
+
<value>password</value>
|
144
|
+
</choice>
|
145
|
+
</attribute>
|
146
|
+
</optional>
|
147
|
+
<choice>
|
148
|
+
<empty/>
|
149
|
+
<element name="value">
|
150
|
+
<text/>
|
151
|
+
<optional>
|
152
|
+
<attribute name="type">
|
153
|
+
<choice>
|
154
|
+
<!-- only supporting scalar and password types for now -->
|
155
|
+
<value>scalar</value>
|
156
|
+
<!-- password types simply indicate that the UI collecting the
|
157
|
+
value should obscure the input field's value -->
|
158
|
+
<value>password</value>
|
159
|
+
</choice>
|
160
|
+
</attribute>
|
161
|
+
</optional>
|
162
|
+
</element>
|
163
|
+
<element name="reference">
|
164
|
+
<attribute name="assembly"><text/></attribute>
|
165
|
+
<choice>
|
166
|
+
<attribute name="parameter"><text/></attribute>
|
167
|
+
<attribute name="service"><text/></attribute>
|
168
|
+
</choice>
|
169
|
+
</element>
|
170
|
+
</choice>
|
171
|
+
</element>
|
172
|
+
</define>
|
173
|
+
|
174
|
+
<define name="return-values-definition">
|
175
|
+
<element name="returns">
|
176
|
+
<oneOrMore>
|
177
|
+
<element name="return">
|
178
|
+
<attribute name="name"><text/></attribute>
|
179
|
+
</element>
|
180
|
+
</oneOrMore>
|
181
|
+
</element>
|
182
|
+
</define>
|
183
|
+
</grammar>
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# Copyright 2012 Red Hat, Inc.
|
2
|
+
# Licensed under the Apache License, Version 2.0, see README for details.
|
3
|
+
|
4
|
+
require 'spec_helper'
|
5
|
+
require 'cbf'
|
6
|
+
|
7
|
+
describe 'Aeolus deployable version 1 parser' do
|
8
|
+
it "must advertise the Aeolus version 1 format" do
|
9
|
+
CBF.parsers.must_include :aeolus_v1
|
10
|
+
end
|
11
|
+
|
12
|
+
it "must successfully parse the wordpress deployable" do
|
13
|
+
deployable_path = "#{SAMPLES_PATH}/aeolus_v1/wordpress.xml"
|
14
|
+
result = CBF.parse(:aeolus_v1, open(deployable_path))
|
15
|
+
result[:name].must_equal "Wordpress Multi-Instance Deployable"
|
16
|
+
result[:description].must_equal "This is an example of a multi deployment that deploys wordpress across an apache and mysql instance"
|
17
|
+
|
18
|
+
result[:resources].count.must_equal 2
|
19
|
+
result[:resources][0][:name].must_equal "webserver"
|
20
|
+
result[:resources][1][:name].must_equal "database"
|
21
|
+
|
22
|
+
result[:services].count.must_equal 2
|
23
|
+
result[:services][0][:name].must_equal "http"
|
24
|
+
result[:services][1][:name].must_equal "mysql"
|
25
|
+
|
26
|
+
http_params = result[:parameters].select do
|
27
|
+
|p| p[:resource] == "webserver" && p[:service] == "http"
|
28
|
+
end
|
29
|
+
http_params.count.must_equal 6
|
30
|
+
|
31
|
+
mysql_params = result[:parameters].select do
|
32
|
+
|p| p[:resource] == "database" && p[:service] == "mysql"
|
33
|
+
end
|
34
|
+
mysql_params.count.must_equal 5
|
35
|
+
|
36
|
+
result[:files].count.must_equal 3
|
37
|
+
result[:files].select { |f| f[:executable] }.count.must_equal 2
|
38
|
+
|
39
|
+
result[:outputs].count.must_equal 5
|
40
|
+
end
|
41
|
+
|
42
|
+
it "must successfully parse the drupal deployable" do
|
43
|
+
deployable_path = "#{SAMPLES_PATH}/aeolus_v1/drupal.xml"
|
44
|
+
CBF.parse(:aeolus_v1, open(deployable_path))
|
45
|
+
end
|
46
|
+
|
47
|
+
it "must successfully parse the sample deployable" do
|
48
|
+
deployable_path = "#{SAMPLES_PATH}/aeolus_v1/sample.xml"
|
49
|
+
CBF.parse(:aeolus_v1, open(deployable_path))
|
50
|
+
end
|
51
|
+
|
52
|
+
it "must fail for invalid XML" do
|
53
|
+
proc do
|
54
|
+
CBF.parse(:aeolus_v1, '<deployable')
|
55
|
+
end.must_raise CBF::SyntaxError
|
56
|
+
end
|
57
|
+
|
58
|
+
it "must fail for invalid Deployable format" do
|
59
|
+
proc do
|
60
|
+
CBF.parse(:aeolus_v1, '<deployable></deployable>')
|
61
|
+
end.must_raise CBF::ValidationError
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
<deployable version="1.0" name="Drupal Multi-Instance Deployable">
|
2
|
+
<description>This is an example of a multi deployment that deploys drupal across an apache and mysql instance</description>
|
3
|
+
<assemblies>
|
4
|
+
<!-- The Drupal Assembly represents the instance that will be running apache
|
5
|
+
(httpd) with drupal7.-->
|
6
|
+
<assembly name="drupal" hwp="large">
|
7
|
+
<image id="DRUPAL_IMAGE_ID"/> <!-- replace your own image ID here -->
|
8
|
+
<services>
|
9
|
+
<service name="http">
|
10
|
+
<executable url="https://raw.github.com/aeolusproject/audrey/master/examples/drupal/drupal-http.py"/>
|
11
|
+
<files>
|
12
|
+
<file url="https://raw.github.com/aeolusproject/audrey/master/examples/drupal/settings.php"/>
|
13
|
+
</files>
|
14
|
+
<parameters>
|
15
|
+
<parameter name="db_name" type="scalar">
|
16
|
+
<value>drupal</value>
|
17
|
+
</parameter>
|
18
|
+
<parameter name="db_user" type="scalar">
|
19
|
+
<value>drupal</value>
|
20
|
+
</parameter>
|
21
|
+
<parameter name="db_pw" type="password">
|
22
|
+
<value>password</value>
|
23
|
+
</parameter>
|
24
|
+
<parameter name="db_ip" type="scalar">
|
25
|
+
<reference assembly="mysql" parameter="ipaddress"/>
|
26
|
+
</parameter>
|
27
|
+
<parameter name="db_hostname" type="scalar">
|
28
|
+
<reference assembly="mysql" parameter="hostname"/>
|
29
|
+
</parameter>
|
30
|
+
<parameter name="dbup" type="scalar">
|
31
|
+
<reference assembly="mysql" parameter="dbup"/>
|
32
|
+
</parameter>
|
33
|
+
</parameters>
|
34
|
+
</service>
|
35
|
+
</services>
|
36
|
+
<returns>
|
37
|
+
<return name="hostname"/>
|
38
|
+
<return name="ipaddress"/>
|
39
|
+
</returns>
|
40
|
+
</assembly>
|
41
|
+
<assembly name="mysql" hwp="large">
|
42
|
+
<image id="MYSQL_IMAGE_ID"/>
|
43
|
+
<services>
|
44
|
+
<service name="mysql">
|
45
|
+
<executable url="https://raw.github.com/aeolusproject/audrey/master/examples/drupal/drupal-mysql.py"/>
|
46
|
+
<files>
|
47
|
+
<file url="https://raw.github.com/aeolusproject/audrey/master/examples/drupal/dbup.rb"/>
|
48
|
+
</files>
|
49
|
+
<parameters>
|
50
|
+
<parameter name="db_name" type="scalar">
|
51
|
+
<value>drupal</value>
|
52
|
+
</parameter>
|
53
|
+
<parameter name="db_user" type="scalar">
|
54
|
+
<value>drupal</value>
|
55
|
+
</parameter>
|
56
|
+
<parameter name="db_pw" type="password">
|
57
|
+
<value>password</value>
|
58
|
+
</parameter>
|
59
|
+
<parameter name="apache_ip" type="scalar">
|
60
|
+
<reference assembly="drupal" parameter="ipaddress"/>
|
61
|
+
</parameter>
|
62
|
+
<parameter name="apache_hostname" type="scalar">
|
63
|
+
<reference assembly="drupal" parameter="hostname"/>
|
64
|
+
</parameter>
|
65
|
+
</parameters>
|
66
|
+
</service>
|
67
|
+
</services>
|
68
|
+
<returns>
|
69
|
+
<return name="hostname"/>
|
70
|
+
<return name="ipaddress"/>
|
71
|
+
<return name="dbup"/>
|
72
|
+
</returns>
|
73
|
+
</assembly>
|
74
|
+
</assemblies>
|
75
|
+
</deployable>
|
@@ -0,0 +1,114 @@
|
|
1
|
+
<!-- A deployable represents a set of instances to launch and configure at the
|
2
|
+
same time. -->
|
3
|
+
<deployable version="1.0" name="multi-instance-multi-service">
|
4
|
+
<description>Deploys multiple instances with multiple services</description>
|
5
|
+
<assemblies>
|
6
|
+
<!-- When a deployable is launched, each assembly defition in this file
|
7
|
+
will map to a launched instance.
|
8
|
+
The assembly name should uniquely identify the assembly in this file.
|
9
|
+
The assembly "hwp" (hardware profile) should match a hardware profile
|
10
|
+
setup in Cloud Engine.-->
|
11
|
+
<assembly name="Instance-1" hwp="large">
|
12
|
+
<!-- This image element references an image that exists in the image
|
13
|
+
warehouse.
|
14
|
+
Images get into the image warehouse either by building the
|
15
|
+
image from a template XML file, or by importing from an
|
16
|
+
external source (such as an Amazon AMI). -->
|
17
|
+
<image id="INSERT IMAGE ID"/>
|
18
|
+
<services>
|
19
|
+
<!-- A "service" in a deployable is simply a way to group common
|
20
|
+
post-launch configurations together.
|
21
|
+
Each service contains:
|
22
|
+
- an executable script that performs the configuration
|
23
|
+
- parameters collected at launch time that are fed into the
|
24
|
+
executable script by the Audrey Agent post-launch
|
25
|
+
- additional files that can be used by the executable script for
|
26
|
+
configuring the guest -->
|
27
|
+
<service name="service1">
|
28
|
+
<!-- This is a URL that the Audrey Configuration Server must be
|
29
|
+
able to access, and points to a script that is meant to
|
30
|
+
setup the service.
|
31
|
+
The user will be responsible for authoring and providing
|
32
|
+
this script. -->
|
33
|
+
<executable url="https://www.aeolusproject.org/redmine/attachments/download/169/start_simple"/>
|
34
|
+
<!-- The parameters that are fed into the "start_simple" script
|
35
|
+
above are identified here in the "parameters" section. -->
|
36
|
+
<parameters>
|
37
|
+
<!-- Parameter values will be collected at launch time.
|
38
|
+
The user launching the deployment will have an opportunity to
|
39
|
+
provide values for all parameters, whether they have default
|
40
|
+
values or not. -->
|
41
|
+
<!-- Only scalar parameter types are going to be supported
|
42
|
+
initially. -->
|
43
|
+
<parameter name="service_1_param_1">
|
44
|
+
<!-- Default values can be provided directly in the deployable. -->
|
45
|
+
<value type="scalar"><![CDATA[value 1]]></value>
|
46
|
+
</parameter>
|
47
|
+
<parameter name="service_1_param_2"/>
|
48
|
+
</parameters>
|
49
|
+
</service>
|
50
|
+
<service name="service2">
|
51
|
+
<executable url="https://www.aeolusproject.org/redmine/attachments/download/169/start_simple"/>
|
52
|
+
<parameters>
|
53
|
+
<parameter name="service_2_param_1">
|
54
|
+
<value type="scalar"><![CDATA[value 1]]></value>
|
55
|
+
</parameter>
|
56
|
+
<parameter name="service_2_param_2">
|
57
|
+
<value type="scalar"><![CDATA[value 2]]></value>
|
58
|
+
</parameter>
|
59
|
+
</parameters>
|
60
|
+
</service>
|
61
|
+
</services>
|
62
|
+
<!-- The elements listed under the "returns" element are values that
|
63
|
+
are collected by the launched guest and returned to the
|
64
|
+
configuration server.
|
65
|
+
The values that are returned to the configuration server can be
|
66
|
+
shared with other launched instances in this deployable. -->
|
67
|
+
<returns>
|
68
|
+
<return name="hostname"/>
|
69
|
+
</returns>
|
70
|
+
</assembly>
|
71
|
+
<assembly name="Instance-2" hwp="large">
|
72
|
+
<image id="INSERT IMAGE ID"/>
|
73
|
+
<services>
|
74
|
+
<service name="service3">
|
75
|
+
<executable>
|
76
|
+
<contents><![CDATA[#!/bin/bash
|
77
|
+
echo hello, world!
|
78
|
+
]]></contents>
|
79
|
+
</executable>
|
80
|
+
<files>
|
81
|
+
<file url="http://example.com/file" />
|
82
|
+
<file>
|
83
|
+
<contents filename="thingy.conf"><![CDATA[name: hello]]></contents>
|
84
|
+
</file>
|
85
|
+
</files>
|
86
|
+
<parameters>
|
87
|
+
<parameter name="service_3_param_1">
|
88
|
+
<value type="scalar"><![CDATA[value 1]]></value>
|
89
|
+
</parameter>
|
90
|
+
<parameter name="service_3_param_2">
|
91
|
+
<value type="scalar"><![CDATA[value 2]]></value>
|
92
|
+
</parameter>
|
93
|
+
</parameters>
|
94
|
+
</service>
|
95
|
+
<service name="service4">
|
96
|
+
<executable url="https://www.aeolusproject.org/redmine/attachments/download/169/start_simple"/>
|
97
|
+
<parameters>
|
98
|
+
<parameter name="service_4_param_1">
|
99
|
+
<value type="scalar"><![CDATA[value 1]]></value>
|
100
|
+
</parameter>
|
101
|
+
<!-- Parameters can also reference "returns" from other assemblies.
|
102
|
+
In this example, Instance-2 requests the "hostname" return value from Instance-1. -->
|
103
|
+
<parameter name="service_4_param_2">
|
104
|
+
<reference assembly="Instance-1" parameter="hostname"/>
|
105
|
+
</parameter>
|
106
|
+
</parameters>
|
107
|
+
</service>
|
108
|
+
</services>
|
109
|
+
<returns>
|
110
|
+
<return name="hostname"/>
|
111
|
+
</returns>
|
112
|
+
</assembly>
|
113
|
+
</assemblies>
|
114
|
+
</deployable>
|
@@ -0,0 +1,79 @@
|
|
1
|
+
<deployable name="Wordpress Multi-Instance Deployable">
|
2
|
+
<description>This is an example of a multi deployment that deploys wordpress across an apache and mysql instance</description>
|
3
|
+
<assemblies>
|
4
|
+
<assembly hwp="small-x86_64" name="webserver">
|
5
|
+
<image id="APACHE_IMAGE_ID"/>
|
6
|
+
<services>
|
7
|
+
<service name="http">
|
8
|
+
<!-- This script file is executed on the Apache node, after the MySQL node -->
|
9
|
+
<!-- finishes running it's database setup script (as per comments below in -->
|
10
|
+
<!-- its section). On this node, the script runs Wordpress's installer, -->
|
11
|
+
<!-- giving it the MySQL database connection details, and some other basic -->
|
12
|
+
<!-- parameters. -->
|
13
|
+
<executable url="https://raw.github.com/aeolusproject/audrey/master/examples/wordpress/wordpress-http.sh"/>
|
14
|
+
<parameters>
|
15
|
+
<parameter name="wp_name">
|
16
|
+
<value>wordpress</value>
|
17
|
+
</parameter>
|
18
|
+
<parameter name="wp_user">
|
19
|
+
<value>wordpress</value>
|
20
|
+
</parameter>
|
21
|
+
<parameter name="wp_pw">
|
22
|
+
<value type="password">wordpress</value>
|
23
|
+
</parameter>
|
24
|
+
<parameter name="mysql_ip">
|
25
|
+
<reference assembly="mysql" parameter="ipaddress"/>
|
26
|
+
</parameter>
|
27
|
+
<parameter name="mysql_hostname">
|
28
|
+
<reference assembly="mysql" parameter="hostname"/>
|
29
|
+
</parameter>
|
30
|
+
<parameter name="mysql_dbup">
|
31
|
+
<reference assembly="mysql" parameter="dbup"/>
|
32
|
+
</parameter>
|
33
|
+
</parameters>
|
34
|
+
</service>
|
35
|
+
</services>
|
36
|
+
<returns>
|
37
|
+
<return name="hostname"/>
|
38
|
+
<return name="ipaddress"/>
|
39
|
+
</returns>
|
40
|
+
</assembly>
|
41
|
+
<assembly hwp="small-x86_64" name="database">
|
42
|
+
<image id="MYSQL_IMAGE_ID"/>
|
43
|
+
<services>
|
44
|
+
<service name="mysql">
|
45
|
+
<!-- This script file is executed on the MySQL node. It creates the "wordpress" -->
|
46
|
+
<!-- user in the MySQL database, and an empty "wordpress" database owned by it. -->
|
47
|
+
<!-- When this script has finished, Audrey then goes on to configure the apache -->
|
48
|
+
<!-- node (above). -->
|
49
|
+
<executable url="https://raw.github.com/aeolusproject/audrey/master/examples/wordpress/wordpress-mysql.sh"/>
|
50
|
+
<files>
|
51
|
+
<file url="https://raw.github.com/aeolusproject/audrey/master/examples/wordpress/dbup.rb"/>
|
52
|
+
</files>
|
53
|
+
<parameters>
|
54
|
+
<parameter name="wp_name">
|
55
|
+
<value>wordpress</value>
|
56
|
+
</parameter>
|
57
|
+
<parameter name="wp_user">
|
58
|
+
<value>wordpress</value>
|
59
|
+
</parameter>
|
60
|
+
<parameter name="wp_pw">
|
61
|
+
<value type="password">wordpress</value>
|
62
|
+
</parameter>
|
63
|
+
<parameter name="apache_ip">
|
64
|
+
<reference assembly="apache" parameter="ipaddress"/>
|
65
|
+
</parameter>
|
66
|
+
<parameter name="apache_hostname">
|
67
|
+
<reference assembly="apache" parameter="hostname"/>
|
68
|
+
</parameter>
|
69
|
+
</parameters>
|
70
|
+
</service>
|
71
|
+
</services>
|
72
|
+
<returns>
|
73
|
+
<return name="hostname"/>
|
74
|
+
<return name="ipaddress"/>
|
75
|
+
<return name="dbup"/>
|
76
|
+
</returns>
|
77
|
+
</assembly>
|
78
|
+
</assemblies>
|
79
|
+
</deployable>
|