Skip to content

Commit

Permalink
Merge branch 'six_pack_albs'
Browse files Browse the repository at this point in the history
  • Loading branch information
jstange committed Apr 21, 2017
2 parents 8977812 + 3f80173 commit cf351a0
Show file tree
Hide file tree
Showing 83 changed files with 3,559 additions and 1,420 deletions.
22 changes: 12 additions & 10 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
if !ENV.include?('MU_LIBDIR')
if !ENV.include?('MU_INSTALLDIR')
raise "Can't find MU_LIBDIR or MU_INSTALLDIR in my environment!"
end
ENV['MU_LIBDIR'] = ENV['MU_INSTALLDIR']+"/lib"

if !ENV.include?('MU_COOKBOOK_ROOT')
if !ENV.include?('MU_LIBDIR')
if !ENV.include?('MU_INSTALLDIR')
raise "Can't find MU_LIBDIR or MU_INSTALLDIR in my environment!"
end
ENV['MU_LIBDIR'] = ENV['MU_INSTALLDIR']+"/lib"
end
ENV['MU_COOKBOOK_ROOT'] = ENV['MU_LIBDIR']
end
cookbookPath = "#{ENV['MU_LIBDIR']}/cookbooks"
siteCookbookPath = "#{ENV['MU_LIBDIR']}/site_cookbooks"
cookbookPath = "#{ENV['MU_COOKBOOK_ROOT']}/cookbooks"
siteCookbookPath = "#{ENV['MU_COOKBOOK_ROOT']}/site_cookbooks"

source "https://supermarket.chef.io"

