Skip to content

Commit 8ab4ee3

Browse files
committed
Merge pull request #16 from EMSL-MSC/master
Found bug with graphite plugin recipe
2 parents a4792fb + 3ef6c5e commit 8ab4ee3

File tree

13 files changed

+308
-232
lines changed

13 files changed

+308
-232
lines changed

.rspec

Lines changed: 0 additions & 2 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 76 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -3,100 +3,113 @@ CHANGELOG
33
Chef-Bareos Cookbook
44
--------------------
55

6-
3.0.2
6+
3.0.3
77
-----
8-
- Ian Smith
8+
#### Ian Smith
9+
* Decided to change who owned all of the graphite_plugin bits
10+
1. Bareos plugin still seems to have some debugging code that will not only PRINT your password to the command line if done by hand, but will also EMAIL your main director password to whatever account owns, say, a cronjob (i.e. root). Seems like a security flaw? I submitted bugfix bareos/bareos-contrib/#14 to address this issue, waiting for merge. If you need an immediate fixed source, use my GitBytes/bareos-contrib fork. Sorry about that..
11+
1. Pretty much wherever root was, I changed to bareos in the plugin recipe.
12+
* Cleanup README and CHANGELOG raw syntax for GitHub and Supermarket rendering
13+
* Add new chefspec/rspec unit tests, cleanup existing tests
14+
1. Removed unused `.rspec` config file
15+
1. Removed `repo_spec` test, never quite worked right
16+
1. Added `:documentation` and `color` output to chefspec/rspec testing
17+
1. Added `graphite_plugin_spec` test
18+
1. Condensed and cleaned up `default_spec` test, tests both the `repo` and `client` recipes on top of the implied `default` recipe
19+
1. Added ability to easily run tests against a variety of preset supported platforms via `spec/unit/support/supported_platforms` definition file (see `default_spec` test for example usage)
20+
* Add new/optimize serverspec integration tests
21+
1. Condense tests for overall functionality of Bareos
22+
1. New graphite plugin testing: plugin, config, cronjob
23+
* Bump patch version to `3.0.3` (tag v3.0.3)
924

10-
- Complete re-work of cookbook, which includes the rework bits from version 2.0
11-
- Adding various features including:
12-
* Templates populated from hash tables
13-
* Up to date README
14-
* Graphite plugin deployment recipe
15-
* Migrate to postgresql cookbook version 4+
16-
* Better testing (rspec), testing against current ruby, need some more rspec tests but no time
17-
* Various other updates and enhancements, see README for details
18-
* Supermarket Release...finally
19-
- ***NOTE*** This release adds functionality that is not backwards compatible. Version lock until you have time to test the migration to version 3.0+
25+
3.0.2
26+
-----
27+
#### Ian Smith
28+
* Complete re-work of cookbook, which includes the rework bits from version 2.0
29+
* Adding various features including:
30+
* Templates populated from hash tables
31+
* Up to date README
32+
* Graphite plugin deployment recipe
33+
* Migrate to postgresql cookbook version 4+
34+
* Better testing (rspec), testing against current ruby, need some more rspec tests but no time
35+
* Various other updates and enhancements, see README for details
36+
* Supermarket Release...finally
37+
* ***NOTE*** This release adds functionality that is not backwards compatible. Version lock until you have time to test the migration to version 3.0+
2038

2139
2.2.13
2240
------
23-
- Ian Smith
24-
25-
- Near complete refactoring of how the cookbook works
41+
#### Ian Smith
42+
* Near complete refactoring of how the cookbook works
2643
* Adding various ways to add configs based on hashes. Examples in attributes/default.rb
27-
- Updating README for usage details
28-
- If you are not prepared to use this cookbook version, please lock cookbook version to < 2.0.0
29-
- TODO: Refactor main bareos-dir/sd/fd configs to be fully based on hashes like other configs
44+
* Updating README for usage details
45+
* If you are not prepared to use this cookbook version, please lock cookbook version to < 2.0.0
46+
* TODO: Refactor main bareos-dir/sd/fd configs to be fully based on hashes like other configs
3047
* Remaining attributes support primary bareos-dir/sd/fd configs mostly, used elsewhere but not much
3148

