bin/mu-azure-setup in cloud-mu-3.4.0 vs bin/mu-azure-setup in cloud-mu-3.5.0

- old
+ new

@@ -42,10 +42,11 @@ # opt :ip, "Attempt to configure the IP requested in the CHEF_PUBLIC_IP environment variable, or if none is set, to associate an arbitrary Elastic IP.", :require => false, :default => false, :type => :boolean opt :sg, "Attempt to configure a Security Group with appropriate permissions.", :require => false, :default => false, :type => :boolean opt :logs, "Ensure the presence of an Cloud Storage bucket prefixed with 'Mu_Logs' for use with CloudTrails, syslog, etc.", :require => false, :default => false, :type => :boolean # opt :dns, "Ensure the presence of a private DNS Zone called for internal amongst Mu resources.", :require => false, :default => false, :type => :boolean opt :uploadlogs, "Push today's log files to the Cloud Storage bucket created by the -l option.", :require => false, :default => false, :type => :boolean + opt :optdisk, "Create a block volume for /opt and slide our installation onto it", :require => false, :default => false, :type => :boolean end if MU::Cloud::Azure.hosted? and !$MU_CFG['google'] new_cfg = $MU_CFG.dup cfg_blob = MU::Cloud::Azure.hosted_config @@ -242,9 +243,42 @@ # XXX stop doing this per-bucket, chowderhead MU::Master.disk("/dev/xvdl", "/Mu_Logs", 50, "log_vol_ebs_key", "ram7") } end + +if $opts[:optdisk] and !File.open("/etc/mtab").read.match(/ \/opt[\s\/]/) + puts "PLACEHOLDER" +# myname = MU::Cloud::Google.getGoogleMetaData("instance/name") +# wd = Dir.getwd +# Dir.chdir("/") +# if File.exists?("/opt/opscode/bin/chef-server-ctl") +# system("/opt/opscode/bin/chef-server-ctl stop") +# end +# if !File.exists?("/sbin/mkfs.xfs") +# system("/usr/bin/yum -y install xfsprogs") +# end +# MU::Master.disk(myname+"-mu-opt", "/opt_tmp", 30) +# uuid = MU::Master.diskUUID(myname+"-mu-opt") +# if !uuid or uuid.empty? +# MU.log "Failed to retrieve UUID of block device #{myname}-mu-opt", MU::ERR, details: MU::Cloud::AWS.realDevicePath(myname+"-mu-opt") +# exit 1 +# end +# MU.log "Moving contents of /opt to /opt_tmp", MU::NOTICE +# system("/bin/mv /opt/* /opt_tmp/") +# exit 1 if $?.exitstatus != 0 +# MU.log "Remounting /opt_tmp /opt", MU::NOTICE +# system("/bin/umount /opt_tmp") +# exit 1 if $?.exitstatus != 0 +# system("echo '#{uuid} /opt xfs defaults 0 0' >> /etc/fstab") +# system("/bin/mount -a") +# exit 1 if $?.exitstatus != 0 +# if File.exists?("/opt/opscode/bin/chef-server-ctl") +# system("/opt/opscode/bin/chef-server-ctl start") +# end +# Dir.chdir(wd) +end + if $opts[:dns] end if $opts[:uploadlogs]