bin/mu-configure in cloud-mu-2.0.0.pre.alpha9 vs bin/mu-configure in cloud-mu-2.0.0.pre.beta1
- old
+ new
@@ -103,35 +103,10 @@
"allow_invade_foreign_vpcs" => {
"title" => "Invade Foreign VPCs?",
"desc" => "If set to true, Mu will be allowed to modify routing and peering behavior of VPCs which it did not create, but for which it has permissions.",
"boolean" => true
},
- "jenkins" => {
- "title" => "Jenkins Continuous Integration",
- "rootonly" => true,
- "subtree" => {
- "enable" => {
- "title" => "Enable Jenkins",
- "desc" => "Enable Jenkins, with UI web-accessible at /jenkins.",
- "default" => false,
- "boolean" => true,
- "changes" => ["chefrun"]
- },
- "admin_email" => {
- "title" => "Jenkins Admin Email",
- "desc" => "Administative contact email for Jenkins",
- "pattern" => /\A([\w+\-].?)+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i,
- "changes" => ["chefrun"]
- },
- "admin_user" => {
- "title" => "Jenkins admin username",
- "desc" => "The name of a Mu user who will serve as the Jenkins admin.",
- "default" => "jenkins",
- "changes" => ["chefrun"]
- }
- }
- },
"aws" => {
"title" => "Amazon Web Services",
"named_subentries" => true,
"subtree" => {
"account_number" => {
@@ -587,13 +562,10 @@
$CONFIGURABLES["allow_invade_foreign_vpcs"]["default"] = false
$CONFIGURABLES["public_address"]["default"] = ips.first
$CONFIGURABLES["hostname"]["default"] = Socket.gethostname
$CONFIGURABLES["banner"]["default"] = "Mu Master at #{$CONFIGURABLES["public_address"]["default"]}"
- if $CONFIGURABLES["mu_admin_email"]["value"]
- $CONFIGURABLES["jenkins"]["subtree"]["admin_email"]["default"] = $CONFIGURABLES["mu_admin_email"]["value"]
- end
if $IN_AWS
# XXX move this crap to a callback hook for puttering around in the AWS submenu
aws = JSON.parse(open("http://169.254.169.254/latest/dynamic/instance-identity/document").read)
iam = nil
begin
@@ -975,12 +947,10 @@
if map[answer]['title'] == "Local Hostname"
# $CONFIGURABLES["aws"]["subtree"]["log_bucket_name"]["default"] = newval
# $CONFIGURABLES["google"]["subtree"]["log_bucket_name"]["default"] = newval
elsif map[answer]['title'] == "Public Address"
$CONFIGURABLES["banner"]["default"] = "Mu Master at #{newval}"
- elsif map[answer]['title'] == "Mu Admin Email"
- $CONFIGURABLES["jenkins"]["subtree"]["admin_email"]["default"] = newval
end
changed = true
puts ""
elsif ["q", "Q"].include?(answer)
return nil
@@ -1004,12 +974,12 @@
exit 1
end
end
if AMROOT
- require File.realpath(File.expand_path(File.dirname(__FILE__)+"/mu-load-config.rb"))
newcfg = cloneHash($MU_CFG)
+ require File.realpath(File.expand_path(File.dirname(__FILE__)+"/mu-load-config.rb"))
newcfg['multiuser'] = true
saveMuConfig(newcfg)
$MU_CFG = loadMuConfig($MU_SET_DEFAULTS)
end
@@ -1291,41 +1261,15 @@
system("chef-client -o 'recipe[mu-master::sssd]'")
exit 1 if $? != 0
end
end
-if $MU_CFG['jenkins'] and $MU_CFG['jenkins']['enable']
- MU::Groomer::Chef.loadChefLib
- chef_node = ::Chef::Node.load("MU-MASTER")
- begin
- data = MU::Groomer::Chef.getSecret(vault: "jenkins", item: "admin")
- MU::Groomer::Chef.grantSecretAccess("MU-MASTER", "jenkins", "admin")
- rescue MU::Groomer::Chef::MuNoSuchSecret
- MU.log "Saving keys for Jenkins admin user '#{$MU_CFG['jenkins']['admin_user']}' into Vault jenkins:admin", MU::NOTICE
- if !File.exists?("#{HOMEDIR}/.ssh/mu-jenkins-admin.pub") and !File.exists?("#{HOMEDIR}/.ssh/mu-jenkins-admin.pub")
- system("/usr/bin/ssh-keygen -N '' -f #{HOMEDIR}/.ssh/mu-jenkins-admin")
- end
- public_key = File.read("#{HOMEDIR}/.ssh/mu-jenkins-admin.pub").chomp
- private_key = File.read("#{HOMEDIR}/.ssh/mu-jenkins-admin").chomp
- MU::Groomer::Chef.saveSecret(
- vault: "jenkins",
- item: "admin",
- data: {
- "username": $MU_CFG['jenkins']['admin_user'],
- "private_key": private_key,
- "public_key": public_key
- }
- )
- end
-end
-
# Figure out if our run list is dumb
MU.log "Verifying MU-MASTER's Chef run list", MU::NOTICE
MU::Groomer::Chef.loadChefLib
chef_node = ::Chef::Node.load("MU-MASTER")
run_list = ["role[mu-master]"]
-run_list << "role[mu-master-jenkins]" if $MU_CFG['jenkins'] and $MU_CFG['jenkins']['enable']
run_list.concat($MU_CFG['master_runlist_extras']) if $MU_CFG['master_runlist_extras'].is_a?(Array)
set_runlist = false
run_list.each { |rl|
set_runlist = true if !chef_node.run_list?(rl)
}
@@ -1380,10 +1324,10 @@
MU.log "Regenerating documentation in /var/www/html/docs"
%x{#{MU_BASE}/lib/bin/mu-gen-docs}
if $INITIALIZE
MU.log "Setting initial password for admin user 'mu', for logging into Nagios and other built-in services.", MU::NOTICE
- puts %x{#{MU_BASE}/lib/bin/mu-user-manage -g mu}
+ puts %x{#{MU_BASE}/lib/bin/mu-user-manage -g mu -n "#{$MU_CFG['mu_admin_name']}"}
MU.log "If Scratchpad web interface is not accessible, try the following:", MU::NOTICE
puts "#{MU_BASE}/lib/bin/mu-user-manage -g --no-scratchpad mu".bold
end
if !ENV['PATH'].match(/(^|:)#{Regexp.quote(MU_BASE)}\/bin(:|$)/)