beaker 2.44.0 → 2.45.0

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.
Files changed (37) hide show
  1. checksums.yaml +8 -8
  2. data/CONTRIBUTING.md +7 -2
  3. data/HISTORY.md +200 -2
  4. data/acceptance/tests/puppet/web_helpers_test.rb +55 -0
  5. data/docs/Beaker-Libraries.md +2 -0
  6. data/docs/How-To-Beaker.md +0 -1
  7. data/docs/README.md +1 -1
  8. data/docs/how_to/change_terminal_output_coloring.md +32 -0
  9. data/docs/hypervisors/README.md +1 -1
  10. data/docs/hypervisors/openstack.md +80 -4
  11. data/docs/hypervisors/vagrant.md +40 -2
  12. data/docs/runner/test_run.md +31 -0
  13. data/lib/beaker/cli.rb +3 -3
  14. data/lib/beaker/dsl/helpers/web_helpers.rb +13 -4
  15. data/lib/beaker/dsl/install_utils/foss_utils.rb +1 -1
  16. data/lib/beaker/dsl/install_utils/windows_utils.rb +3 -3
  17. data/lib/beaker/host.rb +21 -1
  18. data/lib/beaker/host/unix/pkg.rb +1 -1
  19. data/lib/beaker/hypervisor/openstack.rb +1 -1
  20. data/lib/beaker/hypervisor/vagrant.rb +15 -1
  21. data/lib/beaker/options/hosts_file_parser.rb +54 -14
  22. data/lib/beaker/options/parser.rb +37 -3
  23. data/lib/beaker/options/presets.rb +2 -2
  24. data/lib/beaker/version.rb +1 -1
  25. data/spec/beaker/cli_spec.rb +4 -1
  26. data/spec/beaker/dsl/install_utils/foss_utils_spec.rb +37 -60
  27. data/spec/beaker/dsl/install_utils/windows_utils_spec.rb +3 -3
  28. data/spec/beaker/host/unix/pkg_spec.rb +20 -0
  29. data/spec/beaker/host_prebuilt_steps_spec.rb +7 -7
  30. data/spec/beaker/host_spec.rb +44 -0
  31. data/spec/beaker/hypervisor/openstack_spec.rb +66 -0
  32. data/spec/beaker/hypervisor/vagrant_spec.rb +99 -0
  33. data/spec/beaker/options/hosts_file_parser_spec.rb +95 -22
  34. data/spec/beaker/options/parser_spec.rb +93 -1
  35. data/spec/helpers.rb +10 -2
  36. metadata +6 -3
  37. data/docs/Overview.md +0 -31
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzkwYzhjYjQ1MzhmOWIxMTQ0MmNmNmE1Mjk3ZjEzYWFlMjhjMTQzMQ==
4
+ ZWY3ZTBjNzU5ZTJlYWVlYzJmOWRlZjQ1NTBlZjQ2ZWIzZWFlNTNiNQ==
5
5
  data.tar.gz: !binary |-
6
- MmI4ZTk0ZmEwMjkxYjRhZjlmZGNiMzljZmZlZmM2NzkxZTY3NmJjNQ==
6
+ NDgwZWI3NWIyY2NmMWVhNmQxYWE3MGNiMjk0M2NlZmQ1MzYwMmJjZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YmY4YTg1ZWEyNjE0OTMwYjZiNjQ3YWM0YzU3YTlhNGMzNDAxMWUzNjgyOWVh
10
- MWM2MWQ3N2UzZDBiNDhiMDY5NGI2MWYzOTNlYjhhYWVkMTBkNTFmYjFiM2Zl
11
- MWU5ZGMwOGZhNDBhMDk3ZDE0OGU0YmY3ZTE5N2QzZTk2NGU4Y2M=
9
+ NDkzNzZiZDQ1MDQ5NGViYTJiNTI3MTE0ODQyZGM1Yzc3YzRiZGQ2OGY4NzUz
10
+ Zjg1NjMwMjdlZTA3MjNhYmI3MjczOWYwOGFiN2EzNWNhZDI5NDY0ZDhlMGNl
11
+ Nzc5YTIxMjVmMDlkMjJlMmUzNzVkNThiYTg0NzcxNDljYzcyOGM=
12
12
  data.tar.gz: !binary |-