cookbook 'apache2', '~> 3.2.2'
cookbook 'aws', '~> 2.9.3'
cookbook 'build-essential', '~> 2.0'
cookbook 'chef-splunk', path: "#{cookbookPath}/chef-splunk"
cookbook 'demo', path: "#{siteCookbookPath}/demo"
cookbook 'mu-splunk', path: "#{cookbookPath}/mu-splunk"
cookbook 'freebsd', '~> 0.1.9'
cookbook 'gunicorn', '~> 1.1.2'
cookbook 'logrotate', '~> 1.9.2'
cookbook 'jenkins', '~> 4.0.0'
cookbook 'memcached', '~> 1.7.2'
cookbook 'mu-activedirectory', path: "#{cookbookPath}/mu-activedirectory"
cookbook 'mu-demo', path: "#{cookbookPath}/mu-demo"
Expand Down
129 changes: 36 additions & 93 deletions Berksfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ DEPENDENCIES
apache2 (~> 3.2.2)
aws (~> 2.9.3)
build-essential (~> 2.0)
chef-splunk
path: cookbooks/chef-splunk
demo
path: site_cookbooks/demo
freebsd (~> 0.1.9)
gunicorn (~> 1.1.2)
jenkins (~> 4.0.0)
logrotate (~> 1.9.2)
memcached (~> 1.7.2)
mu-activedirectory
Expand All @@ -29,6 +24,8 @@ DEPENDENCIES
path: cookbooks/mu-openvpn
mu-php54
path: cookbooks/mu-php54
mu-splunk
path: cookbooks/mu-splunk
mu-tools
path: cookbooks/mu-tools
mu-utility
Expand All @@ -50,24 +47,7 @@ GRAPH
7-zip (1.0.2)
windows (>= 1.2.2)
apache2 (3.2.2)
application (5.1.0)
poise (~> 2.4)
poise-service (~> 1.0)
application_python (4.0.0)
application (~> 5.0)
poise (~> 2.0)
poise-python (~> 1.0)
poise-service (~> 1.0)
application_ruby (4.0.1)
application (~> 5.0)
poise (~> 2.0)
poise-ruby (~> 2.1)
poise-service (~> 1.0)
apt (2.9.2)
ark (2.0.0)
build-essential (>= 0.0.0)
seven_zip (>= 0.0.0)
windows (>= 0.0.0)
aws (2.9.3)
ohai (>= 2.1.0)
bind (1.1.2)
Expand All @@ -76,44 +56,30 @@ GRAPH
rsyslog (>= 2.0)
build-essential (2.4.0)
7-zip (>= 0.0.0)
chef-splunk (1.3.0)
chef-vault (>= 1.0.4)
chef-sugar (3.4.0)
chef-vault (2.1.0)
compat_resource (12.14.7)
chef-vault (2.1.1)
compat_resource (12.16.3)
cpan (0.0.34)
database (6.0.0)
database (6.1.1)
postgresql (>= 1.0.0)
demo (0.3.0)
application (>= 0.0.0)
application_python (>= 0.0.0)
application_ruby (>= 0.0.0)
chef-vault (>= 0.0.0)
git (>= 0.0.0)
mysql (>= 0.0.0)
nginx (> 2.0.0)
nodejs (>= 0.0.0)
php (>= 0.0.0)
ruby_build (>= 0.0.0)
dmg (3.0.0)
firewall (2.5.2)
dmg (3.1.0)
firewall (2.5.4)
chef-sugar (>= 0.0.0)
freebsd (0.1.10)
git (5.0.1)
git (6.0.0)
build-essential (>= 0.0.0)
dmg (>= 0.0.0)
yum-epel (>= 0.0.0)
gunicorn (1.1.6)
python (>= 0.0.0)
homebrew (2.1.2)
build-essential (>= 2.1.2)
iis (5.0.4)
windows (>= 1.34.6)
java (1.42.0)
homebrew (3.0.0)
iis (5.1.0)
windows (>= 2.0)
java (1.48.0)
apt (>= 0.0.0)
homebrew (>= 0.0.0)
windows (>= 0.0.0)
jenkins (4.0.0)
jenkins (4.1.2)
compat_resource (>= 12.14.6)
runit (>= 1.7)
logrotate (1.9.2)
Expand Down Expand Up @@ -141,10 +107,10 @@ GRAPH
mu-glusterfs (0.1.0)
mu-firewall (>= 0.0.0)
yum (>= 0.0.0)
mu-jenkins (0.4.0)
mu-jenkins (0.5.0)
chef-vault (>= 0.0.0)
java (>= 0.0.0)
jenkins (>= 0.0.0)
jenkins (~> 4.1.2)
mu-utility (>= 0.0.0)
mu-master (0.8.1)
bind (>= 0.0.0)
Expand Down Expand Up @@ -172,13 +138,15 @@ GRAPH
mysql (>= 0.0.0)
simple_iptables (>= 0.0.0)
yum-epel (>= 0.0.0)
mu-splunk (1.3.0)
chef-vault (>= 1.0.4)
mu-tools (1.0.4)
build-essential (>= 0.0.0)
chef-splunk (>= 0.0.0)
chef-vault (>= 0.0.0)
database (>= 0.0.0)
java (>= 0.0.0)
mu-firewall (>= 0.0.0)
mu-splunk (>= 0.0.0)
mu-utility (>= 0.0.0)
nagios (>= 0.0.0)
oracle-instantclient (>= 0.0.0)
Expand All @@ -188,7 +156,7 @@ GRAPH
yum-epel (>= 0.0.0)
mu-utility (0.6.0)
windows (>= 0.0.0)
mysql (8.0.4)
mysql (8.3.0)
mysql-chef_gem (0.0.5)
build-essential (>= 0.0.0)
mysql (>= 0.0.0)
Expand All @@ -214,73 +182,48 @@ GRAPH
nginx (>= 0.0.0)
perl (>= 0.0.0)
runit (>= 0.0.0)
nodejs (2.4.4)
apt (>= 0.0.0)
ark (>= 0.0.0)
build-essential (>= 0.0.0)
homebrew (>= 0.0.0)
yum-epel (>= 0.0.0)
nrpe (1.6.4)
nrpe (2.0.0)
build-essential (>= 0.0.0)
yum-epel (>= 0.0.0)
ohai (2.1.0)
openssl (4.4.0)
chef-sugar (>= 3.1.1)
openssl (7.0.1)
oracle-instantclient (1.1.0)
build-essential (>= 0.0.0)
cpan (>= 0.0.0)
php (>= 0.0.0)
packagecloud (0.2.5)
perl (4.0.0)
packagecloud (0.3.0)
perl (5.1.0)
windows (>= 0.0.0)
php (2.1.1)
php (3.0.0)
build-essential (>= 0.0.0)
iis (>= 0.0.0)
mysql (>= 6.0.0)
windows (>= 0.0.0)
xml (>= 0.0.0)
yum-epel (>= 0.0.0)
poise (2.7.1)
poise-archive (1.3.0)
poise (~> 2.6)
poise-languages (2.0.3)
poise (~> 2.5)
poise-archive (~> 1.0)
poise-python (1.5.1)
poise (~> 2.7)
poise-languages (~> 2.0)
poise-ruby (2.2.0)
poise (~> 2.0)
poise-languages (~> 2.0)
poise-service (1.4.2)
poise (~> 2.0)
postfix (4.0.0)
postgresql (4.0.6)
apt (>= 1.9.0)
build-essential (>= 0.0.0)
openssl (~> 4.0)
postfix (5.0.1)
postgresql (6.1.1)
build-essential (>= 2.0.0)
compat_resource (>= 12.16.3)
openssl (>= 4.0)
python (1.4.7)
build-essential (>= 0.0.0)
yum-epel (>= 0.0.0)
rsyslog (4.0.1)
compat_resource (>= 0.0.0)
ruby_build (1.0.0)
yum-epel (>= 0.0.0)
rsyslog (6.0.1)
runit (1.8.0)
packagecloud (>= 0.0.0)
yum-epel (>= 0.0.0)
s3fs (0.2.0)
build-essential (>= 0.0.0)
mu-utility (>= 0.0.0)
seven_zip (2.0.2)
windows (>= 1.2.2)
simple_iptables (0.7.5)
tomcat (2.3.2)
compat_resource (>= 12.10)
simple_iptables (0.8.0)
tomcat (2.4.0)
compat_resource (>= 12.16)
windows (2.0.2)
xml (3.0.0)
xml (3.1.1)
build-essential (>= 0.0.0)
yum (3.13.0)
yum-epel (0.7.1)
yum (>= 3.6.3)
zap (0.11.4)
zap (0.12.0)
zipfile (0.1.0)
19 changes: 18 additions & 1 deletion bin/mu-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require 'mu'
$opts = Trollop::options do
banner <<-EOS
Usage:
#{$0} [-e <environment>] [-r region] [-v] [-d] [-w] [-c] [-n] [-s] [-j] [-p parameter=value] /path/to/stack/config.[json|yaml] [-u deploy_id]
#{$0} [-e <environment>] [-r region] [-v] [-d] [-w] [-c] [-n] [-s] [-j] [-p parameter=value] /path/to/stack/config.[json|yaml] [-u deploy_id [-l]] [-r deploy_id]
EOS
opt :environment, "Environment to set on creation.", :require => false, :default => "dev"
opt :region, "Default region for newly-created cloud resources.", :require => false, :default => MU.myRegion, :type => :string
Expand All @@ -39,6 +39,7 @@ Usage:
opt :skipinitialupdates, "Node bootstrapping normally runs an internal recipe that does a full system update. This disables that behavior.", :require => false, :default => false, :type => :boolean
opt :parameter, "Pass a parameter to the configuration parser (Name=Value). This will be presented to your config file as the ERB variable $Name.", :require => false, :type => :string, :multi => true
opt :update, "Update the stored configuration of an existing deployment, instead of creating a new deploy.", :require => false, :type => :string
opt :liveupdate, "EXPERIMENTAL: Attempt to create or update live cloud resources after running --update", :require => false, :type => :boolean, :default => false
opt :cloudformation, "Emit Amazon Web Services targets into a CloudFormation template instead of building real services.", :require => false, :default => false, :type => :boolean
opt :cloudformation_output, "When emitting a CloudFormation template, put the final product in this location instead of in /tmp. Takes a local file path or an s3:// URI. S3 uploads will be given AUTHENTICATED-READ permissions.", :require => false, :type => :string
opt :verbose, "Display debugging output.", :require => false, :default => false, :type => :boolean
Expand All @@ -53,6 +54,11 @@ if $opts[:verbose] and $opts[:quiet]
exit 1
end