3249
1.0.4
3350
-----
34-
- Ian Smith
35-
36-
- Updating and validating Kitchen testing with new methods
37-
- Adding ability to use custom Storage Daemon Configs via wrapper recipe
38-
- Fixed a race condition that was likely to come up both in testing and production
51+
#### Ian Smith
52+
* Updating and validating Kitchen testing with new methods
53+
* Adding ability to use custom Storage Daemon Configs via wrapper recipe
54+
* Fixed a race condition that was likely to come up both in testing and production
3955
* Was missing client config on fresh install so restart of dir would fail
40-
- Limiting cookbook support for debian to ~>7.0 until we can test on 8+
41-
- Refined storage recipe to correctly create client configs based on BOTH role search and solo instances, may need a bit more tuning but should work in most cases
42-
- Creating basic Full, Inc, and Diff pools even if not used, just as a place holder (default)
43-
- Minor fixes
44-
- Larger version bump for version clarity
45-
- Updated Docs
46-
- Adding support for Fedora and RHEL 6/7
47-
- Reworked the available repos to some better logic
56+
* Limiting cookbook support for debian to ~>7.0 until we can test on 8+
57+
* Refined storage recipe to correctly create client configs based on BOTH role search and solo instances, may need a bit more tuning but should work in most cases
58+
* Creating basic Full, Inc, and Diff pools even if not used, just as a place holder (default)
59+
* Minor fixes
60+
* Larger version bump for version clarity
61+
* Updated Docs
62+
* Adding support for Fedora and RHEL 6/7
63+
* Reworked the available repos to some better logic
4864

4965
0.1.4
5066
-----
51-
- Ian Smith
52-
53-
- Updating README
54-
- Revamping server.rb recipe to better utilize the bareos-dir.d directory
67+
#### Ian Smith
68+
* Updating README
69+
* Revamping server.rb recipe to better utilize the bareos-dir.d directory
5570
* Moving ALL host config files to the bareos-dir.d/hosts/ directory
56-
* Revamping director config and moving host bits to seperate host.conf.erb template
71+
* Revamping director config and moving host bits to separate host.conf.erb template
5772
* Adding feature for host based custom pools based on true/false attribute
5873
* Adding ability to fill in a block for virtual-full backup logic (not complete yet)
59-
- Revamping storage.rb and storage template to what I am thinking was meant to happen originally
60-
- Adding new kitchen suite and tests to verify host pools work
61-
- Bugfixes
62-
- Updating Kitchen Tests and ChefSpec Configs to match for verifying
74+
* Revamping storage.rb and storage template to what I am thinking was meant to happen originally
75+
* Adding new kitchen suite and tests to verify host pools work
76+
* Bugfixes
77+
* Updating Kitchen Tests and ChefSpec Configs to match for verifying
6378
* Addressing race condition in ChefSpec tests where debian was taking
6479
longer than expected to start the director
6580

6681
0.1.3
6782
-----
68-
- Ian Smith
69-
70-
- Updating README
71-
- Updating CHANGELOG
72-
- Updating metadata file
83+
#### Ian Smith
84+
* Updating README
85+
* Updating CHANGELOG
86+
* Updating metadata file
7387

