Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing the master and slave phrasing #1

Open
wants to merge 387 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
387 commits
Select commit Hold shift + click to select a range
7e63143
Merge pull request #4 from sborsje/master
Sep 3, 2011
25f080f
re-introduct the fix for mounted_at Rails apps
jweiss Sep 8, 2011
12fee1c
better Nginx gzip configuration
jweiss Sep 9, 2011
9aecb0f
try to install the new ganglia UI via github and automated makefile
tlobinger Jun 29, 2011
0df4668
add '/'
tlobinger Jun 29, 2011
cc86ad5
provide complete path
tlobinger Jun 29, 2011
5e02d1e
divide in two steps
tlobinger Jun 29, 2011
b016533
include gweb2 in apache conf
tlobinger Jun 29, 2011
d92a14d
add reports to new UI
tlobinger Jul 1, 2011
877d8e6
overlay config
tlobinger Jul 1, 2011
439a1a0
fix syntax
tlobinger Jul 1, 2011
0b86105
Call bundler with path option instead of deprecated path argument.
ikanusim Sep 20, 2011
e3097bb
ensure correct permissions of custom cookbooks
jweiss Oct 7, 2011
88411e5
Only fix custom cookbooks permission when present.
ikanusim Oct 12, 2011
0150687
nicer check
jweiss Oct 13, 2011
767467d
Include cluster name in scalarium.php.
ikanusim Oct 13, 2011
2289fdd
Add mysql development package name for Ubuntu 11.10.
ikanusim Oct 14, 2011
35a4a69
Merge branch 'master' of github.com:scalarium/cookbooks into gweb2
tlobinger Oct 17, 2011
e5e39c5
add redcar to .gitignore
tlobinger Oct 17, 2011
ff6c8a7
get gweb2 from cookbook file
tlobinger Oct 17, 2011
f15c1d7
change to scalarium theme
tlobinger Oct 17, 2011
f050711
Merge branch 'gweb2' of github.com:scalarium/cookbooks into gweb2
tlobinger Oct 17, 2011
c1db28d
remove newline which breaks png creation
tlobinger Oct 17, 2011
be1094a
fix path
tlobinger Oct 18, 2011
e5c2346
set optional graphs nested to fix optional graphs
tlobinger Oct 18, 2011
434eae8
update gweb2 base
tlobinger Oct 18, 2011
2c5f931
enable events
tlobinger Oct 18, 2011
f53f49f
add first draft of deploy events
tlobinger Oct 18, 2011
04d4360
to_s
tlobinger Oct 18, 2011
60dd77b
owner not user ... grrrr
tlobinger Oct 18, 2011
e9d72b3
.erb
tlobinger Oct 18, 2011
665365c
add missing /
tlobinger Oct 18, 2011
55b8715
clear host_regex to add the deploy events to all servers in the cluster
tlobinger Oct 18, 2011
520f72f
move events.json.d folder creation to setup of gweb2
tlobinger Oct 18, 2011
e2846d7
join events.json
tlobinger Oct 18, 2011
e700dc3
trow out end_time because right now it is the end time of the deploym…
tlobinger Oct 18, 2011
f34d5ea
disable gweb 2 'auth_system' to enable edit view functionality
tlobinger Oct 18, 2011
29e3c84
add creation of host json files for optional graphs on host view
tlobinger Oct 19, 2011
6f52710
syntax
tlobinger Oct 19, 2011
c920827
move to ruby block
tlobinger Oct 19, 2011
d1ee0f0
move template out
tlobinger Oct 19, 2011
6e04bcc
move instances out
tlobinger Oct 19, 2011
8e211ff
make this shit work - really
tlobinger Oct 19, 2011
3bbd37b
jetzt aber
tlobinger Oct 19, 2011
ccc851a
add apache reports monitoring master
tlobinger Oct 19, 2011
c1c6c8b
add apache metrics to monitoring master role
tlobinger Oct 19, 2011
8fd54e9
Update apparmor mysql config for Ubuntu 11.10.
ikanusim Oct 19, 2011
1b22c2d
add graph sizes to template
tlobinger Oct 19, 2011
c42ae8e
Add monit default config for Ubuntu 11.10.
ikanusim Oct 20, 2011
4d6bd6f
Install libssl0.9.8 on Ubuntu 11.10 when installing REE.
ikanusim Oct 20, 2011
00d60ff
add and rewrite all reports
tlobinger Oct 20, 2011
c3f06a6
delete old report definitions
tlobinger Oct 20, 2011
175458e
add packet report for all hosts
tlobinger Oct 20, 2011
36ddadd
rename tar files
tlobinger Oct 20, 2011
cedfcaa
remove fragments of gweb 2 installation in paralell mode
tlobinger Oct 20, 2011
83d3063
start to replace old ganglia UI with new gweb
tlobinger Oct 20, 2011
fe6b2a3
Merge remote-tracking branch 'origin/master' into gweb2
tlobinger Oct 21, 2011
0ff7eec
get rid of specific gweb2 files and move it to the default server and…
tlobinger Oct 21, 2011
384bdce
repack gweb 2.1.8 tar.gz
tlobinger Oct 21, 2011
a4c4599
*grmpf* move stuff to right config file
tlobinger Oct 21, 2011
a02888d
update reports
tlobinger Oct 24, 2011
71da926
get propper ha proxy values
tlobinger Oct 24, 2011
901625f
add meta refresh for ganglia index
tlobinger Oct 24, 2011
b6b0c30
add scalarium view json for mobile and rotation view
tlobinger Oct 26, 2011
af19d7d
update reports
tlobinger Oct 26, 2011
f4b01f3
move ganglia event stuff from deploy to ganglia cookbook
tlobinger Oct 26, 2011
2284e10
remove description
tlobinger Oct 26, 2011
809cedd
gitignore unpacked folders
tlobinger Oct 26, 2011
c1dbf13
fix conversion of hex to int as XtraDB sometimes reports transactions…
jweiss Oct 26, 2011
10311cd
Merge branch 'master' into gweb2
tlobinger Oct 26, 2011
bd4c503
bytes in and out - fix regex to exclude lb metrics
tlobinger Oct 26, 2011
c5986b0
fix if
tlobinger Oct 26, 2011
66ce4ce
implement shutdown events for the supported services and extract some…
jweiss Oct 26, 2011
f244352
Merge branch 'master' into gweb2
tlobinger Oct 26, 2011
99fda34
Install custom ganglia-monitor packages on Ubuntu 11.10.
ikanusim Oct 26, 2011
114eca7
Install custom ganglia-monitor packages on Ubuntu 11.10.
ikanusim Oct 26, 2011
f954c22
add apache metrics for ganglia
tlobinger Oct 26, 2011
5db412b
divide recipies and conquer world
tlobinger Oct 26, 2011
f56bb03
use cookbook file
tlobinger Oct 26, 2011
641f0c7
Merge branch 'master' of github.com:scalarium/cookbooks into gweb2
tlobinger Oct 26, 2011
1ab6503
Merge
tlobinger Oct 26, 2011
63e0e96
revert
tlobinger Oct 26, 2011
23868c8
Disable GC in chef runs.
ikanusim Oct 27, 2011
02eef37
Merge branch 'master' of github.com:scalarium/cookbooks into gweb2
tlobinger Oct 27, 2011
b7df582
prevent ganglia to go boom if your app name contains 'ganglia'
tlobinger Oct 27, 2011
e2a7395
fix for new device names (Xen virtual disk)
tlobinger Oct 28, 2011
d164da7
Rework ganglia dependencies.
ikanusim Oct 28, 2011
fbe11fa
iostat displays xvda1 as xvdap1 - so we have to add p
tlobinger Oct 28, 2011
30e64b7
Merge remote-tracking branch 'origin/gweb2' into gweb2
tlobinger Oct 28, 2011
3fe8b5f
Use ganglia packages for Ubuntu 11.xx from our own S3 bucket.
ikanusim Oct 28, 2011
ea92f36
remove libconfuse-common dep and fix execute.
tlobinger Oct 28, 2011
7174fd8
fix sub
tlobinger Oct 28, 2011
b683c71
Install custom gmetad packages on Ubuntu 11.10 and 11.04.
ikanusim Nov 1, 2011
7c9ac53
bump default passenger to 3.0.9
jweiss Nov 1, 2011
f0d954d
add empty functions.php in lib folder to prevent errors in syslog pro…
tlobinger Nov 1, 2011
c4f3e99
refactor attribute access and make sure event dir exists on deploy
tlobinger Nov 1, 2011
f6a2ebd
Merge remote-tracking branch 'origin/master' into gweb2
tlobinger Nov 1, 2011
98a5b1a
fix typ
tlobinger Nov 1, 2011
90c23a0
override hostname in Ganglia client
jweiss Nov 1, 2011
719da0f
fix nginx report
tlobinger Nov 1, 2011
352e6ab
choose nginx or apache monitoring scripts depending of the used rails…
tlobinger Nov 2, 2011
ea8c4fc
update host view json and client.rb to switch between nginx/unicorn a…
tlobinger Nov 2, 2011
6ae32e1
add switch between apache and nginx on more places
tlobinger Nov 2, 2011
564ccb8
update reports ... again
tlobinger Nov 2, 2011
3a24c66
fix if
tlobinger Nov 2, 2011
83e69a4
ensure new metrics are editable via ganglia UI
tlobinger Nov 2, 2011
85a8a9d
make sure the Ganglia conf directory exists before writing views in t…
jweiss Nov 3, 2011
42c358a
Merge branch 'master' into gweb2
tlobinger Nov 4, 2011
2058f0a
Launch node.js apps from within the application directory.
ikanusim Nov 4, 2011
68c7def
remove dublicated/not needed apache reports for rails app servers wit…
tlobinger Nov 4, 2011
d3da7df
add nginx_status to rails app servers
tlobinger Nov 4, 2011
e2430c9
Merge branch 'master' of github.com:scalarium/cookbooks
tlobinger Nov 4, 2011
5b66f05
increase default maxcon for all backends
jweiss Nov 7, 2011
02a5933
add list of valid activities to cluster_state.json
jweiss Nov 15, 2011
bc1f4d8
handle the case if there are no activities
jweiss Nov 15, 2011
de5bd4c
restart services after changing the SSL certificates
jweiss Nov 15, 2011
c619be8
do the same certificate fix for PHP
jweiss Nov 15, 2011
5e96640
Bump default versions for node.js and npm.
ikanusim Nov 16, 2011
c1e3f42
Update cluster state template for new client activities attribute.
ikanusim Nov 17, 2011
c87e999
update year in LICENSE
jweiss Nov 21, 2011
87bf5cb
fallback to localhost
jweiss Nov 30, 2011
2f40c95
extract HAProxy load factors and increase them a bit
jweiss Nov 30, 2011
4cf4028
fix typo
jweiss Nov 30, 2011
8156c01
Update REE for Ubuntu 10.04 and higher.
ikanusim Jan 10, 2012
3f44990
Use cloudfront for assets.
ikanusim Jan 10, 2012
09d88af
skip_uninstall_of_other_rails_stack
jweiss Jan 10, 2012
0f38406
Handle ignored bundler groups in attributes.
ikanusim Feb 13, 2012
b57f93a
Handle ignored bundler groups in attributes.
ikanusim Feb 13, 2012
9c613a3
support S3 archives
jweiss Feb 21, 2012
6cb1ecd
Put scalarium agent dir in an attribute file.
ikanusim Feb 21, 2012
0f3bdb9
Fix scalarium agent root dir.
ikanusim Feb 21, 2012
bdace35
Merge branch 'stable' of github.com:scalarium/cookbooks into stable
jweiss Feb 21, 2012
bbbc7ed
Revert "Use cloudfront for assets."
ikanusim Feb 22, 2012
7e039a8
Merge branch 'master' into stable
jweiss Feb 22, 2012
5ea4924
make it easier to override deploy user settings
jweiss Feb 28, 2012
3b9422a
Use #include in favor of #includedir in sudoers for Ubuntu 9.10 compa…
ikanusim Mar 1, 2012
02c1003
Revert "Use #include in favor of #includedir in sudoers for Ubuntu 9.…
ikanusim Mar 2, 2012
f8f55cc
Add sudo entries for scalarium-agent user.
ikanusim Mar 2, 2012
d75a9a3
Merge branch 'master' into stable
ikanusim Mar 7, 2012
7a74383
make deleting the cached_copy configurable as this can speed up deplo…
jweiss Mar 19, 2012
ab9f9b4
Merge branch 'master' into stable
jweiss Mar 19, 2012
f0c184c
Merge branch 'stable' of github.com:scalarium/cookbooks into stable
jweiss Mar 19, 2012
e8c0b11
Add sudo entry for statistics.
ikanusim Mar 20, 2012
5ff3fde
Merge branch 'master' into stable
jweiss Mar 20, 2012
e57a5f9
Fetch npm from our S3 bucket.
ikanusim Mar 26, 2012
b4ed36a
Merge branch 'master' into stable
ikanusim Mar 26, 2012
1c50b6d
Fix agent version file ownership.
ikanusim Apr 16, 2012
012ebb1
Run agent update as root.
ikanusim Apr 16, 2012
20558d4
Fix agent version file ownership.
ikanusim Apr 16, 2012
72900ad
Run agent update as root.
ikanusim Apr 16, 2012
6f04bbb
add missing support for S3-deploy of custom cookbooks
jweiss Apr 27, 2012
77b67f2
Merge branch 'master' into stable
jweiss Apr 27, 2012
68c7a66
fix typo in s3-deploy of custom cookbooks
jweiss Apr 27, 2012
1b1db1d
Merge branch 'master' into stable
jweiss Apr 27, 2012
6e379ea
only restart Rails applications
jweiss Apr 30, 2012
f3cbdb9
first test for memcached
May 1, 2012
8da6eb1
added cookbook for minitest-handler to only run cookbooks from runlist
May 2, 2012
ec343e7
added memchached service tests
May 7, 2012
009228f
cleaned up and update bundle to include all gems but the ones on the …
May 7, 2012
f49c4d6
make sure that the rails attributes are loaded when using them in the…
jweiss May 7, 2012
79b1fe5
Merge branch 'master' into stable
jweiss May 7, 2012
00ae3b3
test for the memcached cookbook. Test server/service and some files
May 7, 2012
06fdd09
Merge branch 'master' into minitest
May 7, 2012
5cd4793
explicit dependencies for attributes and add a Rake task to test them
jweiss May 8, 2012
ff7d569
fix typo
May 8, 2012
01e5b95
add default attribute for deploy so that just loading deploy works
jweiss May 8, 2012
a0e7d44
cleaned up, fixed private ip issue and started using more build in as…
May 8, 2012
e10e60b
bump REE version
jweiss May 9, 2012
26040e1
Merge branch 'master' into stable
jweiss May 9, 2012
801cc99
uninstall bundler after installing REE as that version will always be…
jweiss May 9, 2012
d68a05b
Merge branch 'master' into stable
jweiss May 9, 2012
19b7e8c
using (assert|refuse)_nil and unsuded code for memory test
May 9, 2012
5cd249c
KVM/VirtIO device name mapping.
May 9, 2012
bd3dfc8
KVM/VirtIO device name mapping.
May 9, 2012
037f354
use libmysqlclient-dev on all ubuntu releases. It wraps all libmysqlc…
May 11, 2012
8eafeab
Merge branch 'master' into minitest
May 11, 2012
9df1bf1
make apache logrotate permissions configurable
jweiss May 11, 2012
bcc6151
Merge branch 'master' into stable
jweiss May 11, 2012
483b449
Merge branch 'stable' of github.com:scalarium/cookbooks into stable
jweiss May 11, 2012
5e7e7dd
fixed some metadata values to coupe with chef specs
May 22, 2012
e5236a9
extend object with .blank? method using a libraries -- DEPRECATED -- …
May 22, 2012
b689bc5
fixed silly typo consisting of a blank too much
May 22, 2012
15be8e6
PHP: move include_attribute to attribute file
jweiss May 24, 2012
3cd7b34
Merge branch 'master' into stable
jweiss May 24, 2012
d2018fe
changed package name for mysql-dev library on ubuntu ... use package …
May 24, 2012
6f9705b
fix version check when installing Ruby 1.9
jweiss May 30, 2012
909a855
make RAIDs idempotent during setup
jweiss May 30, 2012
0e92b45
Merge branch 'master' into stable
jweiss May 30, 2012
8f2c262
install libssl0.9.8 on ubuntu 12.04 and 11.10 - fixed typo
Jun 7, 2012
c3de313
config changes without deprecated options for mysql
Jun 11, 2012
7ed756a
Merge branch 'master' into precise-pangolin
Jun 13, 2012
85c4ba0
remove default charset option in client section. Keep current config …
Jun 14, 2012
3b432b9
added reordered my.cnf for Ubuntu 12.04 and default charset utf8 for …
Jun 14, 2012
c6904db
Merge branch 'precise-pangolin' into stable
Jun 15, 2012
a663930
add /etc/default/monit for 12.04 in order to use newer syntax
jweiss Jun 18, 2012
82fdfdb
install extra dependencies for percona 5.5
Jun 26, 2012
735ac05
added a new version of percona for Ubuntu 12.04 and rearrended the co…
Jun 26, 2012
b6703d3
extended wilcard range to include different libmysqlclient1x
Jun 26, 2012
dd5c31c
fixed extended wilcard range to include different libmysqlclient1x - …
Jun 26, 2012
b07115d
the character_set_client option doesn't work as decribed in the docum…
Jun 29, 2012
40acb9d
a less intrusive change on the installation of the percona pakages, j…
Jul 2, 2012
472922e
Wait for lvscan to report volumes as active.
ikanusim Jun 29, 2012
b4eb756
Remove debug string.
ikanusim Jul 4, 2012
6da4eee
Remove the Ubuntu landscape packages
jweiss Jul 12, 2012
c887159
add an entry for the couchdb-master server based on information from …
Jul 25, 2012
440361e
first test for memcached
May 1, 2012
cdd932b
added cookbook for minitest-handler to only run cookbooks from runlist
May 2, 2012
94cd50d
added memchached service tests
May 7, 2012
228952f
cleaned up and update bundle to include all gems but the ones on the …
May 7, 2012
8be2d36
test for the memcached cookbook. Test server/service and some files
May 7, 2012
42a9cb9
fix typo
May 8, 2012
4f92a7f
cleaned up, fixed private ip issue and started using more build in as…
May 8, 2012
8d873bc
using (assert|refuse)_nil and unsuded code for memory test
May 9, 2012
c6afd2c
fixed some metadata values to coupe with chef specs
May 22, 2012
0472097
extend object with .blank? method using a libraries -- DEPRECATED -- …
May 22, 2012
1501a45
fixed silly typo consisting of a blank too much
May 22, 2012
77e08ed
Merge branch 'minitest' of github.com:scalarium/cookbooks into minitest
Jul 27, 2012
b55a29c
changed rubygems version to 1.8.24 to match with the one we set in th…
Jul 27, 2012
5bd7eb6
Merge branch 'master' of github.com:scalarium/cookbooks
Jul 27, 2012
886ed2e
remove couchdb stuff from public /etc/hosts template
Jul 31, 2012
813c35a
remove broken templating code from /etc/hosts template
Jul 31, 2012
a373453
Remove the Ubuntu landscape packages
jweiss Jul 12, 2012
e01e2e8
changed rubygems version to 1.8.24 to match with the one we set in th…
Jul 27, 2012
c43c893
remove couchdb stuff from public /etc/hosts template
Jul 31, 2012
b1687b5
remove broken templating code from /etc/hosts template
Jul 31, 2012
9e4b113
library for installing and loading gems into the chef environment
Aug 15, 2012
0970968
rearrenged code and set help methods as private
Aug 15, 2012
c837f67
trigger cookbook testing per custom json
Aug 16, 2012
4a6e1c3
include recipe when testing is expected
Aug 16, 2012
ed6634d
install dependencies using internal_gem_package method
Aug 16, 2012
f6a948a
fix include_recipe call
Aug 23, 2012
49ee3a3
setup testing for the memcached cookbook using the current Q&A strategy
Aug 23, 2012
aee4ff2
building the ruby package name for the different ruby stacks now happ…
Aug 23, 2012
2dad1c2
fixed attribute type
Aug 24, 2012
989d9c4
reset this to the content of the master branch
Aug 24, 2012
0ba7c51
deleted unnecesary changes
Aug 24, 2012
6666703
removed blank charactes
Aug 24, 2012
c2d9933
no need for uninstall atm
Aug 27, 2012
8597b07
fix typo
Aug 27, 2012
b3f4e8d
change version for minitest-chef-handler ... chef run returns tests e…
Aug 29, 2012
18292ba
give me a comment when runnig tests
Aug 29, 2012
2faaa93
bump minitest-chef-handler version, this one includes a patch for log…
Aug 30, 2012
1b0524d
building the ruby package name for the different ruby stacks now happ…
Aug 23, 2012
6c69006
we are going to get the default ruby version from json and if not onl…
Aug 31, 2012
0a71926
Merge branch 'ruby1.9.3' of github.com:scalarium/cookbooks into ruby1…
Aug 31, 2012
c25650f
set ruby 1.9 as default ruby stack if none was specified
Sep 4, 2012
c83b0c9
replace double quotes through single quotes
Sep 4, 2012
e4b40d7
make Ganglia work for Eucalyptus by using IPs instead of internal DNS…
jweiss Sep 22, 2012
b9cf1e8
create database with backticks
Sep 25, 2012
73b5113
Get away from master/slave vocabulary
bopopescu Jul 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
*/.DS_Store
*/*/.DS_Store
.vagrant
.idea
.redcar
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2010 Peritor GmbH
Copyright 2010-2011 Peritor GmbH

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -10,4 +10,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
54 changes: 53 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,58 @@ task :validate_literal_includes do
end
end

KNOWN_COOKBOOK_ATTRIBUTES = {
'scalarium_agent_root' => 'scalarium_cluster_state',
'passenger' => 'passenger_apache2',
'ganglia' => 'scalarium_ganglia',
'sudoers' => 'ssh_users',
'scalarium' => :any,
'platform' => :any,
'platform_version' => :any
}

desc 'check declared attribute dependencies'
task :validate_attribute_dependencies do
Dir['**/*.rb'].each do |file|
next unless file.match(/\/attributes\//)
used_cookbook_attributes = []
found_trouble = false

cookbook_name = file.match(/(\w+)\//)[1]
loaded_cookbook_attributes = [cookbook_name]

attribute_file = File.read(file)
attribute_file.each do |line|

# uses other cookbooks attributes
if line.match(/node\[\:(\w+)\]/) && $1 != cookbook_name
used_cookbook_attributes << $1
end

# loads/includes attributes
if line.match(/include_attribute [\'\"](\w+)[\'\"]/) || line.match(/include_attribute [\'\"](\w+)::\w+[\'\"]/)
loaded_cookbook_attributes << $1
end
end

used_cookbook_attributes.uniq!
loaded_cookbook_attributes.uniq!

used_cookbook_attributes_without_include = used_cookbook_attributes - loaded_cookbook_attributes

used_cookbook_attributes_without_include.delete_if{|cookbook_attribute| KNOWN_COOKBOOK_ATTRIBUTES[cookbook_attribute] == :any || loaded_cookbook_attributes.include?(KNOWN_COOKBOOK_ATTRIBUTES[cookbook_attribute]) }

if used_cookbook_attributes_without_include.size > 0
puts "#{file} used attributes from #{used_cookbook_attributes.inspect} but does only loads from #{loaded_cookbook_attributes.inspect}"
found_trouble = true
end

if found_trouble
exit 1
end
end
end

desc 'check syntax of ruby files'
task :validate_syntax do
Dir['**/*.rb'].each do |file|
Expand All @@ -24,4 +76,4 @@ task :validate_syntax do
end

desc 'run all checks'
task :default => [:validate_literal_includes, :validate_syntax]
task :default => [:validate_literal_includes, :validate_syntax, :validate_attribute_dependencies]
7 changes: 4 additions & 3 deletions agent_version/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
template '/root/scalarium-agent/TARGET_VERSION' do
template "#{node[:scalarium_agent_root]}/TARGET_VERSION" do
cookbook 'agent_version'
source 'TARGET_VERSION.erb'
owner 'root'
group 'root'
backup false
owner 'scalarium-agent'
group 'scalarium-agent'
mode 0600
variables :version => node.scalarium.agent_version
end
5 changes: 4 additions & 1 deletion apache2/attributes/apache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@
# logrotate
default[:apache][:logrotate][:schedule] = 'daily'
default[:apache][:logrotate][:rotate] = '30'
default[:apache][:logrotate][:delaycompress] = true
default[:apache][:logrotate][:delaycompress] = true
default[:apache][:logrotate][:mode] = '640'
default[:apache][:logrotate][:owner] = 'root'
default[:apache][:logrotate][:group] = 'adm'
20 changes: 3 additions & 17 deletions apache2/definitions/web_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,9 @@
include_recipe "apache2::mod_deflate"
include_recipe "apache2::mod_headers"

ruby_block 'Detect includes for vhost' do
inner_params = params
inner_application_name = application_name
inner_node = node

block do
if File.exists?(local_config = "#{inner_node[:apache][:dir]}/sites-available/#{inner_application_name}.conf.d/local")
Chef::Log.info("local config for #{inner_application_name} detected")
inner_params[:local_config] = local_config
end

if File.exists?(rewrite_config = "#{inner_node[:apache][:dir]}/sites-available/#{inner_application_name}.conf.d/rewrite")
Chef::Log.info("rewrite config for #{inner_application_name} detected")
inner_params[:rewrite_config] = rewrite_config
end
end
end
directory "#{node[:apache][:dir]}/sites-available/#{application_name}.conf.d"
params[:rewrite_config] = "#{node[:apache][:dir]}/sites-available/#{application_name}.conf.d/rewrite"
params[:local_config] = "#{node[:apache][:dir]}/sites-available/#{application_name}.conf.d/local"

template "#{node[:apache][:dir]}/sites-available/#{application_name}.conf" do
Chef::Log.debug("Generating Apache site template for #{application_name.inspect}")
Expand Down
5 changes: 5 additions & 0 deletions apache2/recipes/stop.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include_recipe "apache2::service"

service "apache2" do
action :stop
end
11 changes: 11 additions & 0 deletions apache2/recipes/uninstall.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if File.exists?("/etc/init.d/apache2")
include_recipe "apache2::service"

service "apache2" do
action :stop
end

package "apache2" do
action :remove
end
end
2 changes: 1 addition & 1 deletion apache2/templates/default/logrotate.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
delaycompress
<% end -%>
notifempty
create 640 root adm
create <%= node[:apache][:logrotate][:mode] %> <%= node[:apache][:logrotate][:owner] %> <%= node[:apache][:logrotate][:group] %>
sharedscripts
postrotate
if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
Expand Down
1 change: 1 addition & 0 deletions dependencies/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
default[:dependencies][:gems] = {}
default[:dependencies][:debs] = {}
default[:dependencies][:npms] = {}
default[:dependencies][:update_debs] = false
default[:dependencies][:upgrade_debs] = false
default[:dependencies][:upgrade_gems] = false
Expand Down
25 changes: 25 additions & 0 deletions dependencies/libraries/current_gem_version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module Scalarium
module GemSupport
require 'rubygems/version'

def ensure_only_gem_version(name, ensured_version)
versions = `#{node[:dependencies][:gem_binary]} list #{name}`
versions = versions.scan(/(\d[a-zA-Z0-9\.]*)/).flatten.compact
for version in versions
next if version == ensured_version
Chef::Log.info("Uninstalling version #{version} of Rubygem #{name}")
system("#{node[:dependencies][:gem_binary]} uninstall #{name} -v=#{version}")
end
if versions.include?(ensured_version)
Chef::Log.info("Skipping installation of version #{ensured_version} of Rubygem #{name}: already installed")
else
Chef::Log.info("Installing version #{ensured_version} of Rubygem #{name}")
system("#{node[:dependencies][:gem_binary]} install #{name} -v=#{ensured_version} --no-ri --no-rdoc")
end
end
end
end

class Chef::Resource
include Scalarium::GemSupport
end
7 changes: 0 additions & 7 deletions dependencies/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
retries 2
gem_binary node[:dependencies][:gem_binary]
options "--no-ri --no-rdoc"
only_if do
raise "Could not find a candidate version to install for Gem: #{gem_name} - No such gem?" unless gem_available?(gem_name)
if new_gem_version_available?(gem_name)
Chef::Log.info("Installing new version of #{gem_name.inspect}")
true
end
end
end
end

1 change: 1 addition & 0 deletions deploy/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include_attribute "deploy::deploy"
36 changes: 26 additions & 10 deletions deploy/attributes/deploy.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
include_attribute 'deploy::logrotate'
include_attribute 'deploy::rails_stack'

default[:scalarium][:deploy_user][:shell] = '/bin/zsh'
default[:scalarium][:deploy_user][:user] = 'deploy'
default[:scalarium][:deploy_user][:group] = 'www-data'

default[:scalarium][:rails][:ignore_bundler_groups] = ['test', 'development']

default[:deploy] = {}
node[:deploy].each do |application, deploy|
default[:deploy][application][:deploy_to] = "/srv/www/#{application}"
default[:deploy][application][:release] = Time.now.utc.strftime("%Y%m%d%H%M%S")
default[:deploy][application][:release_path] = "#{node[:deploy][application][:deploy_to]}/releases/#{node[:deploy][application][:release]}"
default[:deploy][application][:current_path] = "#{node[:deploy][application][:deploy_to]}/current"
default[:deploy][application][:document_root] = ""
default[:deploy][application][:ignore_bundler_groups] = node[:scalarium][:rails][:ignore_bundler_groups]
if deploy[:document_root]
default[:deploy][application][:absolute_document_root] = "#{default[:deploy][application][:current_path]}/#{deploy[:document_root]}/"
else
Expand All @@ -19,33 +29,39 @@
default[:deploy][application][:rake] = "rake"
end
default[:deploy][application][:migrate] = false
default[:deploy][application][:migrate_command] = "#{default[:deploy][application][:rake]} db:migrate"
if node[:deploy][application][:auto_bundle_on_deploy]
default[:deploy][application][:migrate_command] = "if [ -f Gemfile ]; then echo 'Scalarium: Gemfile found - running migration with bundle exec' && bundle exec #{node[:deploy][application][:rake]} db:migrate; else echo 'Scalarium: no Gemfile - running plain migrations' && #{node[:deploy][application][:rake]} db:migrate; fi"
else
default[:deploy][application][:migrate_command] = "#{node[:deploy][application][:rake]} db:migrate"
end
default[:deploy][application][:rails_env] = 'production'
default[:deploy][application][:action] = 'deploy'
default[:deploy][application][:user] = 'deploy'
default[:deploy][application][:group] = 'www-data'
default[:deploy][application][:shell] = '/bin/zsh'
default[:deploy][application][:user] = node[:scalarium][:deploy_user][:user]
default[:deploy][application][:group] = node[:scalarium][:deploy_user][:group]
default[:deploy][application][:shell] = node[:scalarium][:deploy_user][:shell]
home = self[:passwd] &&
self[:passwd][self[:deploy][application][:user]] &&
self[:passwd][self[:deploy][application][:user]][:dir] || "/home/#{self[:deploy][application][:user]}"

default[:deploy][application][:home] = home
default[:deploy][application][:stack][:recipe] = "passenger_apache2::rails"
default[:deploy][application][:stack][:needs_reload] = true
default[:deploy][application][:stack][:service] = 'apache2'

default[:deploy][application][:sleep_before_restart] = 0
default[:deploy][application][:restart_command] = "touch tmp/restart.txt"
default[:deploy][application][:stack][:needs_reload] = true
default[:deploy][application][:enable_submodules] = true
default[:deploy][application][:shallow_clone] = true
default[:deploy][application][:delete_cached_copy] = true
default[:deploy][application][:symlink_before_migrate] = {}

default[:deploy][application][:environment] = {"RAILS_ENV" => deploy[:rails_env],
"RUBYOPT" => "",
"RACK_ENV" => deploy[:rails_env],
"HOME" => home}
default[:deploy][application][:ssl_support] = false
default[:deploy][application][:auto_npm_install_on_deploy] = true

# nodejs
default[:deploy][application][:nodejs][:restart_command] = "monit restart node_web_app_#{application}"
default[:deploy][application][:nodejs][:stop_command] = "monit stop node_web_app_#{application}"
end

default[:logrotate][:rotate] = 30
default[:logrotate][:dateformat] = false # set to '-%Y%m%d' to have date formatted logs
default[:scalarium][:skip_uninstall_of_other_rails_stack] = false
2 changes: 2 additions & 0 deletions deploy/attributes/logrotate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
default[:logrotate][:rotate] = 30
default[:logrotate][:dateformat] = false # set to '-%Y%m%d' to have date formatted logs
15 changes: 15 additions & 0 deletions deploy/attributes/rails_stack.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
default[:scalarium][:rails_stack][:name] = "apache_passenger"
case node[:scalarium][:rails_stack][:name]
when "apache_passenger"
default[:scalarium][:rails_stack][:recipe] = "passenger_apache2::rails"
default[:scalarium][:rails_stack][:needs_reload] = true
default[:scalarium][:rails_stack][:service] = 'apache2'
default[:scalarium][:rails_stack][:restart_command] = 'touch tmp/restart.txt'
when "nginx_unicorn"
default[:scalarium][:rails_stack][:recipe] = "unicorn::rails"
default[:scalarium][:rails_stack][:needs_reload] = true
default[:scalarium][:rails_stack][:service] = 'unicorn'
default[:scalarium][:rails_stack][:restart_command] = '../../shared/scripts/unicorn clean-restart'
else
raise "Unknown stack: #{node[:scalarium][:rails_stack][:name].inspect}"
end
Loading