13
- ZjlhNzg0OGJmOTM3YTkzZGU1YTQ1YjZkODE5ZGZjMGY5ODMxYjRjMDRhNjY1
14
- OTE3ZGRjZTEwNzcxMmU4MmNmYjZjNTc2YTBmMjM4NDVjMGI2M2RkMjU3N2Nh
15
- NzMxY2ViMzcxMThjODllYjVjM2E1ZDc5NGVhYzk5YjM5NTlhY2Y=
13
+ NTFkNTU0OTBhMGMyZWI3OWI0MmI5YmQ5ZTJjNGM5NTQ3MjIyNzdlZTVjODUx
14
+ MDkxYmU0MzE1ZjhjZTNmOGI4NDA5MzY0M2QyNWJlODUxODAxYjQyY2NiMzdj
15
+ OWRkNDNiYTU3MjY0NWU5MzM3MGRmY2Y3NDY1NjczMjNlZGY3N2Q=
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Getting Started
4
4
 
5
- * Create a [Jira account](http://tickets.puppetlabs.com)
5
+ * If it is accessible to you, create a [Jira account](http://tickets.puppetlabs.com)
6
6
  * Make sure you have a [GitHub account](https://github.com/signup/free)
7
7
  * Submit a ticket for your issue, assuming one does not already exist.
8
8
  * Clearly describe the issue including steps to reproduce when it is a bug.
@@ -46,8 +46,13 @@
46
46
 
47
47
  ### Maintenance
48
48
 
49
- **We are no longer accepting PRs marked as `(MAINT)` - all PRs must be associated with a Beaker Jira ticket number for book keeping purposes.**
49
+ For changes of a trivial nature, it is not always necessary to create a new ticket in Jira. In this case, it is appropriate to start the first line of a commit with `(MAINT)` instead of a ticket/issue number.
50
50
 
51
+ ````
52
+ (MAINT) Fix whitespace
53
+
54
+ - remove additional spaces that appear at EOL
55
+ ````
51
56
  ### Version Bump For Gem Release
52
57
 
53
58
  To prepare for a new gem release of Beaker the `version.rb` file is updated with the upcoming gem version number. This is submitted with `(GEM)` instead of a ticket/issue number.
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 9 Jun, 2016 (0d267d3d)](#LATEST)
3
+ * [LATEST - 29 Jun, 2016 (428f959a)](#LATEST)
4
+ * [2.44.0 - 9 Jun, 2016 (38dfb77f)](#2.44.0)
4
5
  * [2.43.0 - 1 Jun, 2016 (777469ca)](#2.43.0)
5
6
  * [2.42.0 - 23 May, 2016 (c245fef7)](#2.42.0)
6
7
  * [2.41.0 - 10 May, 2016 (17c745bd)](#2.41.0)
@@ -120,7 +121,204 @@
120
121
  * [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
121
122
 
122
123
  ## Details
123
- ### <a name = "LATEST">LATEST - 9 Jun, 2016 (0d267d3d)
124
+ ### <a name = "LATEST">LATEST - 29 Jun, 2016 (428f959a)
125
+
126
+ * (GEM) update beaker version to 2.45.0 (428f959a)
127
+
128
+ * Merge pull request #1143 from kevpl/bkr814_error_output (61343618)
129
+
130
+
131
+ ```
132
+ Merge pull request #1143 from kevpl/bkr814_error_output
133
+
134
+ (MAINT) improved error output from beaker-hostgenerator workflow
135
+ ```
136
+ * Merge pull request #1161 from johnduarte/bkr-856-add-el-sles-to-remove-puppet (2a9070cd)
137
+
138
+
139
+ ```
140
+ Merge pull request #1161 from johnduarte/bkr-856-add-el-sles-to-remove-puppet
141
+
142
+ (BKR-856) Add el/sles support to remove_puppet_on
143
+ ```
144
+ * (BKR-799) Use DNF for Uninstall Fedora 22+ (#1156) (e1e6c5e5)
145
+
146
+
147
+ ```
148
+ (BKR-799) Use DNF for Uninstall Fedora 22+ (#1156)
149
+
150
+ * Missed out in original PR
151
+ ```
152
+ * Merge pull request #1162 from puppetlabs/revert-974-maint (e71875c9)
153
+
154
+
155
+ ```
156
+ Merge pull request #1162 from puppetlabs/revert-974-maint
157
+
158
+ Revert "(BKR-568) no longer accept PRs marked as "(MAINT)""
159
+ ```
160
+ * Revert "(BKR-568) no longer accept PRs marked as "(MAINT)"" (1397371a)
161
+
162
+ * (BKR-856) Add el/sles support to remove_puppet_on (50bca276)
163
+
164
+
165
+ ```
166
+ (BKR-856) Add el/sles support to remove_puppet_on
167
+
168
+ This commit expands platform support for the `remove_puppet_on` install
169
+ helper method to include `sles` and all `el` derivatives.
170
+
171
+ This allows hosts declared with a `hypervisor` of `none` on these
172
+ platforms to have puppet uninstalled as part of a pre-suite.
173
+ ```
174
+ * (BKR-355) - Adding acceptance tests for web_helper methods. (#1140) (43f41603)
175
+
176
+
177
+ ```
178
+ (BKR-355) - Adding acceptance tests for web_helper methods. (#1140)
179
+
180
+ * (BKR-355) - Adding acceptance tests for web_helper methods.
181
+
182
+ * (BKR-355) - changes based on comments
183
+
184
+ * (BKR-355) Moving test to puppet level so that ruby is installed for these tests.
185
+ ```
186
+ * (MAINT) Changed link for lxc hypervisor (#1158) (07ae263f)
187
+
188
+ * (BKR-24) Added "change_terminal_output_coloring.md" to describe how to change terminal colors in Beaker. (#1153) (128dae6d)
189
+
190
+
191
+ ```
192
+ (BKR-24) Added "change_terminal_output_coloring.md" to describe how to change terminal colors in Beaker. (#1153)
193
+
194
+ [skip ci]
195
+ ```
196
+ * (MAINT) Fix typo (#1157) (695b6ef1)
197
+
198
+ * (BKR-853) Update epel_url and epel_7_pkg presets (#1155) (c27113e1)
199
+
200
+
201
+ ```
202
+ (BKR-853) Update epel_url and epel_7_pkg presets (#1155)
203
+
204
+ * (BKR-853) Update epel_7_pkg preset
205
+
206
+ * (BKR-853) Use master mirror for epel_url preset
207
+
208
+ This changes the default to point to the master mirror outlined in the
209
+ documentation here: https://fedoraproject.org/wiki/EPEL/FAQ
210
+
211
+ * (BKR-853) Update spec tests for epel preset changes
212
+ ```
213
+ * Merge pull request #1141 from Iristyle/maint/master/log-windows-versions-fix (ad6bf66e)
214
+
215
+
216
+ ```
217
+ Merge pull request #1141 from Iristyle/maint/master/log-windows-versions-fix
218
+
219
+ (maint) Extra quoting for Windows versions.txt
220
+ ```
221
+ * (BKR-840) Added a new file test_run.md and deleted Overview.md (#1147) (fdd2c7e3)
222
+
223
+
224
+ ```
225
+ (BKR-840) Added a new file test_run.md and deleted Overview.md (#1147)
226
+
227
+ Removed extra space from README.md
228
+ Added logger.rb
229
+ [skip ci]
230
+ ```
231
+ * (BKR-843) Use hypervisor specific logic for ip (#1149) (9b4f088d)
232
+
233
+
234
+ ```
235
+ (BKR-843) Use hypervisor specific logic for ip (#1149)
236
+
237
+ * (BKR-843) Use hypervisor specific logic for ip
238
+
239
+ When determining the ip address of a machine, beaker normally ssh'd into
240
+ the box and would run a command that would return the ip configured on
241
+ that box. However, this doesn't work for several cloud hypervisors, as
242
+ the public ip of the box may not match the internally configured ip
243
+ address. This change allows for hypervisor specific logic to be executed
244
+ instead of sshing into the box. Specifically, this commit changes all
245
+ ec2 instances to use the public ip address instead of the private one.
246
+
247
+ * (BKR-843) Curl ec2 for ip in case of --no-provision
248
+
249
+ When there is no ec2 instance object created, the #get_public_ip method
250
+ needs to use curl on the box instead of using the instance object to
251
+ determine its ip. This will be the case when users add the no-provision
252
+ flag.
253
+
254
+ * (BKR-843) Add case for Windows ec2 instances for #get_public_ip
255
+ ```
256
+ * (maint) link to beaker template from beaker library docs (#1142) (e2da65b8)
257
+
258
+
259
+ ```
260
+ (maint) link to beaker template from beaker library docs (#1142)
261
+
262
+ beaker-library howto is tough to find from beaker docs. This change
263
+ links to it from the beaker-library list in docs
264
+
265
+ [skip ci]
266
+ ```
267
+ * (MAINT) Fix broken link to Vagrant Hosts examples (#1145) (f5b28947)
268
+
269
+ * (MAINT) improved error output from beaker-hostgenerator workflow (8d22da0a)
270
+
271
+ * Merge pull request #1130 from kevpl/bkr814_hostgenerator_syntax (806e6fa8)
272
+
273
+
274
+ ```
275
+ Merge pull request #1130 from kevpl/bkr814_hostgenerator_syntax
276
+
277
+ (BKR-814) added beaker-hostgenerator syntax to hosts arg
278
+ ```
279
+ * (maint) Extra quoting for Windows versions.txt (36d7cbe9)
280
+
281
+
282
+ ```
283
+ (maint) Extra quoting for Windows versions.txt
284
+
285
+ - Adds quotes around the "if exist path type path" command passed to
286
+ cmd.exe, which also requires that quotes around filenames have
287
+ their quoting escaped
288
+ ```
289
+ * (BKR-685) Support openstack user_data (#1135) (5446a768)
290
+
291
+
292
+ ```
293
+ (BKR-685) Support openstack user_data (#1135)
294
+
295
+ * (BKR-685) Support openstack user_data
296
+
297
+ * (BKR-685) add tests for Openstack hypervisor
298
+
299
+ * (BKR-685) refactor openstack spec
300
+
301
+ * (BKR-685) remove duplicate snapshot key
302
+
303
+ * (BKR-685) add user_data field to openstack dock file
304
+ ```
305
+ * (BKR-827) Vagrant port forwarding (#1133) (7090641f)
306
+
307
+
308
+ ```
309
+ (BKR-827) Vagrant port forwarding (#1133)
310
+
311
+ * (BKR-827) Adding port forwarding support.
312
+
313
+ * (BKR-827) Adding support for all vagrant parameters.
314
+
315
+ * (BKR-827) Adding documentation.
316
+ ```
317
+ * (BKR-814) added beaker-hostgenerator syntax to hosts arg (6e15ae58)
318
+
319
+ ### <a name = "2.44.0">2.44.0 - 9 Jun, 2016 (38dfb77f)
320
+
321
+ * (HISTORY) update beaker history for gem release 2.44.0 (38dfb77f)
124
322
 
125
323
  * (GEM) update beaker version to 2.44.0 (0d267d3d)
126
324
 
@@ -0,0 +1,55 @@
1
+ require 'helpers/test_helper'
2
+ require 'webrick'
3
+ require 'webrick/https'
4
+
5
+ test_name 'dsl::helpers::web_helpers #link_exists?' do
6
+ cert_name = [
7
+ %w[CN localhost],
8
+ ]
9
+ http_cmd = "ruby -rwebrick -e'WEBrick::HTTPServer.new(:Port => 80, :DocumentRoot => \"/tmp\").start' > /tmp/mylogfile 2>&1 &"
10
+ https_cmd = "ruby -rwebrick/https -e'WEBrick::HTTPServer.new(:SSLEnable => true, :SSLCertName => #{cert_name}, :Port => 555,:DocumentRoot => \"/tmp\").start' > /tmp/mylogfile 2>&1 &"
11
+ on(default, http_cmd)
12
+ on(default, https_cmd)
13
+ #allow web servers to start up
14
+ sleep(3)
15
+ dir = default.tmpdir('test_dir')
16
+ file = default.tmpfile('test_file')
17
+ dir.slice! "/tmp"
18
+ file.slice! "/tmp"
19
+ dst_dir = 'web_helpers'
20
+
21
+ step '#port_open_within? can tell if a port is open' do
22
+ assert port_open_within?(default,80)
23
+ end
24
+
25
+ step '#link_exists? can tell if a basic link exists' do
26
+ assert link_exists?("http://#{default}")
27
+ end
28
+
29
+ step '#link_exists? can tell if a basic link does not exist' do
30
+ assert !link_exists?("http://#{default}/test")
31
+ end
32
+
33
+ step '#link_exists? can use an ssl link' do
34
+ assert link_exists?("https://#{default}:555")
35
+ end
36
+
37
+ step '#fetch_http_dir can fetch a dir' do
38
+ assert_equal "#{dst_dir}#{dir}", fetch_http_dir("http://#{default}/#{dir}", dst_dir)
39
+ end
40
+
41
+ step '#fetch_http_dir will raise an error if unable fetch a dir' do
42
+ exception = assert_raises(RuntimeError) { fetch_http_dir("http://#{default}/tmps", dst_dir) }
43
+ assert_match /Failed to fetch_remote_dir.*/, exception.message, "#fetch_http_dir raised an unexpected RuntimeError"
44
+ end
45
+
46
+ step '#fetch_http_file can fetch a file' do
47
+ assert_equal "#{dst_dir}#{file}", fetch_http_file("http://#{default}", file, dst_dir)
48
+ end
49
+
50
+ step '#fetch_http_file will raise an error if unable to fetch a file' do
51
+ exception = assert_raises(RuntimeError) { fetch_http_file("http://#{default}", "test2.txt", dst_dir) }
52
+ assert_match /Failed to fetch_remote_file.*/, exception.message, "#fetch_http_dir raised an unexpected RuntimeError"
53
+ end
54
+
55
+ end
@@ -2,6 +2,8 @@
2
2
  Engineering at Puppet Labs has written several libraries that extends the functionality provided
3
3
  by Beaker.
4
4
 
5
+ To learn how to create beaker libraries, see the [Beaker-Template](https://github.com/puppetlabs/beaker-template/blob/master/README.md) documentation.
6
+
5
7
  | Name | Description | Docs |
6
8
  |:-------------------|:--------------------------------------------------------------------|:----------------------------------------------------------------|
7
9
  | Master Manipulator | Easy DSL extension for changing configuration on a Puppet Master | [Github Repo](https://github.com/puppetlabs/master_manipulator) |
@@ -1,4 +1,3 @@
1
- * [Overview](Overview.md)
2
1
  * [Beaker Installation](Beaker-Installation.md)
3
2
  * [Creating A Test Environment](Creating-A-Test-Environment.md)
4
3
  * [The Command Line](The-Command-Line.md)
@@ -4,8 +4,8 @@
4
4
 
5
5
  * [MAINTAINERS](/MAINTAINERS.md)
6
6
  * [Installing Beaker](Beaker-Installation.md)
7
+ * [Running Beaker Tests ](runner/test_run.md)
7
8
  * [How to Beaker](How-To-Beaker.md)
8
- * [Overview](Overview.md)
9
9
  * [Creating A Test Environment](Creating-A-Test-Environment.md)
10
10
  * [Roles, What Are They?](Roles-What-Are-They.md)
11
11
  * [Supported Virtualization Techniques - Hypervisor Docs](hypervisors)
@@ -0,0 +1,32 @@
1
+
2
+ Beaker uses a set of colors to output different types of messages on to the terminal.
3
+
4
+ ## The Default Color Codes
5
+ If you do not provide any values, the defaults are: [Default colors](https://github.com/puppetlabs/beaker/blob/master/lib/beaker/logger.rb#L85-L95)
6
+
7
+ ## Beaker Color Codes:
8
+ In addition, Beaker can support few other colors. List of all colors supported by Beaker: [Colors Supported by Beaker] (https://github.com/puppetlabs/beaker/blob/master/lib/beaker/logger.rb#L14-L32)
9
+
10
+ ## How to Customize:
11
+ Changes to the default options can be made by editing the configuration file.
12
+
13
+ Here are some examples:
14
+
15
+ **Eg 1: Changing color of a particular type of message**
16
+ Add the following to the hosts file to change the color of `success` messages to `GREEN` and `warning` messages to `YELLOW`.
17
+ To get the color-code corresponding to a color, refer to: [Colors Supported by Beaker] (https://github.com/puppetlabs/beaker/blob/master/lib/beaker/logger.rb#L14-L32)
18
+
19
+ HOSTS:
20
+ ...
21
+ CONFIG:
22
+ log_colors:
23
+ success: "\e[01;35m"
24
+ warn: "\e[00;33m"
25
+
26
+ **Eg 2: Turning off colors.**
27
+ The following option in the hosts file will print the whole output in one single color.
28
+
29
+ HOSTS:
30
+ ...
31
+ CONFIG:
32
+ color: false
@@ -22,4 +22,4 @@ trying to support a new hypervisor yourself.
22
22
 
23
23
  | Hypervisor | Fork |
24
24
  |:----------:|:--------------------------------------------------:|
25
- | LXC | [ashish1099](https://github.com/ashish1099/beaker) |
25
+ | LXC | [Obmondo](https://github.com/Obmondo/beaker) |
@@ -1,8 +1,41 @@
1
- This options allows for testing against Openstack instances.
1
+ # Openstack
2
+
3
+ OpenStack is a free and open-source software platform for cloud computing. [Their Site](http://www.openstack.org/).
2
4
 
3
5
  Considered **EXPERIMENTAL**, may break without notice.
4
6
 
5
- ### Basic Openstack hosts file ###
7
+ # Getting Started
8
+
9
+ ### Requirements
10
+
11
+ Get openstack Access & Security credentials:
12
+
13
+ - "openstack_api_key"
14
+ - "openstack_auth_url"
15
+ - "openstack_username"
16
+ - "openstack_tenant"
17
+ - "openstack_network"
18
+ - "openstack_keyname"
19
+
20
+ If you are using [OpenStack Dashboard "Horizon"] (https://wiki.openstack.org/wiki/Horizon)
21
+ you can find these keys in next places:
22
+
23
+ 1. login to "Horizon dashboard" -> "project" -> "Compute" -> "Access & Security" -> tab "API Access" -> "Download OpenStack RC File":
24
+ * "openstack_auth_url" == OS_AUTH_URL + "/tokens"
25
+ * "openstack_username" == OS_USERNAME
26
+ * "openstack_tenant" == OS_TENANT_NAME
27
+ 2. "openstack_network": in "project" -> "Networks"
28
+ 3. "openstack_keyname": in "project" -> "Compute" -> "Access & Security" -> tab "Key Pairs"
29
+ 4. "openstack_api_key": Your user Password
30
+
31
+ ### Setup a Openstack Hosts File
32
+
33
+ An Openstack hosts file looks like a typical hosts file,
34
+ except that there are a number of required properties that need to be added to every host
35
+ in order for the Openstack hypervisor to provision hosts properly.
36
+
37
+ **Basic Openstack hosts file**
38
+
6
39
  HOSTS:
7
40
  centos-6-master:
8
41
  roles:
@@ -11,16 +44,57 @@ Considered **EXPERIMENTAL**, may break without notice.
11
44
  - database
12
45
  - dashboard
13
46
  platform: el-6-x86_64
47
+ hypervisor: openstack
14
48
  image: centos-6-x86_64-nocm
15
49
  flavor: m1.large
16
- hypervisor: openstack
17
- centos-6-agent:
50
+
51
+ CONFIG:
52
+ nfs_server: none
53
+ consoleport: 443
54
+ openstack_api_key: Pas$w0rd
55
+ openstack_username: user
56
+ openstack_auth_url: http://10.10.10.10:5000/v2.0/tokens
57
+ openstack_tenant: testing
58
+ openstack_network : testing
59
+ openstack_keyname : nopass
60
+
61
+ The `image` - image name.
62
+
63
+ The `flavor` - templates for VMs, defining sizes for RAM, disk, number of cores, and so on.
64
+
65
+
66
+ # Openstack-Specific Hosts File Settings
67
+
68
+ ### user-data
69
+
70
+ "user data" - a blob of data that the user can specify when they launch an instance.
71
+ The instance can access this data through the metadata service or config drive with one of the next requests:
72
+
73
+ - curl http://169.254.169.254/2009-04-04/user-data
74
+ - curl http://169.254.169.254/openstack/2012-08-10/user_data
75
+
76
+
77
+ Examples of `user_data` you can find here: http://cloudinit.readthedocs.io/en/latest/topics/examples.html
78
+
79
+ Also if you plan use `user-data` make sure that 'cloud-init' package installed in your VM `image` and 'cloud-init' service is running.
80
+
81
+ **Example Openstack hosts file with user_data**
82
+
83
+ HOSTS:
84
+ centos-6-master:
18
85
  roles:
86
+ - master
19
87
  - agent
88
+ - database
89
+ - dashboard
20
90
  platform: el-6-x86_64
21
91
  image: centos-6-x86_64-nocm
22
92
  flavor: m1.large
23
93
  hypervisor: openstack
94
+ user_data: |
95
+ #cloud-config
96
+ bootcmd:
97
+ - echo 123 > /tmp/test.txt
24
98
  CONFIG:
25
99
  nfs_server: none
26
100
  consoleport: 443
@@ -30,3 +104,5 @@ Considered **EXPERIMENTAL**, may break without notice.
30
104
  openstack_tenant: testing
31
105
  openstack_network : testing
32
106
  openstack_keyname : nopass
107
+
108
+