cloud-mu 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ansible/roles/mu-nat/tasks/main.yml +3 -0
- data/bin/mu-aws-setup +41 -7
- data/bin/mu-azure-setup +34 -0
- data/bin/mu-configure +214 -119
- data/bin/mu-gcp-setup +37 -2
- data/bin/mu-node-manage +3 -0
- data/bin/mu-refresh-ssl +67 -0
- data/bin/mu-run-tests +14 -4
- data/bin/mu-self-update +30 -10
- data/bin/mu-upload-chef-artifacts +30 -26
- data/cloud-mu.gemspec +8 -6
- data/cookbooks/mu-master/attributes/default.rb +5 -1
- data/cookbooks/mu-master/metadata.rb +2 -2
- data/cookbooks/mu-master/recipes/default.rb +81 -26
- data/cookbooks/mu-master/recipes/init.rb +197 -62
- data/cookbooks/mu-master/recipes/update_nagios_only.rb +1 -1
- data/cookbooks/mu-master/recipes/vault.rb +78 -77
- data/cookbooks/mu-master/templates/default/mods/rewrite.conf.erb +1 -0
- data/cookbooks/mu-master/templates/default/nagios.conf.erb +103 -0
- data/cookbooks/mu-master/templates/default/web_app.conf.erb +14 -30
- data/cookbooks/mu-tools/attributes/default.rb +5 -0
- data/cookbooks/mu-tools/files/centos-6/CentOS-Base.repo +47 -0
- data/cookbooks/mu-tools/libraries/helper.rb +12 -2
- data/cookbooks/mu-tools/libraries/monkey.rb +1 -1
- data/cookbooks/mu-tools/recipes/apply_security.rb +6 -0
- data/cookbooks/mu-tools/recipes/aws_api.rb +6 -4
- data/cookbooks/mu-tools/recipes/base_repositories.rb +1 -1
- data/cookbooks/mu-tools/recipes/gcloud.rb +2 -9
- data/cookbooks/mu-tools/recipes/google_api.rb +5 -2
- data/cookbooks/mu-tools/resources/disk.rb +108 -58
- data/extras/Gemfile.lock.bootstrap +394 -0
- data/extras/bucketstubs/error.html +0 -0
- data/extras/bucketstubs/index.html +0 -0
- data/extras/clean-stock-amis +9 -9
- data/extras/git_rpm/build.sh +20 -0
- data/extras/git_rpm/mugit.spec +53 -0
- data/extras/image-generators/VMWare/centos8.yaml +15 -0
- data/extras/openssl_rpm/build.sh +19 -0
- data/extras/openssl_rpm/mussl.spec +46 -0
- data/extras/python_rpm/muthon.spec +14 -4
- data/extras/ruby_rpm/muby.spec +9 -5
- data/extras/sqlite_rpm/build.sh +19 -0
- data/extras/sqlite_rpm/muqlite.spec +47 -0
- data/install/installer +7 -5
- data/modules/mu.rb +12 -5
- data/modules/mu/cloud/machine_images.rb +1 -1
- data/modules/mu/cloud/providers.rb +6 -1
- data/modules/mu/cloud/resource_base.rb +1 -1
- data/modules/mu/cloud/ssh_sessions.rb +4 -0
- data/modules/mu/config.rb +28 -12
- data/modules/mu/config/database.rb +2 -2
- data/modules/mu/config/firewall_rule.rb +1 -1
- data/modules/mu/config/ref.rb +2 -2
- data/modules/mu/config/schema_helpers.rb +12 -3
- data/modules/mu/config/server.rb +10 -4
- data/modules/mu/config/server_pool.rb +2 -2
- data/modules/mu/config/vpc.rb +10 -10
- data/modules/mu/defaults/AWS.yaml +32 -32
- data/modules/mu/deploy.rb +23 -10
- data/modules/mu/groomers/chef.rb +2 -2
- data/modules/mu/master.rb +49 -3
- data/modules/mu/mommacat.rb +8 -5
- data/modules/mu/mommacat/naming.rb +2 -2
- data/modules/mu/mommacat/storage.rb +22 -27
- data/modules/mu/providers/aws.rb +142 -48
- data/modules/mu/providers/aws/alarm.rb +3 -3
- data/modules/mu/providers/aws/bucket.rb +19 -19
- data/modules/mu/providers/aws/cache_cluster.rb +22 -22
- data/modules/mu/providers/aws/cdn.rb +2 -2
- data/modules/mu/providers/aws/collection.rb +14 -14
- data/modules/mu/providers/aws/container_cluster.rb +27 -27
- data/modules/mu/providers/aws/database.rb +40 -39
- data/modules/mu/providers/aws/dnszone.rb +5 -5
- data/modules/mu/providers/aws/endpoint.rb +35 -35
- data/modules/mu/providers/aws/firewall_rule.rb +26 -23
- data/modules/mu/providers/aws/function.rb +28 -28
- data/modules/mu/providers/aws/group.rb +7 -7
- data/modules/mu/providers/aws/habitat.rb +2 -2
- data/modules/mu/providers/aws/job.rb +6 -6
- data/modules/mu/providers/aws/loadbalancer.rb +34 -34
- data/modules/mu/providers/aws/log.rb +14 -14
- data/modules/mu/providers/aws/msg_queue.rb +10 -10
- data/modules/mu/providers/aws/nosqldb.rb +8 -8
- data/modules/mu/providers/aws/notifier.rb +7 -7
- data/modules/mu/providers/aws/role.rb +17 -15
- data/modules/mu/providers/aws/search_domain.rb +10 -10
- data/modules/mu/providers/aws/server.rb +176 -95
- data/modules/mu/providers/aws/server_pool.rb +65 -105
- data/modules/mu/providers/aws/storage_pool.rb +17 -9
- data/modules/mu/providers/aws/user.rb +1 -1
- data/modules/mu/providers/aws/vpc.rb +103 -51
- data/modules/mu/providers/aws/vpc_subnet.rb +43 -39
- data/modules/mu/providers/azure.rb +78 -12
- data/modules/mu/providers/azure/server.rb +18 -3
- data/modules/mu/providers/cloudformation/server.rb +1 -1
- data/modules/mu/providers/google.rb +19 -4
- data/modules/mu/providers/google/folder.rb +6 -2
- data/modules/mu/providers/google/function.rb +65 -30
- data/modules/mu/providers/google/role.rb +1 -1
- data/modules/mu/providers/google/vpc.rb +27 -2
- data/modules/tests/aws-servers-with-handrolled-iam.yaml +37 -0
- data/modules/tests/k8s.yaml +1 -1
- metadata +24 -8
|
@@ -64,7 +64,12 @@ module MU
|
|
|
64
64
|
# code for each of its supported resource type classes.
|
|
65
65
|
failed = []
|
|
66
66
|
MU::Cloud.supportedClouds.each { |cloud|
|
|
67
|
-
|
|
67
|
+
begin
|
|
68
|
+
require "mu/providers/#{cloud.downcase}"
|
|
69
|
+
rescue LoadError, Gem::MissingSpecError => e
|
|
70
|
+
MU.log "Error loading #{cloud} library, calls into this provider will fail", MU::ERR, details: e.message
|
|
71
|
+
next
|
|
72
|
+
end
|
|
68
73
|
cloudclass = Object.const_get("MU").const_get("Cloud").const_get(cloud)
|
|
69
74
|
@@generic_class_methods_toplevel.each { |method|
|
|
70
75
|
if !cloudclass.respond_to?(method)
|
|
@@ -187,6 +187,10 @@ module MU
|
|
|
187
187
|
retry
|
|
188
188
|
# rescue SystemCallError, Timeout::Error, Errno::ECONNRESET, Errno::EHOSTUNREACH, Net::SSH::Proxy::ConnectError, SocketError, Net::SSH::Disconnect, Net::SSH::AuthenticationFailed, IOError, Net::SSH::ConnectionTimeout, Net::SSH::Proxy::ConnectError, MU::Cloud::NetSSHFail => e
|
|
189
189
|
rescue SystemExit, Timeout::Error, Net::SSH::AuthenticationFailed, Net::SSH::Disconnect, Net::SSH::ConnectionTimeout, Net::SSH::Proxy::ConnectError, Net::SSH::Exception, Errno::ECONNRESET, Errno::EHOSTUNREACH, Errno::ECONNREFUSED, Errno::EPIPE, SocketError, IOError => e
|
|
190
|
+
if !active?
|
|
191
|
+
raise MuError, "Server #{@mu_name} disappeared while I was attempting to log into it"
|
|
192
|
+
end
|
|
193
|
+
|
|
190
194
|
begin
|
|
191
195
|
session.close if !session.nil?
|
|
192
196
|
rescue Net::SSH::Disconnect, IOError => e
|
data/modules/mu/config.rb
CHANGED
|
@@ -437,27 +437,27 @@ module MU
|
|
|
437
437
|
# @param type [String]
|
|
438
438
|
# @param phase [String]
|
|
439
439
|
# @param no_create_wait [Boolean]
|
|
440
|
-
def self.addDependency(resource, name, type,
|
|
441
|
-
if ![nil, "create", "groom"].include?(
|
|
442
|
-
raise MuError, "Invalid
|
|
440
|
+
def self.addDependency(resource, name, type, their_phase: "create", my_phase: nil)
|
|
441
|
+
if ![nil, "create", "groom"].include?(their_phase)
|
|
442
|
+
raise MuError, "Invalid their_phase '#{their_phase}' while adding dependency #{type} #{name} to #{resource['name']}"
|
|
443
443
|
end
|
|
444
444
|
resource['dependencies'] ||= []
|
|
445
445
|
_shortclass, cfg_name, _cfg_plural, _classname = MU::Cloud.getResourceNames(type)
|
|
446
446
|
|
|
447
447
|
resource['dependencies'].each { |dep|
|
|
448
448
|
if dep['type'] == cfg_name and dep['name'].to_s == name.to_s
|
|
449
|
-
dep["
|
|
450
|
-
dep["
|
|
449
|
+
dep["their_phase"] = their_phase if their_phase
|
|
450
|
+
dep["my_phase"] = my_phase if my_phase
|
|
451
451
|
return
|
|
452
452
|
end
|
|
453
453
|
}
|
|
454
454
|
|
|
455
455
|
newdep = {
|
|
456
456
|
"type" => cfg_name,
|
|
457
|
-
"name" => name.to_s
|
|
458
|
-
"no_create_wait" => no_create_wait
|
|
457
|
+
"name" => name.to_s
|
|
459
458
|
}
|
|
460
|
-
newdep["
|
|
459
|
+
newdep["their_phase"] = their_phase if their_phase
|
|
460
|
+
newdep["my_phase"] = my_phase if my_phase
|
|
461
461
|
|
|
462
462
|
resource['dependencies'] << newdep
|
|
463
463
|
|
|
@@ -746,7 +746,7 @@ module MU
|
|
|
746
746
|
next if !acl_include["name"] and !acl_include["rule_name"]
|
|
747
747
|
acl_include["name"] ||= acl_include["rule_name"]
|
|
748
748
|
if haveLitterMate?(acl_include["name"], "firewall_rules")
|
|
749
|
-
MU::Config.addDependency(descriptor, acl_include["name"], "firewall_rule",
|
|
749
|
+
MU::Config.addDependency(descriptor, acl_include["name"], "firewall_rule", my_phase: ((cfg_name == "vpc") ? "groom" : "create"))
|
|
750
750
|
elsif acl_include["name"]
|
|
751
751
|
MU.log shortclass.to_s+" #{descriptor['name']} depends on FirewallRule #{acl_include["name"]}, but no such rule declared.", MU::ERR
|
|
752
752
|
ok = false
|
|
@@ -892,6 +892,10 @@ module MU
|
|
|
892
892
|
deleteme = []
|
|
893
893
|
|
|
894
894
|
resource["dependencies"].each { |dependency|
|
|
895
|
+
dependency["their_phase"] ||= dependency["phase"]
|
|
896
|
+
dependency.delete("phase")
|
|
897
|
+
dependency["my_phase"] ||= dependency["no_create_wait"] ? "groom" : "create"
|
|
898
|
+
dependency.delete("no_create_wait")
|
|
895
899
|
# make sure the thing we depend on really exists
|
|
896
900
|
sibling = haveLitterMate?(dependency['name'], dependency['type'])
|
|
897
901
|
if !sibling
|
|
@@ -929,10 +933,22 @@ module MU
|
|
|
929
933
|
end
|
|
930
934
|
end
|
|
931
935
|
|
|
936
|
+
if dependency['their_phase'] == "groom"
|
|
937
|
+
sibling['dependencies'].each { |sib_dep|
|
|
938
|
+
next if sib_dep['type'] != cfg_name or sib_dep['their_phase'] != "groom"
|
|
939
|
+
cousin = haveLitterMate?(sib_dep['name'], sib_dep['type'])
|
|
940
|
+
if cousin and cousin['name'] == resource['name']
|
|
941
|
+
MU.log "Circular dependency between #{type} #{resource['name']} <=> #{dependency['type']} #{dependency['name']}", MU::ERR, details: [ resource['name'] => dependency, sibling['name'] => sib_dep ]
|
|
942
|
+
ok = false
|
|
943
|
+
end
|
|
944
|
+
}
|
|
945
|
+
end
|
|
946
|
+
|
|
932
947
|
# Check for a circular relationship that will lead to a deadlock
|
|
933
948
|
# when creating resource. This only goes one layer deep, and does
|
|
934
949
|
# not consider groom-phase deadlocks.
|
|
935
|
-
if dependency['
|
|
950
|
+
if dependency['their_phase'] == "groom" or
|
|
951
|
+
dependency['my_phase'] == "groom" or (
|
|
936
952
|
!MU::Cloud.resourceClass(sibling['cloud'], type).deps_wait_on_my_creation and
|
|
937
953
|
!MU::Cloud.resourceClass(resource['cloud'], type).waits_on_parent_completion
|
|
938
954
|
)
|
|
@@ -941,7 +957,7 @@ module MU
|
|
|
941
957
|
|
|
942
958
|
if sibling['dependencies']
|
|
943
959
|
sibling['dependencies'].each { |sib_dep|
|
|
944
|
-
next if sib_dep['type'] != cfg_name or sib_dep['
|
|
960
|
+
next if sib_dep['type'] != cfg_name or sib_dep['my_phase'] == "groom"
|
|
945
961
|
cousin = haveLitterMate?(sib_dep['name'], sib_dep['type'])
|
|
946
962
|
if cousin and cousin['name'] == resource['name']
|
|
947
963
|
MU.log "Circular dependency between #{type} #{resource['name']} <=> #{dependency['type']} #{dependency['name']}", MU::ERR, details: [ resource['name'] => dependency, sibling['name'] => sib_dep ]
|
|
@@ -1238,7 +1254,7 @@ module MU
|
|
|
1238
1254
|
"port" => db["port"],
|
|
1239
1255
|
"sgs" => [cfg_name+server['name']]
|
|
1240
1256
|
}
|
|
1241
|
-
MU::Config.addDependency(ruleset, cfg_name+server['name'], "firewall_rule",
|
|
1257
|
+
MU::Config.addDependency(ruleset, cfg_name+server['name'], "firewall_rule", my_phase: "groom")
|
|
1242
1258
|
end
|
|
1243
1259
|
}
|
|
1244
1260
|
}
|
|
@@ -341,7 +341,7 @@ module MU
|
|
|
341
341
|
"region" => db['region'],
|
|
342
342
|
"credentials" => db['credentials'],
|
|
343
343
|
}
|
|
344
|
-
MU::Config.addDependency(replica, db["name"], "database",
|
|
344
|
+
MU::Config.addDependency(replica, db["name"], "database", their_phase: "groom")
|
|
345
345
|
read_replicas << replica
|
|
346
346
|
end
|
|
347
347
|
end
|
|
@@ -367,7 +367,7 @@ module MU
|
|
|
367
367
|
"type" => "databases"
|
|
368
368
|
}
|
|
369
369
|
# AWS will figure out for us which database instance is the writer/master so we can create all of them concurrently.
|
|
370
|
-
MU::Config.addDependency(node, db["name"], "database",
|
|
370
|
+
MU::Config.addDependency(node, db["name"], "database", their_phase: "groom")
|
|
371
371
|
cluster_nodes << node
|
|
372
372
|
|
|
373
373
|
# Alarms are set on each DB cluster node, not on the cluster itself,
|
|
@@ -119,7 +119,7 @@ module MU
|
|
|
119
119
|
if acl_include['sgs']
|
|
120
120
|
acl_include['sgs'].each { |sg_ref|
|
|
121
121
|
if haveLitterMate?(sg_ref, "firewall_rules")
|
|
122
|
-
MU::Config.addDependency(acl, sg_ref, "firewall_rule",
|
|
122
|
+
MU::Config.addDependency(acl, sg_ref, "firewall_rule", my_phase: "groom")
|
|
123
123
|
siblingfw = haveLitterMate?(sg_ref, "firewall_rules")
|
|
124
124
|
if !siblingfw["#MU_VALIDATED"]
|
|
125
125
|
# XXX raise failure somehow
|
data/modules/mu/config/ref.rb
CHANGED
|
@@ -365,7 +365,7 @@ end
|
|
|
365
365
|
region: @region,
|
|
366
366
|
habitats: hab_arg,
|
|
367
367
|
credentials: @credentials,
|
|
368
|
-
dummy_ok: (["habitats", "folders", "users", "groups", "vpcs"].include?(@type))
|
|
368
|
+
dummy_ok: (["habitats", "folders", "users", "groups", "vpcs"].include?(@type) or @id)
|
|
369
369
|
}
|
|
370
370
|
|
|
371
371
|
found = MU::MommaCat.findStray(
|
|
@@ -377,7 +377,7 @@ end
|
|
|
377
377
|
region: @region,
|
|
378
378
|
habitats: hab_arg,
|
|
379
379
|
credentials: @credentials,
|
|
380
|
-
dummy_ok: (["habitats", "folders", "users", "groups", "vpcs"].include?(@type))
|
|
380
|
+
dummy_ok: (["habitats", "folders", "users", "groups", "vpcs"].include?(@type) or @id)
|
|
381
381
|
)
|
|
382
382
|
MU.log "Ref#kitten results from findStray", loglevel, details: found
|
|
383
383
|
@obj ||= found.first if found
|
|
@@ -185,15 +185,24 @@ module MU
|
|
|
185
185
|
"type" => "string",
|
|
186
186
|
"enum" => MU::Cloud.resource_types.values.map { |v| v[:cfg_name] }
|
|
187
187
|
},
|
|
188
|
-
"
|
|
188
|
+
"my_phase" => {
|
|
189
|
+
"type" => "string",
|
|
190
|
+
"description" => "Which part of our creation process should be waiting?",
|
|
191
|
+
"enum" => ["create", "groom"]
|
|
192
|
+
},
|
|
193
|
+
"their_phase" => {
|
|
189
194
|
"type" => "string",
|
|
190
195
|
"description" => "Which part of the creation process of the resource we depend on should we wait for before starting our own creation? Defaults are usually sensible, but sometimes you want, say, a Server to wait on another Server to be completely ready (through its groom phase) before starting up.",
|
|
191
196
|
"enum" => ["create", "groom"]
|
|
192
197
|
},
|
|
198
|
+
"phase" => {
|
|
199
|
+
"type" => "string",
|
|
200
|
+
"description" => "Alias for {their_phase}",
|
|
201
|
+
"enum" => ["create", "groom"]
|
|
202
|
+
},
|
|
193
203
|
"no_create_wait" => {
|
|
194
204
|
"type" => "boolean",
|
|
195
|
-
"
|
|
196
|
-
"description" => "By default, it's assumed that we want to wait on our parents' creation phase, in addition to whatever is declared in this stanza. Setting this flag will bypass waiting on our parent resource's creation, so that our create or groom phase can instead depend only on the parent's groom phase. "
|
|
205
|
+
"description" => "DEPRECATED- setting +true+ is the same as setting {my_phase} to +groom+; setting to +false+ is the same as setting {my_phase} to +create+. If both +no_create_wait+ and {my_phase} are specified, {my_phase} takes precedence."
|
|
197
206
|
}
|
|
198
207
|
}
|
|
199
208
|
}
|
data/modules/mu/config/server.rb
CHANGED
|
@@ -386,8 +386,7 @@ module MU
|
|
|
386
386
|
},
|
|
387
387
|
"associate_public_ip" => {
|
|
388
388
|
"type" => "boolean",
|
|
389
|
-
"
|
|
390
|
-
"description" => "Associate public IP address?"
|
|
389
|
+
"description" => "Whether to associate a public IP address with this server. Default behavior is to align with resident VPC/subnet, which to say +true+ if the subnet is publicly routable, +false+ if not. For non-VPC instances (AWS Classic), we default to +true+."
|
|
391
390
|
},
|
|
392
391
|
"userdata_script" => userdata_primitive,
|
|
393
392
|
"windows_admin_username" => {
|
|
@@ -649,15 +648,22 @@ module MU
|
|
|
649
648
|
server["vpc"]["subnet_pref"] = "public"
|
|
650
649
|
end
|
|
651
650
|
|
|
651
|
+
if server["associate_public_ip"].nil?
|
|
652
|
+
server["associate_public_ip"] = server["vpc"]["subnet_pref"] == "public" ? true : false
|
|
653
|
+
|
|
654
|
+
end
|
|
655
|
+
|
|
652
656
|
if !server["vpc"]["subnet_name"].nil? and configurator.nat_routes.has_key?(server["vpc"]["subnet_name"]) and !configurator.nat_routes[server["vpc"]["subnet_name"]].empty?
|
|
653
|
-
MU::Config.addDependency(server, configurator.nat_routes[server["vpc"]["subnet_name"]], "server",
|
|
657
|
+
MU::Config.addDependency(server, configurator.nat_routes[server["vpc"]["subnet_name"]], "server", their_phase: "groom", my_phase: "groom")
|
|
654
658
|
elsif !server["vpc"]["name"].nil?
|
|
655
659
|
siblingvpc = configurator.haveLitterMate?(server["vpc"]["name"], "vpcs")
|
|
656
660
|
if siblingvpc and siblingvpc['bastion'] and
|
|
657
661
|
server['name'] != siblingvpc['bastion']['name']
|
|
658
|
-
MU::Config.addDependency(server, siblingvpc['bastion']['name'], "server",
|
|
662
|
+
MU::Config.addDependency(server, siblingvpc['bastion']['name'], "server", their_phase: "groom", my_phase: "groom")
|
|
659
663
|
end
|
|
660
664
|
end
|
|
665
|
+
else
|
|
666
|
+
server["associate_public_ip"] ||= false
|
|
661
667
|
end
|
|
662
668
|
|
|
663
669
|
ok
|
|
@@ -186,7 +186,7 @@ module MU
|
|
|
186
186
|
|
|
187
187
|
if !pool["vpc"].nil?
|
|
188
188
|
if !pool["vpc"]["subnet_name"].nil? and configurator.nat_routes.has_key?(pool["vpc"]["subnet_name"])
|
|
189
|
-
MU::Config.addDependency(pool, configurator.nat_routes[pool["vpc"]["subnet_name"]], "server",
|
|
189
|
+
MU::Config.addDependency(pool, configurator.nat_routes[pool["vpc"]["subnet_name"]], "server", their_phase: "groom", my_phase: "groom")
|
|
190
190
|
end
|
|
191
191
|
end
|
|
192
192
|
# TODO make sure this is handled... somewhere
|
|
@@ -199,7 +199,7 @@ module MU
|
|
|
199
199
|
# }
|
|
200
200
|
# end
|
|
201
201
|
if pool["basis"] and pool["basis"]["server"]
|
|
202
|
-
MU::Config.addDependency(pool, pool["basis"]["server"], "server",
|
|
202
|
+
MU::Config.addDependency(pool, pool["basis"]["server"], "server", their_phase: "groom")
|
|
203
203
|
end
|
|
204
204
|
if !pool['static_ip'].nil? and !pool['ip'].nil?
|
|
205
205
|
ok = false
|
data/modules/mu/config/vpc.rb
CHANGED
|
@@ -540,7 +540,7 @@ module MU
|
|
|
540
540
|
end
|
|
541
541
|
end
|
|
542
542
|
|
|
543
|
-
#
|
|
543
|
+
# Failing that, generate a generic bastion/NAT host to do the job.
|
|
544
544
|
# Clouds that don't have some kind of native NAT gateway can also
|
|
545
545
|
# leverage this host to honor "gateway" => "#NAT" situations.
|
|
546
546
|
if !can_peer and !already_peered and have_public and vpc["create_bastion"]
|
|
@@ -563,13 +563,13 @@ module MU
|
|
|
563
563
|
"name" => vpc["name"],
|
|
564
564
|
"subnet_pref" => "public"
|
|
565
565
|
}
|
|
566
|
-
MU::Config.addDependency(vpc, bastion['name'], "server",
|
|
567
|
-
vpc["bastion"] = MU::Config::Ref.get(
|
|
568
|
-
name: bastion['name'],
|
|
569
|
-
cloud: vpc['cloud'],
|
|
570
|
-
credentials: vpc['credentials'],
|
|
571
|
-
type: "servers"
|
|
572
|
-
)
|
|
566
|
+
# MU::Config.addDependency(vpc, bastion['name'], "server", my_phase: "groom")
|
|
567
|
+
# vpc["bastion"] = MU::Config::Ref.get(
|
|
568
|
+
# name: bastion['name'],
|
|
569
|
+
# cloud: vpc['cloud'],
|
|
570
|
+
# credentials: vpc['credentials'],
|
|
571
|
+
# type: "servers"
|
|
572
|
+
# )
|
|
573
573
|
|
|
574
574
|
ok = false if !configurator.insertKitten(bastion, "servers", true)
|
|
575
575
|
end
|
|
@@ -615,11 +615,11 @@ module MU
|
|
|
615
615
|
append_me = { "vpc" => peer["vpc"].dup }
|
|
616
616
|
append_me['vpc']['name'] = sib['name']
|
|
617
617
|
append << append_me
|
|
618
|
-
MU::Config.addDependency(vpc, sib['name'], "vpc",
|
|
618
|
+
MU::Config.addDependency(vpc, sib['name'], "vpc", their_phase: "create", my_phase: "groom")
|
|
619
619
|
end
|
|
620
620
|
delete << peer
|
|
621
621
|
else
|
|
622
|
-
MU::Config.addDependency(vpc, peer['vpc']['name'], "vpc",
|
|
622
|
+
MU::Config.addDependency(vpc, peer['vpc']['name'], "vpc", their_phase: "create", my_phase: "groom")
|
|
623
623
|
end
|
|
624
624
|
delete << peer if sib['name'] == vpc['name']
|
|
625
625
|
}
|
|
@@ -17,39 +17,39 @@ rhel71: &5
|
|
|
17
17
|
us-west-1: ami-00457c55541605cb4
|
|
18
18
|
us-west-2: ami-02211d4e254a9e10f
|
|
19
19
|
centos6: &4
|
|
20
|
-
us-east-1: ami-
|
|
21
|
-
us-east-2: ami-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
ap-
|
|
25
|
-
ap-
|
|
26
|
-
ap-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
eu-
|
|
31
|
-
eu-
|
|
32
|
-
eu-west-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
us-east-1: ami-0ac9258984ed4bb4a
|
|
21
|
+
us-east-2: ami-09888b2b4484f774a
|
|
22
|
+
us-west-1: ami-04e7e499cdb873bfa
|
|
23
|
+
us-west-2: ami-0fcd16e6cf3c4b100
|
|
24
|
+
ap-northeast-1: ami-098052d1926fd4297
|
|
25
|
+
ap-northeast-2: ami-0319e58869a7b5bf2
|
|
26
|
+
ap-south-1: ami-0d19f7ad27c77cbf6
|
|
27
|
+
ap-southeast-1: ami-04b6b2013a296075c
|
|
28
|
+
ap-southeast-2: ami-07f02efb410df7e1d
|
|
29
|
+
ca-central-1: ami-0e7cc87df5666a78c
|
|
30
|
+
eu-central-1: ami-0cc33b333c7b7acd6
|
|
31
|
+
eu-north-1: ami-0bc09b1d6b4f351ea
|
|
32
|
+
eu-west-1: ami-08a7f444dba463099
|
|
33
|
+
eu-west-2: ami-0e84e5ba9694be11b
|
|
34
|
+
eu-west-3: ami-08e28291804571999
|
|
35
|
+
sa-east-1: ami-0b447e11308862517
|
|
36
36
|
centos7:
|
|
37
|
-
us-east-1: ami-
|
|
38
|
-
ap-northeast-1: ami-
|
|
39
|
-
ap-northeast-2: ami-
|
|
40
|
-
ap-south-1: ami-
|
|
41
|
-
ap-southeast-1: ami-
|
|
42
|
-
ap-southeast-2: ami-
|
|
43
|
-
ca-central-1: ami-
|
|
44
|
-
eu-central-1: ami-
|
|
45
|
-
eu-north-1: ami-
|
|
46
|
-
eu-west-1: ami-
|
|
47
|
-
eu-west-2: ami-
|
|
48
|
-
eu-west-3: ami-
|
|
49
|
-
sa-east-1: ami-
|
|
50
|
-
us-east-2: ami-
|
|
51
|
-
us-west-1: ami-
|
|
52
|
-
us-west-2: ami-
|
|
37
|
+
us-east-1: ami-08d24209f345a21ab
|
|
38
|
+
ap-northeast-1: ami-001cfcb3548768288
|
|
39
|
+
ap-northeast-2: ami-0a2f6ec79ed710bf7
|
|
40
|
+
ap-south-1: ami-05e0c30fc8b2a21a2
|
|
41
|
+
ap-southeast-1: ami-0b28f5573dd4aa62a
|
|
42
|
+
ap-southeast-2: ami-026419375863852b7
|
|
43
|
+
ca-central-1: ami-01e799689fa5c1f31
|
|
44
|
+
eu-central-1: ami-0ded33da6c28082d8
|
|
45
|
+
eu-north-1: ami-02c7692e69b06afc5
|
|
46
|
+
eu-west-1: ami-086619450a959a101
|
|
47
|
+
eu-west-2: ami-05db24096d56207f6
|
|
48
|
+
eu-west-3: ami-03ea610526da7c2f3
|
|
49
|
+
sa-east-1: ami-0029cb6ee83a799ca
|
|
50
|
+
us-east-2: ami-065847253b2d4acab
|
|
51
|
+
us-west-1: ami-0ea3494c08412920e
|
|
52
|
+
us-west-2: ami-055ce4c70b0ceabcb
|
|
53
53
|
ubuntu16: &3
|
|
54
54
|
us-east-1: ami-bcdc16c6
|
|
55
55
|
us-west-1: ami-1b17257b
|
data/modules/mu/deploy.rb
CHANGED
|
@@ -269,6 +269,7 @@ module MU
|
|
|
269
269
|
cloudclass = MU::Cloud.cloudClass(cloud)
|
|
270
270
|
cloudclass.initDeploy(@mommacat)
|
|
271
271
|
}
|
|
272
|
+
@mommacat.writeDeploySecret
|
|
272
273
|
|
|
273
274
|
# Kick off threads to create each of our new servers.
|
|
274
275
|
@my_threads << Thread.new {
|
|
@@ -535,8 +536,9 @@ MESSAGE_END
|
|
|
535
536
|
#########################################################################
|
|
536
537
|
def addDependentThread(parent, child)
|
|
537
538
|
@dependency_semaphore.synchronize {
|
|
538
|
-
@dependency_threads[child]
|
|
539
|
+
@dependency_threads[child] ||= []
|
|
539
540
|
@dependency_threads[child] << parent
|
|
541
|
+
@dependency_threads[child].uniq!
|
|
540
542
|
MU.log "Thread #{child} will wait on #{parent}", MU::DEBUG, details: @dependency_threads[child]
|
|
541
543
|
}
|
|
542
544
|
end
|
|
@@ -567,6 +569,7 @@ MESSAGE_END
|
|
|
567
569
|
|
|
568
570
|
MU.log "Setting dependencies for #{name}", MU::DEBUG, details: resource["dependencies"]
|
|
569
571
|
if !resource["dependencies"].nil? then
|
|
572
|
+
|
|
570
573
|
resource["dependencies"].each { |dependency|
|
|
571
574
|
parent_class = MU::Cloud.loadBaseType(dependency['type'])
|
|
572
575
|
|
|
@@ -576,31 +579,41 @@ MESSAGE_END
|
|
|
576
579
|
parent = parent_type+"_"+dependency["name"]+"_create"
|
|
577
580
|
addDependentThread(parent, "#{name}_groom")
|
|
578
581
|
|
|
582
|
+
# if we've explicitly declared each end of the dependency, roll
|
|
583
|
+
# with that and don't meddle further
|
|
584
|
+
if dependency["my_phase"] and dependency["their_phase"]
|
|
585
|
+
parent = parent_type+"_"+dependency["name"]+"_"+dependency["their_phase"]
|
|
586
|
+
addDependentThread(parent, name+"_"+dependency["my_phase"])
|
|
587
|
+
next
|
|
588
|
+
end
|
|
589
|
+
|
|
579
590
|
# should our creation thread also wait on our parent's create?
|
|
580
|
-
if
|
|
591
|
+
if dependency["my_phase"] == "create" and
|
|
581
592
|
(resource["#MU_CLOUDCLASS"].waits_on_parent_completion or
|
|
582
|
-
|
|
583
|
-
|
|
593
|
+
parent_class.deps_wait_on_my_creation
|
|
594
|
+
)
|
|
584
595
|
addDependentThread(parent, "#{name}_create")
|
|
585
596
|
end
|
|
586
597
|
|
|
587
598
|
|
|
588
599
|
# how about our groom thread waiting on our parents' grooms?
|
|
589
|
-
if (dependency['
|
|
600
|
+
if (dependency['their_phase'] == "groom" or resource["#MU_CLOUDCLASS"].waits_on_parent_completion) and parent_class.instance_methods(false).include?(:groom)
|
|
590
601
|
parent = parent_type+"_"+dependency["name"]+"_groom"
|
|
591
602
|
addDependentThread(parent, "#{name}_groom")
|
|
592
|
-
if
|
|
603
|
+
if dependency["my_phase"] == "groom" and
|
|
604
|
+
(dependency['their_phase'] == "create" or
|
|
605
|
+
(!dependency['their_phase'] and
|
|
593
606
|
parent_class.deps_wait_on_my_creation or
|
|
594
|
-
resource["#MU_CLOUDCLASS"].waits_on_parent_completion
|
|
595
|
-
dependency['phase'] == "groom"
|
|
607
|
+
resource["#MU_CLOUDCLASS"].waits_on_parent_completion)
|
|
596
608
|
)
|
|
597
609
|
addDependentThread(parent, "#{name}_create")
|
|
598
610
|
end
|
|
599
611
|
end
|
|
600
612
|
}
|
|
601
613
|
end
|
|
602
|
-
|
|
603
|
-
@dependency_threads["#{name}_groom"]
|
|
614
|
+
@dependency_threads["#{name}_groom"].concat(["#{name}_create", "mu_groom_container"])
|
|
615
|
+
@dependency_threads["#{name}_groom"].uniq!
|
|
616
|
+
MU.log "Thread dependencies #{res_type}[#{name}]", MU::DEBUG, details: { "create" => @dependency_threads["#{name}_create"], "groom" => @dependency_threads["#{name}_groom"] } if res_type == "role" and resource['name'] == "dynamostream-to-es"
|
|
604
617
|
}
|
|
605
618
|
end
|
|
606
619
|
|