if $opts[:liveupdate] and !$opts[:update]
MU.log "--liveupdate only valid when combined with --update", MU::ERR
exit 1
end

MU.setVar("curRegion", $opts[:region]) if $opts[:region]
MU.setLogging(verbosity, $opts[:web])

Expand Down Expand Up @@ -112,6 +118,17 @@ end
if $opts[:update]
deploy = MU::MommaCat.new($opts[:update])
deploy.updateBasketofKittens(stack_conf)
if $opts[:liveupdate]
deployer = MU::Deploy.new(
deploy.environment,
verbosity: verbosity,
webify_logs: $opts[:web],
nocleanup: true,
stack_conf: stack_conf,
deploy_id: $opts[:update]
)
deployer.run
end
exit 0
end

Expand Down
31 changes: 18 additions & 13 deletions bin/mu-node-manage
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,27 @@ if ARGV.empty? and !$opts[:all] and !$opts[:platform] and !$opts[:environment] a
end

Thread.abort_on_exception = true
master_pid = Process.pid
$children = {}
["HUP", "INT", "QUIT", "TRAP", "ABRT", "IOT", "KILL", "SYS", "PIPE", "ALRM", "TERM", "URG", "STOP", "TSTP", "CONT", "CHLD", "CLD", "TTIN", "TTOU", "IO", "XCPU", "XFSZ", "PROF", "WINCH", "USR1", "USR2", "PWR", "POLL"].each { |sig|

Signal.trap(sig) do
$children.each_pair { |pid, node|
if ["INT", "TERM", "EXIT", "ABRT"].include?(sig)
Process.kill("KILL", pid) # aka --dammit
else
begin
Process.kill(sig, pid)
rescue Errno::ESRCH
signals = Signal.list
signals.keys.each { |sig|
# Ruby 2.3 doesn't want to trap these
next if ["ILL", "FPE", "KILL", "BUS", "SEGV", "STOP", "VTALRM"].include?(sig)
Signal.trap(signals[sig]) do
if Process.pid == master_pid
$children.each_pair { |pid, node|
if ["INT", "TERM", "EXIT", "ABRT"].include?(sig)
Process.kill("KILL", pid) # aka --dammit
else
begin
Process.kill(sig, pid)
rescue Errno::ESRCH
end
end
}
if ["INT", "TERM", "EXIT"].include?(sig)
Process.waitall
end
}
if ["INT", "TERM", "EXIT"].include?(sig)
Process.waitall
end
end
}
Expand Down
6 changes: 5 additions & 1 deletion bin/mu-self-update
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ install_system_packages
set_hostname
configure_ec2_security_group
install_mu_executables $@ || install_cap_executables $@
set +e
install_ruby purgeold
set -e

echo "${GREEN}Updating bundles for Ruby deploy tools${NORM}"
cd $MU_LIBDIR/modules
Expand All @@ -191,8 +194,8 @@ generate_docs
/usr/sbin/groupdel mu-users > /dev/null 2>&1
/usr/sbin/groupdel mu-admins > /dev/null 2>&1

/sbin/service nagios stop
set +e
install_ruby purgeold
patch_knife_windows
generate_ssl_certs skip_chef
install_chef
Expand Down Expand Up @@ -233,3 +236,4 @@ if [ "$stashed_changes" == "1" ];then
fi
fi
set_permissions
/sbin/service nagios start
Loading

0 comments on commit cf351a0

Please sign in to comment.