7488
0.1.2
7589
-----
76-
- Leonard TAVAE
77-
78-
- The License has changed (Apache 2.0)
79-
- The cookbook now passed foodcritic, rubocop and tailor with success
80-
- Some minor bugs fix
81-
82-
- Ian Smith
83-
84-
- Updating Cookbook to use ChefDK >0.6.0
85-
- Updating Docs
86-
- Updating Postgresql Logic/Commands
87-
- Updating a couple of template bits for the director
90+
#### Leonard TAVAE
91+
* The License has changed (Apache 2.0)
92+
* The cookbook now passed foodcritic, rubocop and tailor with success
93+
* Some minor bugs fix
94+
95+
#### Ian Smith
96+
* Updating Cookbook to use ChefDK >0.6.0
97+
* Updating Docs
98+
* Updating Postgresql Logic/Commands
99+
* Updating a couple of template bits for the director
88100
* Adding new attributes, working on more for future implementation
89-
- Updating Kitchen suites/platforms/provisioner
101+
* Updating Kitchen suites/platforms/provisioner
90102
* Adding some test roles for tests
91-
- Updating chefspec/rspec/serverspec testing
92-
- Updating TravisCI testing parameters so they are more standard
103+
* Updating chefspec/rspec/serverspec testing
104+
* Updating TravisCI testing parameters so they are more standard
93105

94106
0.1.1
95107
-----
96-
- Leonard TAVAE - Major release
108+
#### Leonard TAVAE
109+
* Major release
97110

98111
0.1.0
99112
-----
100-
- Leonard TAVAE - Initial release of bareos
101-
113+
#### Leonard TAVAE
114+
* Initial release of bareos
102115
- - -

README.md

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,13 @@ A new plugin that will send statistics to a graphite server which can then be us
118118

119119
| Attribute | Default Value | Description
120120
|------------------|---------------|------------
121-
| ['bareos']['plugins']['graphite']['packages'] | varies on platform | Default packages needed to get the plugin to work
122121
| ['bareos']['plugins']['graphite']['plugin_path'] | '/usr/sbin' | Default location for the plugin that runs in a defined cron job
123122
| ['bareos']['plugins']['graphite']['config_path'] | '/etc/bareos' | Default directory for the plugin config
124123
| ['bareos']['plugins']['graphite']['search_query'] | 'roles:bareos_director' | Default search string to populate the director name
125124
| ['bareos']['plugins']['graphite']['server'] | 'graphite' | Placeholder string for the graphite server DNS name
126125
| ['bareos']['plugins']['graphite']['graphite_port'] | '2003' | Default graphite communication port
127126
| ['bareos']['plugins']['graphite']['graphite_data_prefix'] | 'bareos.' | Default prefix for graphite data
128-
| ['bareos']['plugins']['graphite']['graphite_plugin_src_url'] | 'https://raw.githubusercontent.com/bareos/bareos-contrib/master/misc/performance/graphite/bareos-graphite-poller.py' | Default URL to the plugin
127+
| ['bareos']['plugins']['graphite']['graphite_plugin_src_url'] | See attributes file | Default URL to the plugin
129128

130129
## Recipes
131130

@@ -146,21 +145,22 @@ Installs whichever database is desired per attributes (PostgreSQL/MySQL), instal
146145
Installs necessary Bareos server packages and sets up base configs necessary for server to start. Also creates the config directory (bareos-dir.d) so you can drop whatever outside config files into place and have them get automatically included in your setup.
147146

148147
### storage
149-
Installs necessary Bareos storage packages and sets up a default file storage for you to start backing stuff up to right away (configured for ~250GB of volumes by default).
148+
Installs necessary Bareos storage packages and sets up a default file storage for you to start backing stuff up to right away (configured for ~250GB spread over 25 10GB volumes).
150149

151150
### autochanger
152151
This bit will setup an autochanger based on a pretty straight forward has table. Tested with IBM TS3500 Tape Library with 10 Frames and 16 Tape drives.
153152

154153
### workstation
155-
Installs bconsole essentially. I plan to create another recipe for bat (Bareos Administration Tool) and the Bareos Web UI but I haven't gotten around to it yet.
154+
Installs the bconsole utility. There are future plans to create a recipe to install bat (Bareos Administration Tool) and the Bareos Web UI.
156155

