cookbooks/mu-master/recipes/init.rb in cloud-mu-2.0.0.pre.alpha7 vs cookbooks/mu-master/recipes/init.rb in cloud-mu-2.0.0.pre.alpha8
- old
+ new
@@ -38,11 +38,11 @@
CHEF_SERVER_VERSION="12.17.15-1"
CHEF_CLIENT_VERSION="14.4.56"
KNIFE_WINDOWS="1.9.0"
MU_BASE="/opt/mu"
MU_BRANCH="Azure_you_want_azure" # GIT HOOK EDITABLE DO NOT TOUCH
-realbranch=`cd #{MU_BASE}/lib && git rev-parse --abbrev-ref HEAD`
+realbranch=`cd #{MU_BASE}/lib && git rev-parse --abbrev-ref HEAD` # ~FC048
if ENV.key?('MU_BRANCH')
MU_BRANCH = ENV['MU_BRANCH']
elsif $?.exitstatus == 0
MU_BRANCH=realbranch.chomp
@@ -85,20 +85,20 @@
#link "/tmp/.s.PGSQL.5432" do
# to "/var/run/postgresql/.s.PGSQL.5432"
# owner "opscode-pgsql"
# group "opscode-pgsql"
# action :nothing
-# only_if { !::File.exists?("/tmp/.s.PGSQL.5432") }
-# only_if { ::File.exists?("/var/run/postgresql/.s.PGSQL.5432") }
+# only_if { !::File.exist?("/tmp/.s.PGSQL.5432") }
+# only_if { ::File.exist?("/var/run/postgresql/.s.PGSQL.5432") }
#end
link "/var/run/postgresql/.s.PGSQL.5432" do
to "/tmp/.s.PGSQL.5432"
# owner "opscode-pgsql"
# group "opscode-pgsql"
notifies :create, "directory[/var/run/postgresql]", :before
- only_if { !::File.exists?("/var/run/postgresql/.s.PGSQL.5432") }
-# only_if { ::File.exists?("/tmp/.s.PGSQL.5432") }
+ only_if { !::File.exist?("/var/run/postgresql/.s.PGSQL.5432") }
+# only_if { ::File.exist?("/tmp/.s.PGSQL.5432") }
end
execute "Chef Server rabbitmq workaround" do
# This assumes we get clean stop, which *should* be the case if we execute
# before any upgrade or reconfigure. If that assumption is wrong we'd prepend:
# stop private-chef-runsvdir ; ps auxww | egrep '(opscode|runsv|postgres)' | grep -v grep | awk '{print $2}' | xargs kill
@@ -118,11 +118,11 @@
127.0.0.1 localhost
::1 localhost6.localdomain6 localhost6
"
notifies :create, "remote_file[back up /etc/hosts]", :before
only_if { RUNNING_STANDALONE }
- not_if { ::Dir.exists?("#{MU_BASE}/lib/.git") }
+ not_if { ::Dir.exist?("#{MU_BASE}/lib/.git") }
end
execute "reconfigure Chef server" do
command "/opt/opscode/bin/chef-server-ctl reconfigure"
action :nothing
@@ -217,11 +217,11 @@
git "#{MU_BASE}/lib" do
repository "git://github.com/cloudamatic/mu.git"
revision MU_BRANCH
checkout_branch MU_BRANCH
enable_checkout false
- not_if { ::Dir.exists?("#{MU_BASE}/lib/.git") }
+ not_if { ::Dir.exist?("#{MU_BASE}/lib/.git") }
notifies :run, "bash[set git default branch to #{MU_BRANCH}]", :immediately
end
# Enable some git hook weirdness for Mu developers
["post-merge", "post-checkout", "post-rewrite"].each { |hook|
@@ -273,25 +273,25 @@
end
# REMOVE OLD RUBYs
execute "clean up old Ruby 2.1.6" do
command "rm -rf /opt/rubies/ruby-2.1.6"
- only_if { ::Dir.exists?("/opt/rubies/ruby-2.1.6") }
+ only_if { ::Dir.exist?("/opt/rubies/ruby-2.1.6") }
end
yum_package 'ruby23-2.3.1-1.el7.centos.x86_64' do
action :purge
end
execute "Kill ruby-2.3.1" do
command "yum erase ruby23-2.3.1-1.el7.centos.x86_64 -y"
- only_if { ::Dir.exists?("/opt/rubies/ruby-2.3.1") }
+ only_if { ::Dir.exist?("/opt/rubies/ruby-2.3.1") }
end
execute "clean up old ruby-2.3.1" do
command "rm -rf /opt/rubies/ruby-2.3.1"
- only_if { ::Dir.exists?("/opt/rubies/ruby-2.3.1") }
+ only_if { ::Dir.exist?("/opt/rubies/ruby-2.3.1") }
end
# Regular old rpm-based installs
rpms.each_pair { |pkg, src|
rpm_package pkg do
@@ -404,12 +404,12 @@
gem_package "purge #{rubydir} knife windows #{Regexp.last_match[1]} #{gembin}" do
gem_binary gembin
package_name "knife-windows"
version Regexp.last_match[1]
action :remove
- only_if { ::Dir.exists?(dir) }
- only_if { ::Dir.exists?(gemdir) }
+ only_if { ::Dir.exist?(dir) }
+ only_if { ::Dir.exist?(gemdir) }
end
execute "rm -rf #{gemdir}/knife-windows-#{Regexp.last_match[1]}"
}
# XXX rely on bundler to get this right for us
@@ -424,11 +424,11 @@
# execute "Patch #{rubydir}'s knife-windows for Cygwin SSH bootstraps" do
# cwd "#{gemdir}/knife-windows-#{KNIFE_WINDOWS}"
# command "patch -p1 < #{MU_BASE}/lib/install/knife-windows-cygwin-#{KNIFE_WINDOWS}.patch"
# not_if "grep -i 'locate_config_value(:cygwin)' #{gemdir}/knife-windows-#{KNIFE_WINDOWS}/lib/chef/knife/bootstrap_windows_base.rb"
# notifies :restart, "service[chef-server]", :delayed if rubydir == "/opt/opscode/embedded"
-# only_if { ::Dir.exists?(gemdir) }
+# only_if { ::Dir.exist?(gemdir) }
# XXX notify mommacat if we're *not* in chef-apply... RUNNING_STANDALONE
# end
end
}
@@ -502,10 +502,10 @@
EOH
action :nothing
end
execute "ssh-keygen -N '' -f #{ROOT_SSH_DIR}/id_rsa" do
umask 0177
- not_if { ::File.exists?("#{ROOT_SSH_DIR}/id_rsa") }
+ not_if { ::File.exist?("#{ROOT_SSH_DIR}/id_rsa") }
notifies :run, "bash[add localhost ssh to authorized_keys and config]", :immediately
end
file "/etc/chef/client.pem" do
action :nothing
end