157156
### graphite_plugin
158-
This was an exciting recent addition to the Bareos contrib GitHub repo. This addition in its current form will be dependent on a pending merge request getting accepted but if it isn't merged it can be easily worked around. Should work out of the gate here pretty soon given you adjust the graphite server string in the attributes for a graphite server location.
157+
Installs a Bareos graphite plugin, configuration file, necessary python packages, and a cronjob to gather statistics periodically and forward them to an available graphite server.
159158

160159
## Searchable Roles (Used by default)
161160

162161
### bareos\_client
163162
This example shows how the ```bareos_client``` role can both install the Bareos client side software and when searched against via the server recipe, will add itself to the bareos-dir (Bareos director) configuration and setup a default set of jobs for a client.
163+
164164
```
165165
{
166166
"name": "bareos_client",
@@ -181,6 +181,7 @@ This example shows how the ```bareos_client``` role can both install the Bareos
181181

182182
### bareos\_storage
183183
This example shows a ```bareos_storage``` role which will create a Bareos storage-daemon host. It will install the necessary packages and lay down configuration files you can populate with any number of key value hash tables. You should be able to install this independent of the director(s), please file a ticket if this doesn't work as expected.
184+
184185
```
185186
{
186187
"name": "bareos_storage",
@@ -207,6 +208,7 @@ This will also allow clients to populate their filedaemon config via defined sea
207208
You'll need to run ```chef-client``` on the director after a client gets configured so the director can add and generate the appropriate client related configs.
208209

209210
You can populate the ```['bareos']['clients']['unmanaged']``` hash table space with any number of client related configuration lines if you have hosts you either don't plan to search for or want to do custom configurations for.
211+
210212
```
211213
{
212214
"name": "bareos_director",
@@ -230,9 +232,10 @@ You can populate the ```['bareos']['clients']['unmanaged']``` hash table space w
230232

231233
## Example customizable key value hash template configurations
232234
These are the preset default hashes to get a baseline configuration on a new bareos server. You can manipulate these as you see fit via recipe logic or searches or whatever you want. These will at least get you going.
235+
233236
### clients
234237
```
235-
# Default Client Config when populated via search
238+
# Default Client Config populated via search
236239
default['bareos']['clients']['conf'] = {
237240
'FDPort' => '9102',
238241
'File Retention' => '30 days',
@@ -241,6 +244,7 @@ default['bareos']['clients']['conf'] = {
241244
'Maximum Concurrent Jobs' => '20'
242245
}
243246
```
247+
244248
```
245249
# Example Unmanaged client if client is unmanaged or custom
246250
default['bareos']['clients']['unmanaged']['unmanaged-client-fd'] = {
@@ -250,7 +254,8 @@ default['bareos']['clients']['unmanaged']['unmanaged-client-fd'] = {
250254
'FDPort' => '9102'
251255
}
252256
```
253-
#### autochanger (if using tape storage)
257+
258+
### autochanger (if using tape storage)
254259
```
255260
# Example/Test Tape Autochanger Configurations
256261
if node['bareos']['storage']['autochanger_enabled'] == true
@@ -291,11 +296,13 @@ if node['bareos']['storage']['autochanger_enabled'] == true
291296
'MaximumFileSize' => '10GB'
292297
}
293298
```
294-
#### dir\_helper
299+
300+
### dir\_helper
295301
```
296302
default['bareos']['director']['conf']['help']['Example Block'] = '# You can put extra configs here.'
297303
```
298-
#### filesets
304+
305+
### filesets
299306
```
300307
# Default Filesets
301308
default['bareos']['clients']['filesets']['default'] = {
@@ -321,7 +328,8 @@ default['bareos']['clients']['filesets']['default'] = {
321328
}
322329
}
323330
```
324-
#### job\_definitions (jobdefs)
331+
332+
### job\_definitions (jobdefs)
325333
```
326334
# Default Job Definitions
327335
default['bareos']['clients']['job_definitions']['default-def'] = {
@@ -355,14 +363,15 @@ default['bareos']['clients']['job_definitions']['default-restore-def'] = {
355363
'Where' => '/tmp/bareos-restores'
356364
}
357365
```
358-
#### jobs
359-
Director Jobs:
366+
367+
### jobs
360368
```
369+
# Director Jobs, basically the same as client but meant to be more admin related:
361370
default['bareos']['director']['jobs'] = nil
362371
```
363-
Client Jobs:
372+
364373
```
365-
# Example Jobs
374+
# Example Client Jobs:
366375
default['bareos']['clients']['jobs']["#{node.default['bareos']['clients']['name']}-job"] = {
367376
'Client' => "#{node['bareos']['clients']['name']}-fd",
368377
'Type' => 'Backup',
@@ -376,7 +385,7 @@ default['bareos']['clients']['jobs']["#{node.default['bareos']['clients']['name'
376385
}
377386
```
378387

379-
#### pools
388+
### pools
380389
```
381390
# Default Pools
382391
default['bareos']['clients']['pools']['default-file-pool'] = {
@@ -388,7 +397,8 @@ default['bareos']['clients']['pools']['default-file-pool'] = {
388397
'LabelFormat' => 'FileVolume-'
389398
}
390399
```
391-
#### schedules
400+
401+
### schedules
392402
```
393403
# Default Schedules
394404
default['bareos']['clients']['schedules']['monthly'] = {
@@ -405,11 +415,13 @@ default['bareos']['clients']['schedules']['monthly'] = {
405415
]
406416
}
407417
```
408-
#### sd\_helper
418+
419+
### sd\_helper
409420
```
410421
default['bareos']['storage']['conf']['help']['Example Block'] = '# You can put extra configs here.'
411422
```
412-
#### storages
423+
424+
### storages
413425
```
414426
# Default Storages
415427
default['bareos']['clients']['storages']['default-file-storage'] = {
@@ -420,7 +432,6 @@ default['bareos']['clients']['storages']['default-file-storage'] = {
420432
```
421433

422434
# Contributing
423-
424435
1. Fork the repository on Github
425436
2. Create a named feature branch (like ```add_component_x```)
426437
3. Write your change
@@ -431,7 +442,6 @@ default['bareos']['clients']['storages']['default-file-storage'] = {
431442
## License and Authors
432443

433444
### License
434-
435445
Copyright (C) 2016 Leonard TAVAE
436446

437447
Licensed under the Apache License, Version 2.0 (the "License");
@@ -447,7 +457,6 @@ See the License for the specific language governing permissions and
447457
limitations under the License.
448458

449459
### Authors
450-
451460
* Leonard TAVAE
452461
* Ian Smith
453462
* Gerhard Sulzberger

attributes/default.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,14 @@
113113
default['bareos']['workstation']['name'] = node['fqdn']
114114

115115
# Graphite Plugin Default Attributes
116-
default['bareos']['plugins']['graphite']['packages'] = if platform_family?('rhel') && node['platform_version'].to_i == 6
117-
%w(python python-bareos python-requests python-fedora-django)
118-
else
119-
%w(python python-bareos python-requests python-django)
120-
end
121-
122116
default['bareos']['plugins']['graphite']['plugin_path'] = '/usr/sbin'
123117
default['bareos']['plugins']['graphite']['config_path'] = '/etc/bareos'
124118
default['bareos']['plugins']['graphite']['search_query'] = 'roles:bareos_director'
125119
default['bareos']['plugins']['graphite']['server'] = 'graphite'
126120
default['bareos']['plugins']['graphite']['graphite_port'] = '2003'
127121
default['bareos']['plugins']['graphite']['graphite_data_prefix'] = 'bareos.'
128122
default['bareos']['plugins']['graphite']['graphite_plugin_src_url'] = 'https://raw.githubusercontent.com/bareos/bareos-contrib/master/misc/performance/graphite/bareos-graphite-poller.py'
123+
default['bareos']['plugins']['graphite']['mail_to'] = 'bareos'
129124

130125
##############################
131126
# Examples - Default Hashes #

0 commit comments

Comments
 (0)