cloud-mu 3.1.3 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +15 -3
  3. data/ansible/roles/mu-windows/README.md +33 -0
  4. data/ansible/roles/mu-windows/defaults/main.yml +2 -0
  5. data/ansible/roles/mu-windows/files/LaunchConfig.json +9 -0
  6. data/ansible/roles/mu-windows/files/config.xml +76 -0
  7. data/ansible/roles/mu-windows/handlers/main.yml +2 -0
  8. data/ansible/roles/mu-windows/meta/main.yml +53 -0
  9. data/ansible/roles/mu-windows/tasks/main.yml +36 -0
  10. data/ansible/roles/mu-windows/tests/inventory +2 -0
  11. data/ansible/roles/mu-windows/tests/test.yml +5 -0
  12. data/ansible/roles/mu-windows/vars/main.yml +2 -0
  13. data/bin/mu-adopt +21 -13
  14. data/bin/mu-azure-tests +57 -0
  15. data/bin/mu-cleanup +2 -4
  16. data/bin/mu-configure +52 -0
  17. data/bin/mu-deploy +3 -3
  18. data/bin/mu-findstray-tests +25 -0
  19. data/bin/mu-gen-docs +2 -4
  20. data/bin/mu-load-config.rb +4 -4
  21. data/bin/mu-node-manage +15 -16
  22. data/bin/mu-run-tests +147 -37
  23. data/cloud-mu.gemspec +22 -20
  24. data/cookbooks/mu-activedirectory/resources/domain.rb +4 -4
  25. data/cookbooks/mu-activedirectory/resources/domain_controller.rb +4 -4
  26. data/cookbooks/mu-tools/libraries/helper.rb +3 -2
  27. data/cookbooks/mu-tools/libraries/monkey.rb +35 -0
  28. data/cookbooks/mu-tools/recipes/apply_security.rb +14 -14
  29. data/cookbooks/mu-tools/recipes/aws_api.rb +9 -0
  30. data/cookbooks/mu-tools/recipes/eks.rb +2 -2
  31. data/cookbooks/mu-tools/recipes/google_api.rb +2 -2
  32. data/cookbooks/mu-tools/recipes/selinux.rb +2 -1
  33. data/cookbooks/mu-tools/recipes/windows-client.rb +163 -164
  34. data/cookbooks/mu-tools/resources/disk.rb +1 -1
  35. data/cookbooks/mu-tools/resources/windows_users.rb +44 -43
  36. data/extras/clean-stock-amis +25 -19
  37. data/extras/generate-stock-images +1 -0
  38. data/extras/image-generators/AWS/win2k12.yaml +18 -13
  39. data/extras/image-generators/AWS/win2k16.yaml +18 -13
  40. data/extras/image-generators/AWS/win2k19.yaml +21 -0
  41. data/extras/image-generators/Google/centos6.yaml +1 -0
  42. data/extras/image-generators/Google/centos7.yaml +1 -1
  43. data/modules/mommacat.ru +6 -16
  44. data/modules/mu.rb +158 -111
  45. data/modules/mu/adoption.rb +404 -71
  46. data/modules/mu/cleanup.rb +221 -306
  47. data/modules/mu/cloud.rb +129 -1633
  48. data/modules/mu/cloud/database.rb +49 -0
  49. data/modules/mu/cloud/dnszone.rb +44 -0
  50. data/modules/mu/cloud/machine_images.rb +212 -0
  51. data/modules/mu/cloud/providers.rb +81 -0
  52. data/modules/mu/cloud/resource_base.rb +926 -0
  53. data/modules/mu/cloud/server.rb +40 -0
  54. data/modules/mu/cloud/server_pool.rb +1 -0
  55. data/modules/mu/cloud/ssh_sessions.rb +228 -0
  56. data/modules/mu/cloud/winrm_sessions.rb +237 -0
  57. data/modules/mu/cloud/wrappers.rb +169 -0
  58. data/modules/mu/config.rb +171 -1767
  59. data/modules/mu/config/alarm.rb +2 -6
  60. data/modules/mu/config/bucket.rb +32 -3
  61. data/modules/mu/config/cache_cluster.rb +2 -2
  62. data/modules/mu/config/cdn.rb +100 -0
  63. data/modules/mu/config/collection.rb +4 -4
  64. data/modules/mu/config/container_cluster.rb +9 -4
  65. data/modules/mu/config/database.rb +84 -105
  66. data/modules/mu/config/database.yml +1 -2
  67. data/modules/mu/config/dnszone.rb +10 -9
  68. data/modules/mu/config/doc_helpers.rb +516 -0
  69. data/modules/mu/config/endpoint.rb +5 -4
  70. data/modules/mu/config/firewall_rule.rb +103 -4
  71. data/modules/mu/config/folder.rb +4 -4
  72. data/modules/mu/config/function.rb +19 -10
  73. data/modules/mu/config/group.rb +4 -4
  74. data/modules/mu/config/habitat.rb +4 -4
  75. data/modules/mu/config/job.rb +89 -0
  76. data/modules/mu/config/loadbalancer.rb +60 -14
  77. data/modules/mu/config/log.rb +4 -4
  78. data/modules/mu/config/msg_queue.rb +4 -4
  79. data/modules/mu/config/nosqldb.rb +4 -4
  80. data/modules/mu/config/notifier.rb +10 -21
  81. data/modules/mu/config/ref.rb +411 -0
  82. data/modules/mu/config/role.rb +4 -4
  83. data/modules/mu/config/schema_helpers.rb +509 -0
  84. data/modules/mu/config/search_domain.rb +4 -4
  85. data/modules/mu/config/server.rb +98 -71
  86. data/modules/mu/config/server.yml +1 -0
  87. data/modules/mu/config/server_pool.rb +5 -9
  88. data/modules/mu/config/storage_pool.rb +1 -1
  89. data/modules/mu/config/tail.rb +200 -0
  90. data/modules/mu/config/user.rb +4 -4
  91. data/modules/mu/config/vpc.rb +71 -27
  92. data/modules/mu/config/vpc.yml +0 -1
  93. data/modules/mu/defaults/AWS.yaml +91 -68
  94. data/modules/mu/defaults/Azure.yaml +1 -0
  95. data/modules/mu/defaults/Google.yaml +3 -2
  96. data/modules/mu/deploy.rb +43 -26
  97. data/modules/mu/groomer.rb +17 -2
  98. data/modules/mu/groomers/ansible.rb +188 -41
  99. data/modules/mu/groomers/chef.rb +116 -55
  100. data/modules/mu/logger.rb +127 -148
  101. data/modules/mu/master.rb +410 -2
  102. data/modules/mu/master/chef.rb +3 -4
  103. data/modules/mu/master/ldap.rb +3 -3
  104. data/modules/mu/master/ssl.rb +12 -3
  105. data/modules/mu/mommacat.rb +218 -2612
  106. data/modules/mu/mommacat/daemon.rb +403 -0
  107. data/modules/mu/mommacat/naming.rb +473 -0
  108. data/modules/mu/mommacat/search.rb +495 -0
  109. data/modules/mu/mommacat/storage.rb +722 -0
  110. data/modules/mu/{clouds → providers}/README.md +1 -1
  111. data/modules/mu/{clouds → providers}/aws.rb +380 -122
  112. data/modules/mu/{clouds → providers}/aws/alarm.rb +7 -5
  113. data/modules/mu/{clouds → providers}/aws/bucket.rb +297 -59
  114. data/modules/mu/{clouds → providers}/aws/cache_cluster.rb +37 -71
  115. data/modules/mu/providers/aws/cdn.rb +782 -0
  116. data/modules/mu/{clouds → providers}/aws/collection.rb +26 -25
  117. data/modules/mu/{clouds → providers}/aws/container_cluster.rb +724 -744
  118. data/modules/mu/providers/aws/database.rb +1744 -0
  119. data/modules/mu/{clouds → providers}/aws/dnszone.rb +88 -70
  120. data/modules/mu/providers/aws/endpoint.rb +1072 -0
  121. data/modules/mu/{clouds → providers}/aws/firewall_rule.rb +220 -247
  122. data/modules/mu/{clouds → providers}/aws/folder.rb +8 -8
  123. data/modules/mu/{clouds → providers}/aws/function.rb +300 -142
  124. data/modules/mu/{clouds → providers}/aws/group.rb +31 -29
  125. data/modules/mu/{clouds → providers}/aws/habitat.rb +18 -15
  126. data/modules/mu/providers/aws/job.rb +466 -0
  127. data/modules/mu/{clouds → providers}/aws/loadbalancer.rb +66 -56
  128. data/modules/mu/{clouds → providers}/aws/log.rb +17 -14
  129. data/modules/mu/{clouds → providers}/aws/msg_queue.rb +29 -19
  130. data/modules/mu/{clouds → providers}/aws/nosqldb.rb +114 -16
  131. data/modules/mu/{clouds → providers}/aws/notifier.rb +142 -65
  132. data/modules/mu/{clouds → providers}/aws/role.rb +158 -118
  133. data/modules/mu/{clouds → providers}/aws/search_domain.rb +201 -59
  134. data/modules/mu/{clouds → providers}/aws/server.rb +844 -1139
  135. data/modules/mu/{clouds → providers}/aws/server_pool.rb +74 -65
  136. data/modules/mu/{clouds → providers}/aws/storage_pool.rb +26 -44
  137. data/modules/mu/{clouds → providers}/aws/user.rb +24 -25
  138. data/modules/mu/{clouds → providers}/aws/userdata/README.md +0 -0
  139. data/modules/mu/{clouds → providers}/aws/userdata/linux.erb +5 -4
  140. data/modules/mu/{clouds → providers}/aws/userdata/windows.erb +2 -1
  141. data/modules/mu/{clouds → providers}/aws/vpc.rb +525 -931
  142. data/modules/mu/providers/aws/vpc_subnet.rb +286 -0
  143. data/modules/mu/{clouds → providers}/azure.rb +29 -9
  144. data/modules/mu/{clouds → providers}/azure/container_cluster.rb +3 -8
  145. data/modules/mu/{clouds → providers}/azure/firewall_rule.rb +18 -11
  146. data/modules/mu/{clouds → providers}/azure/habitat.rb +8 -6
  147. data/modules/mu/{clouds → providers}/azure/loadbalancer.rb +5 -5
  148. data/modules/mu/{clouds → providers}/azure/role.rb +8 -10
  149. data/modules/mu/{clouds → providers}/azure/server.rb +97 -49
  150. data/modules/mu/{clouds → providers}/azure/user.rb +6 -8
  151. data/modules/mu/{clouds → providers}/azure/userdata/README.md +0 -0
  152. data/modules/mu/{clouds → providers}/azure/userdata/linux.erb +0 -0
  153. data/modules/mu/{clouds → providers}/azure/userdata/windows.erb +0 -0
  154. data/modules/mu/{clouds → providers}/azure/vpc.rb +16 -21
  155. data/modules/mu/{clouds → providers}/cloudformation.rb +18 -7
  156. data/modules/mu/{clouds → providers}/cloudformation/alarm.rb +3 -3
  157. data/modules/mu/{clouds → providers}/cloudformation/cache_cluster.rb +3 -3
  158. data/modules/mu/{clouds → providers}/cloudformation/collection.rb +3 -3
  159. data/modules/mu/{clouds → providers}/cloudformation/database.rb +6 -17
  160. data/modules/mu/{clouds → providers}/cloudformation/dnszone.rb +3 -3
  161. data/modules/mu/{clouds → providers}/cloudformation/firewall_rule.rb +3 -3
  162. data/modules/mu/{clouds → providers}/cloudformation/loadbalancer.rb +3 -3
  163. data/modules/mu/{clouds → providers}/cloudformation/log.rb +3 -3
  164. data/modules/mu/{clouds → providers}/cloudformation/server.rb +7 -7
  165. data/modules/mu/{clouds → providers}/cloudformation/server_pool.rb +5 -5
  166. data/modules/mu/{clouds → providers}/cloudformation/vpc.rb +5 -7
  167. data/modules/mu/{clouds → providers}/docker.rb +0 -0
  168. data/modules/mu/{clouds → providers}/google.rb +68 -30
  169. data/modules/mu/{clouds → providers}/google/bucket.rb +13 -15
  170. data/modules/mu/{clouds → providers}/google/container_cluster.rb +85 -78
  171. data/modules/mu/{clouds → providers}/google/database.rb +11 -21
  172. data/modules/mu/{clouds → providers}/google/firewall_rule.rb +15 -14
  173. data/modules/mu/{clouds → providers}/google/folder.rb +20 -17
  174. data/modules/mu/{clouds → providers}/google/function.rb +140 -168
  175. data/modules/mu/{clouds → providers}/google/group.rb +29 -34
  176. data/modules/mu/{clouds → providers}/google/habitat.rb +21 -22
  177. data/modules/mu/{clouds → providers}/google/loadbalancer.rb +19 -21
  178. data/modules/mu/{clouds → providers}/google/role.rb +94 -58
  179. data/modules/mu/{clouds → providers}/google/server.rb +243 -156
  180. data/modules/mu/{clouds → providers}/google/server_pool.rb +26 -45
  181. data/modules/mu/{clouds → providers}/google/user.rb +95 -31
  182. data/modules/mu/{clouds → providers}/google/userdata/README.md +0 -0
  183. data/modules/mu/{clouds → providers}/google/userdata/linux.erb +0 -0
  184. data/modules/mu/{clouds → providers}/google/userdata/windows.erb +0 -0
  185. data/modules/mu/{clouds → providers}/google/vpc.rb +103 -79
  186. data/modules/tests/aws-jobs-functions.yaml +46 -0
  187. data/modules/tests/bucket.yml +4 -0
  188. data/modules/tests/centos6.yaml +15 -0
  189. data/modules/tests/centos7.yaml +15 -0
  190. data/modules/tests/centos8.yaml +12 -0
  191. data/modules/tests/ecs.yaml +23 -0
  192. data/modules/tests/eks.yaml +1 -1
  193. data/modules/tests/functions/node-function/lambda_function.js +10 -0
  194. data/modules/tests/functions/python-function/lambda_function.py +12 -0
  195. data/modules/tests/includes-and-params.yaml +2 -1
  196. data/modules/tests/microservice_app.yaml +288 -0
  197. data/modules/tests/rds.yaml +108 -0
  198. data/modules/tests/regrooms/aws-iam.yaml +201 -0
  199. data/modules/tests/regrooms/bucket.yml +19 -0
  200. data/modules/tests/regrooms/rds.yaml +123 -0
  201. data/modules/tests/server-with-scrub-muisms.yaml +2 -1
  202. data/modules/tests/super_complex_bok.yml +2 -2
  203. data/modules/tests/super_simple_bok.yml +3 -5
  204. data/modules/tests/win2k12.yaml +17 -5
  205. data/modules/tests/win2k16.yaml +25 -0
  206. data/modules/tests/win2k19.yaml +25 -0
  207. data/requirements.txt +1 -0
  208. data/spec/mu/clouds/azure_spec.rb +2 -2
  209. metadata +240 -154
  210. data/extras/image-generators/AWS/windows.yaml +0 -18
  211. data/modules/mu/clouds/aws/database.rb +0 -1985
  212. data/modules/mu/clouds/aws/endpoint.rb +0 -592
@@ -14,7 +14,7 @@
14
14
 
15
15
  module MU
16
16
  class Config
17
- # Basket of Kittens config schema and parser logic. See modules/mu/clouds/*/user.rb
17
+ # Basket of Kittens config schema and parser logic. See modules/mu/providers/*/user.rb
18
18
  class User
19
19
 
20
20
  # Base configuration schema for a User
@@ -68,10 +68,10 @@ module MU
68
68
  end
69
69
 
70
70
  # Generic pre-processing of {MU::Config::BasketofKittens::user}, bare and unvalidated.
71
- # @param user [Hash]: The resource to process and validate
72
- # @param configurator [MU::Config]: The overall deployment configurator of which this resource is a member
71
+ # @param _user [Hash]: The resource to process and validate
72
+ # @param _configurator [MU::Config]: The overall deployment configurator of which this resource is a member
73
73
  # @return [Boolean]: True if validation succeeded, False otherwise
74
- def self.validate(user, configurator)
74
+ def self.validate(_user, _configurator)
75
75
  ok = true
76
76
 
77
77
  ok
@@ -14,7 +14,7 @@
14
14
 
15
15
  module MU
16
16
  class Config
17
- # Basket of Kittens config schema and parser logic. See modules/mu/clouds/*/vpc.rb
17
+ # Basket of Kittens config schema and parser logic. See modules/mu/providers/*/vpc.rb
18
18
  class VPC
19
19
 
20
20
  # Base configuration schema for a VPC
@@ -417,10 +417,10 @@ module MU
417
417
  using_default_cidr = false
418
418
  if !vpc['ip_block']
419
419
  if configurator.updating and configurator.existing_deploy and
420
+ configurator.existing_deploy.original_config and
420
421
  configurator.existing_deploy.original_config['vpcs']
421
- pieces = []
422
422
  configurator.existing_deploy.original_config['vpcs'].each { |v|
423
- if v['name'] == vpc['name']
423
+ if v['name'].to_s == vpc['name'].to_s
424
424
  vpc['ip_block'] = v['ip_block']
425
425
  vpc['peers'] ||= []
426
426
  vpc['peers'].concat(v['peers'])
@@ -432,6 +432,10 @@ module MU
432
432
  break
433
433
  end
434
434
  }
435
+ if !vpc['ip_block']
436
+ MU.log "Loading existing deploy but can't find IP block of VPC #{vpc['name']}", MU::ERR
437
+ ok = false
438
+ end
435
439
  else
436
440
  using_default_cidr = true
437
441
  vpc['ip_block'] = "10.0.0.0/16"
@@ -494,6 +498,7 @@ module MU
494
498
  # See if we'll be able to create peering connections
495
499
  can_peer = false
496
500
  already_peered = false
501
+
497
502
  if MU.myCloud == vpc["cloud"] and MU.myVPCObj
498
503
  if vpc['peers']
499
504
  vpc['peers'].each { |peer|
@@ -539,7 +544,7 @@ module MU
539
544
  # Clouds that don't have some kind of native NAT gateway can also
540
545
  # leverage this host to honor "gateway" => "#NAT" situations.
541
546
  if !can_peer and !already_peered and have_public and vpc["create_bastion"]
542
- serverclass = Object.const_get("MU").const_get("Cloud").const_get(vpc["cloud"]).const_get("Server")
547
+ serverclass = MU::Cloud.resourceClass(vpc["cloud"], "Server")
543
548
  bastion = serverclass.genericNAT.dup
544
549
  bastion["groomer_variables"] = {
545
550
  "nat_ip_block" => vpc["ip_block"].to_s
@@ -558,10 +563,7 @@ module MU
558
563
  "name" => vpc["name"],
559
564
  "subnet_pref" => "public"
560
565
  }
561
- vpc["dependencies"] << {
562
- "type" => "server",
563
- "name" => bastion['name'],
564
- }
566
+ MU::Config.addDependency(vpc, bastion['name'], "server", no_create_wait: true)
565
567
  vpc["bastion"] = MU::Config::Ref.get(
566
568
  name: bastion['name'],
567
569
  cloud: vpc['cloud'],
@@ -596,7 +598,7 @@ module MU
596
598
  MU.log "Skipping malformed VPC peer in #{vpc['name']}", MU::ERR, details: peer
597
599
  next
598
600
  end
599
- peer["#MU_CLOUDCLASS"] = Object.const_get("MU").const_get("Cloud").const_get("VPC")
601
+ peer["#MU_CLOUDCLASS"] = MU::Cloud.loadBaseType("VPC")
600
602
  # We check for multiple siblings because some implementations
601
603
  # (Google) can split declared VPCs into parts to get the mimic the
602
604
  # routing behaviors we expect.
@@ -613,17 +615,11 @@ module MU
613
615
  append_me = { "vpc" => peer["vpc"].dup }
614
616
  append_me['vpc']['name'] = sib['name']
615
617
  append << append_me
616
- vpc["dependencies"] << {
617
- "type" => "vpc",
618
- "name" => sib['name']
619
- }
618
+ MU::Config.addDependency(vpc, sib['name'], "vpc", phase: "groom", no_create_wait: true)
620
619
  end
621
620
  delete << peer
622
621
  else
623
- vpc["dependencies"] << {
624
- "type" => "vpc",
625
- "name" => peer['vpc']["name"]
626
- }
622
+ MU::Config.addDependency(vpc, peer['vpc']['name'], "vpc", phase: "groom", no_create_wait: true)
627
623
  end
628
624
  delete << peer if sib['name'] == vpc['name']
629
625
  }
@@ -637,7 +633,7 @@ module MU
637
633
  MU.log "VPC peering connections to non-local accounts must specify the vpc_id of the peer.", MU::ERR
638
634
  ok = false
639
635
  end
640
- elsif !processReference(peer['vpc'], "vpcs", "vpc '#{vpc['name']}'", configurator, dflt_region: peer["vpc"]['region'])
636
+ elsif !processReference(peer['vpc'], "vpcs", vpc, configurator, dflt_region: peer["vpc"]['region'])
641
637
  ok = false
642
638
  end
643
639
  end
@@ -736,8 +732,8 @@ module MU
736
732
  vpc_block["subnet_pref"] = "all_private" if vpc_block["subnet_pref"] == "private"
737
733
  end
738
734
 
739
- flags = {}
740
- flags["subnet_pref"] = vpc_block["subnet_pref"] if !vpc_block["subnet_pref"].nil?
735
+ # flags = {}
736
+ # flags["subnet_pref"] = vpc_block["subnet_pref"] if !vpc_block["subnet_pref"].nil?
741
737
  hab_arg = if vpc_block['habitat']
742
738
  if vpc_block['habitat'].is_a?(MU::Config::Ref)
743
739
  [vpc_block['habitat'].id] # XXX actually, findStray it
@@ -771,9 +767,9 @@ MU.log "VPC lookup cache hit", MU::WARN, details: vpc_block
771
767
  tag_key: tag_key,
772
768
  tag_value: tag_value,
773
769
  region: vpc_block["region"],
774
- flags: flags,
775
770
  habitats: hab_arg,
776
- dummy_ok: true
771
+ dummy_ok: true,
772
+ subnet_pref: vpc_block["subnet_pref"]
777
773
  )
778
774
 
779
775
  found.first if found and found.size == 1
@@ -799,8 +795,8 @@ MU.log "VPC lookup cache hit", MU::WARN, details: vpc_block
799
795
  end
800
796
  @@reference_cache[vpc_block] ||= ext_vpc if ok
801
797
  end
802
- rescue Exception => e
803
- raise MuError, e.inspect, e.backtrace
798
+ rescue StandardError => e
799
+ raise MuError.new e.inspect, details: { "my call stack" => caller, "exception call stack" => e.backtrace }
804
800
  ensure
805
801
  if !ext_vpc and vpc_block['cloud'] != "CloudFormation"
806
802
  MU.log "Couldn't resolve VPC reference to a unique live VPC in #{parent_type} #{parent['name']} (called by #{caller[0]})", MU::ERR, details: vpc_block
@@ -877,7 +873,7 @@ MU.log "VPC lookup cache hit", MU::WARN, details: vpc_block
877
873
  tag_key, tag_value = vpc_block['tag'].split(/=/, 2) if !vpc_block['tag'].nil?
878
874
  begin
879
875
  ext_subnet = ext_vpc.getSubnet(cloud_id: vpc_block['subnet_id'], name: vpc_block['subnet_name'], tag_key: tag_key, tag_value: tag_value)
880
- rescue MuError => e
876
+ rescue MuError
881
877
  end
882
878
 
883
879
  if ext_subnet.nil?
@@ -918,14 +914,20 @@ MU.log "VPC lookup cache hit", MU::WARN, details: vpc_block
918
914
  public_subnets = []
919
915
  public_subnets_map = {}
920
916
  subnet_ptr = "subnet_id"
921
- all_subnets = []
922
917
  if !is_sibling
923
918
  pub = priv = 0
924
919
  raise MuError, "No subnets found in #{ext_vpc}" if ext_vpc.subnets.nil?
925
920
  ext_vpc.subnets.each { |subnet|
926
921
  next if dflt_region and vpc_block["cloud"] == "Google" and subnet.az != dflt_region
927
922
  if subnet.private? and (vpc_block['subnet_pref'] != "all_public" and vpc_block['subnet_pref'] != "public")
928
- private_subnets << { "subnet_id" => configurator.getTail("#{parent['name']} Private Subnet #{priv}", value: subnet.cloud_id, prettyname: "#{parent['name']} Private Subnet #{priv}", cloudtype: "AWS::EC2::Subnet::Id"), "az" => subnet.az }
923
+ private_subnets << {
924
+ "subnet_id" => configurator.getTail(
925
+ "#{parent['name']} Private Subnet #{priv}",
926
+ value: subnet.cloud_id,
927
+ prettyname: "#{parent['name']} Private Subnet #{priv}",
928
+ cloudtype: "AWS::EC2::Subnet::Id"),
929
+ "az" => subnet.az
930
+ }
929
931
  private_subnets_map[subnet.cloud_id] = subnet
930
932
  priv = priv + 1
931
933
  elsif !subnet.private? and vpc_block['subnet_pref'] != "all_private" and vpc_block['subnet_pref'] != "private"
@@ -1068,5 +1070,47 @@ MU.log "VPC lookup cache hit", MU::WARN, details: vpc_block
1068
1070
  end
1069
1071
 
1070
1072
  end
1073
+
1074
+ # Take an IP block and split it into a more-or-less arbitrary number of
1075
+ # subnets.
1076
+ # @param ip_block [String]: CIDR of the network to subdivide
1077
+ # @param subnets_desired [Integer]: Number of subnets we want back
1078
+ # @param max_mask [Integer]: The highest netmask we're allowed to use for a subnet (various by cloud provider)
1079
+ # @return [MU::Config::Tail]: Resulting subnet tails, or nil if an error occurred.
1080
+ def divideNetwork(ip_block, subnets_desired, max_mask = 28)
1081
+ cidr = NetAddr::IPv4Net.parse(ip_block.to_s)
1082
+
1083
+ # Ugly but reliable method of landing on the right subnet size
1084
+ subnet_bits = cidr.netmask.prefix_len
1085
+ begin
1086
+ subnet_bits += 1
1087
+ if subnet_bits > max_mask
1088
+ MU.log "Can't subdivide #{cidr.to_s} into #{subnets_desired.to_s}", MU::ERR
1089
+ raise MuError, "Subnets smaller than /#{max_mask} not permitted"
1090
+ end
1091
+ end while cidr.subnet_count(subnet_bits) < subnets_desired
1092
+
1093
+ if cidr.subnet_count(subnet_bits) > subnets_desired
1094
+ MU.log "Requested #{subnets_desired.to_s} subnets from #{cidr.to_s}, leaving #{(cidr.subnet_count(subnet_bits)-subnets_desired).to_s} unused /#{subnet_bits.to_s}s available", MU::NOTICE
1095
+ end
1096
+
1097
+ begin
1098
+ subnets = []
1099
+ (0..subnets_desired).each { |x|
1100
+ subnets << cidr.nth_subnet(subnet_bits, x).to_s
1101
+ }
1102
+ rescue RuntimeError => e
1103
+ if e.message.match(/exceeds subnets available for allocation/)
1104
+ MU.log e.message, MU::ERR
1105
+ MU.log "I'm attempting to create #{subnets_desired} subnets (one public and one private for each Availability Zone), of #{subnet_size} addresses each, but that's too many for a /#{cidr.netmask.prefix_len} network. Either declare a larger network, or explicitly declare a list of subnets with few enough entries to fit.", MU::ERR
1106
+ return nil
1107
+ else
1108
+ raise e
1109
+ end
1110
+ end
1111
+
1112
+ subnets = getTail("subnetblocks", value: subnets.join(","), cloudtype: "CommaDelimitedList", description: "IP Address ranges to be used for VPC subnets", prettyname: "SubnetIpBlocks", list_of: "ip_block").map { |tail| tail["ip_block"] }
1113
+ subnets
1114
+ end
1071
1115
  end
1072
1116
  end
@@ -1,7 +1,6 @@
1
1
  <% if complexity == 'complex' %>
2
2
  name: <%= vpc_name %>
3
3
  create_nat_gateway: true
4
- ip_block: 10.231.0.0/16
5
4
  enable_traffic_logging: true
6
5
  region: us-east-2
7
6
  availability_zones:
@@ -1,5 +1,5 @@
1
1
  ---
2
- rhel71: &4
2
+ rhel71: &5
3
3
  us-east-1: ami-0f05fce24aa75ba9f
4
4
  ap-northeast-1: ami-0c0ec19eb19055763
5
5
  ap-northeast-2: ami-0717ac5c67c99f745
@@ -16,41 +16,41 @@ rhel71: &4
16
16
  us-east-2: ami-02f6682c7816b3cfc
17
17
  us-west-1: ami-04898e596c06e802b
18
18
  us-west-2: ami-02db5457189a8a8c2
19
- centos6: &3
20
- us-east-1: ami-06b6c01abc6998348
21
- ap-northeast-1: ami-0c5da73fde2cb6437
22
- ap-northeast-2: ami-0134fce6dc00eb00d
23
- ap-south-1: ami-0e59a612e7c84836b
24
- ap-southeast-1: ami-0e16974f528ae0dae
25
- ap-southeast-2: ami-0e2feddf3dbf4d539
26
- ca-central-1: ami-089236a344dadad5f
27
- eu-central-1: ami-0c4eed3fe046c3917
28
- eu-north-1: ami-05f636e89d0362c14
29
- eu-west-1: ami-00c50b11d713f90d3
30
- eu-west-2: ami-06cc78c32eed7f944
31
- eu-west-3: ami-0ba626236ad786c54
32
- sa-east-1: ami-07c3b2a5a41e92376
33
- us-east-2: ami-01129e636778acfbc
34
- us-west-1: ami-0632e646cd5089ffc
35
- us-west-2: ami-0ce4c9f2e1037de53
19
+ centos6: &4
20
+ us-east-1: ami-009723c5c7f8fbc75
21
+ us-east-2: ami-0781f11395714cd39
22
+ ap-northeast-1: ami-07fa5a8795da2b6bc
23
+ ap-northeast-2: ami-0219f0a7c979ff63f
24
+ ap-south-1: ami-0f24817242c401740
25
+ ap-southeast-1: ami-042ef2e0643e8e207
26
+ ap-southeast-2: ami-09fc51de648afa168
27
+ ca-central-1: ami-0dc643db74edc5aa5
28
+ eu-central-1: ami-0628759cb297569d5
29
+ eu-north-1: ami-0aed023791f886315
30
+ eu-west-1: ami-0f87f0f252ff03622
31
+ eu-west-2: ami-00abb555d5a460afe
32
+ eu-west-3: ami-0ccd93d454c2418a2
33
+ sa-east-1: ami-01e10ea6ea72534ae
34
+ us-west-1: ami-01fee56b9ee690ffe
35
+ us-west-2: ami-08bcdb944f185e2a8
36
36
  centos7:
37
- us-east-1: ami-07e6f661e71ad964b
38
- ap-northeast-1: ami-0988180d74897c639
39
- ap-northeast-2: ami-0e77cd1c7024b8ae0
40
- ap-south-1: ami-02bd479122041000a
41
- ap-southeast-1: ami-017767778ef9db671
42
- ap-southeast-2: ami-05b09a58c3964d67d
43
- ca-central-1: ami-0a59a176d810fcc5f
44
- eu-central-1: ami-0b48a421fb05d96af
45
- eu-north-1: ami-02337601ea5dc4a5d
46
- eu-west-1: ami-0b0a55b7423eeac07
47
- eu-west-2: ami-060518b40b25b9eb4
48
- eu-west-3: ami-060957bb3adacd831
49
- sa-east-1: ami-0c706132b35071de6
50
- us-east-2: ami-0db4c266ed0bb958b
51
- us-west-1: ami-0980f6eb52c998793
52
- us-west-2: ami-07f2ed4755c01c05c
53
- ubuntu16: &2
37
+ us-east-1: ami-067256ca1497c924d
38
+ ap-northeast-1: ami-07c1e51354fdfd362
39
+ ap-northeast-2: ami-042b761c93d6df2f1
40
+ ap-south-1: ami-02e879f52322e7c98
41
+ ap-southeast-1: ami-0487e9f84d0ffde89
42
+ ap-southeast-2: ami-0e854dab39fd6a427
43
+ ca-central-1: ami-05a27d311b585a70b
44
+ eu-central-1: ami-0e396d00c787b4f47
45
+ eu-north-1: ami-087763a2ba60b2bfe
46
+ eu-west-1: ami-04e3bd9335a14e635
47
+ eu-west-2: ami-0efd34a8d1fc2b104
48
+ eu-west-3: ami-08d0bcbc780448cf8
49
+ sa-east-1: ami-0284f4a0968263cf0
50
+ us-east-2: ami-0292786917d1e3015
51
+ us-west-1: ami-0ba622529dcdff2bb
52
+ us-west-2: ami-079a309ca6261d7f6
53
+ ubuntu16: &3
54
54
  us-east-1: ami-bcdc16c6
55
55
  us-west-1: ami-1b17257b
56
56
  us-west-2: ami-19e92861
@@ -73,33 +73,56 @@ ubuntu14:
73
73
  ap-southeast-1: ami-2855964b
74
74
  ap-southeast-2: ami-d19fc4b2
75
75
  win2k12r2: &1
76
- us-east-1: ami-055c10ae78f3a58a2
77
- us-east-2: ami-fbbe929e
78
- us-west-1: ami-ec91ac8c
79
- us-west-2: ami-106ca068
80
- eu-central-1: ami-59e15a36
81
- eu-west-1: ami-65b16b1c
82
- sa-east-1: ami-93d6afff
83
- ap-northeast-1: ami-dcd375ba
84
- ap-northeast-2: ami-fa2e8b94
85
- ap-southeast-1: ami-b61657d5
86
- ap-southeast-2: ami-9a7b97f8
87
- ap-south-1: ami-99a8eaf6
88
- ca-central-1: ami-608b3304
89
- win2k16:
90
- us-east-1: ami-d2cb25a8
91
- us-east-2: ami-2db59748
92
- us-west-1: ami-2db59748
93
- us-west-2: ami-3b47ba43
94
- eu-central-1: ami-37d46558
95
- eu-west-1: ami-06c5d662
96
- sa-east-1: ami-53fd803f
97
- ap-northeast-1: ami-ce8b42a8
98
- ap-northeast-2: ami-c17ca7af
99
- ap-southeast-1: ami-fe51279d
100
- ap-southeast-2: ami-792bcd1b
101
- ap-south-1: ami-448dcb2b
102
- ca-central-1: ami-a39920c7
76
+ us-east-1: ami-003aea65bc2e7136a
77
+ us-east-2: ami-0163293e39ba504c2
78
+ ca-central-1: ami-055689dd92f29d2aa
79
+ us-west-2: ami-0ce87dda2c9244e57
80
+ us-west-1: ami-00d9cf64bd2fafa44
81
+ eu-west-1: ami-026d7427b9fadad40
82
+ eu-west-2: ami-036a22c0780551794
83
+ eu-west-3: ami-05e3d9b79bdc10861
84
+ eu-north-1: ami-063eb48504c7d73f1
85
+ sa-east-1: ami-0a8c1829a5e650bc5
86
+ eu-central-1: ami-0ea20cef52335b008
87
+ ap-northeast-1: ami-08db2dc67228dbb90
88
+ ap-south-1: ami-012241411db3f09c3
89
+ ap-northeast-2: ami-0368c224de1d20502
90
+ ap-southeast-1: ami-028ef74e1edc3943a
91
+ ap-southeast-2: ami-09e03eab1b1bc151b
92
+ win2k16: &2
93
+ us-east-1: ami-02801a2c8dcbfb883
94
+ us-east-2: ami-0ca4f779a2a58a7ea
95
+ ca-central-1: ami-05d3854d9d6e9bcc5
96
+ us-west-2: ami-091f4a88ce32d28b6
97
+ eu-west-1: ami-0b938c9b23ed7d18c
98
+ us-west-1: ami-0fd744c3fbe8260f2
99
+ eu-west-2: ami-071a89b959c5eda27
100
+ eu-west-3: ami-0b206e3dbda9ff9eb
101
+ eu-central-1: ami-0dd9bdad31dd0d3ce
102
+ sa-east-1: ami-0d69b8d6c0f9a7bae
103
+ ap-northeast-1: ami-02eb4a6f519bc3190
104
+ ap-south-1: ami-0666fd543ac8b5501
105
+ ap-northeast-2: ami-01277c81f9b91cf77
106
+ ap-southeast-2: ami-0426a246f9b0ccadd
107
+ ap-southeast-1: ami-07ecb0d55c2eb7247
108
+ eu-north-1: ami-047811530583b6d08
109
+ win2k19:
110
+ us-east-1: ami-00820419bf212df7e
111
+ us-east-2: ami-0a7916b90aa4629d5
112
+ ca-central-1: ami-0d704529661e19185
113
+ us-west-2: ami-0ee6a198d7ac35eb1
114
+ eu-west-2: ami-0f6ac1634bd7add92
115
+ us-west-1: ami-039e3816b4cac1e27
116
+ eu-west-1: ami-03a771d99091199b7
117
+ eu-central-1: ami-03b648d5b45f51a4f
118
+ eu-west-3: ami-068839907c18c3a6e
119
+ eu-north-1: ami-0db851ee76f7deefb
120
+ sa-east-1: ami-0c2cc60c62159f87c
121
+ ap-northeast-2: ami-06bdf8ae9ae9add92
122
+ ap-northeast-1: ami-02306d959c7f175b9
123
+ ap-southeast-1: ami-0d5b4a3d73e0f471f
124
+ ap-southeast-2: ami-00fa88caff4f64937
125
+ ap-south-1: ami-0b44feae4bb9f497a
103
126
  amazon:
104
127
  us-east-1: ami-b73b63a0
105
128
  us-east-2: ami-58277d3d
@@ -114,9 +137,9 @@ amazon:
114
137
  ap-southeast-1: ami-b953f2da
115
138
  ap-southeast-2: ami-db704cb8
116
139
  win2k12: *1
117
- windows: *1
118
- ubuntu: *2
119
- centos: *3
120
- rhel7: *4
121
- rhel: *4
122
- linux: *3
140
+ windows: *2
141
+ ubuntu: *3
142
+ centos: *4
143
+ rhel7: *5
144
+ rhel: *5
145
+ linux: *4
@@ -2,6 +2,7 @@
2
2
  centos6: &centos6 OpenLogic/CentOS/6
3
3
  #centos7: &centos7 westernoceansoftwaresprivatelimited/centos-7-6/centos-7-6-server
4
4
  centos7: &centos7 OpenLogic/CentOS/7
5
+ centos8: &centos7 OpenLogic/CentOS/8
5
6
  rhel8: &rhel8 RedHat/RHEL/8
6
7
  rhel7: &rhel7 RedHat/RHEL/7
7
8
  rhel6: &rhel6 RedHat/RHEL/6
@@ -1,6 +1,7 @@
1
1
  ---
2
- centos6: &centos6 centos-cloud/centos-6
3
- centos7: &centos7 centos-cloud/centos-7
2
+ centos6: &centos6 egt-labs-admin/mu-centos-6
3
+ centos7: &centos7 egt-labs-admin/mu-centos-7
4
+ centos8: &centos8 centos-cloud/centos-8
4
5
  rhel71: &rhel71 rhel-cloud/rhel-7
5
6
  rhel6: &rhel6 rhel-cloud/rhel-6
6
7
  debian10: &debian10 debian-cloud/debian-10
@@ -126,7 +126,7 @@ module MU
126
126
  seedsize = 1 + (retries/10).abs
127
127
  seed = (0...seedsize+1).map { ('a'..'z').to_a[rand(26)] }.join
128
128
  deploy_id = @appname.upcase + "-" + @environment.upcase + "-" + @timestamp + "-" + seed.upcase
129
- end while MU::MommaCat.deploy_exists?(deploy_id) or seed == "mu" or seed[0] == seed[1]
129
+ end while MU::MommaCat.deploy_exists?(deploy_id) or seed == "mu"
130
130
  MU.setVar("deploy_id", deploy_id)
131
131
  MU.setVar("appname", @appname.upcase)
132
132
  MU.setVar("environment", @environment.upcase)
@@ -140,7 +140,7 @@ module MU
140
140
 
141
141
  @fromName = MU.muCfg['mu_admin_email']
142
142
 
143
- MU::Cloud.resource_types.each { |cloudclass, data|
143
+ MU::Cloud.resource_types.values.each { |data|
144
144
  if !@main_config[data[:cfg_plural]].nil? and @main_config[data[:cfg_plural]].size > 0
145
145
  @main_config[data[:cfg_plural]].each { |resource|
146
146
  if force_cloudformation
@@ -154,9 +154,10 @@ module MU
154
154
  end
155
155
  end
156
156
  }
157
- shortclass, cfg_name, cfg_plural, classname = MU::Cloud.getResourceNames(data[:cfg_plural])
157
+ _shortclass, _cfg_name, _cfg_plural, classname = MU::Cloud.getResourceNames(data[:cfg_plural])
158
158
  @main_config[data[:cfg_plural]].each { |resource|
159
159
  resource["#MU_CLOUDCLASS"] = classname
160
+ # resource["#MU_CLOUDCLASS"] = MU::Cloud.resourceClass(resource['cloud'], data[:cfg_plural])
160
161
  }
161
162
  setThreadDependencies(@main_config[data[:cfg_plural]])
162
163
  end
@@ -265,7 +266,7 @@ module MU
265
266
  # Run cloud provider-specific deploy meta-artifact creation (ssh keys,
266
267
  # resource groups, etc)
267
268
  @mommacat.cloudsUsed.each { |cloud|
268
- cloudclass = Object.const_get("MU").const_get("Cloud").const_get(cloud)
269
+ cloudclass = MU::Cloud.cloudClass(cloud)
269
270
  cloudclass.initDeploy(@mommacat)
270
271
  }
271
272
 
@@ -274,7 +275,7 @@ module MU
274
275
  MU.dupGlobals(parent_thread_id)
275
276
  Thread.current.thread_variable_set("name", "mu_create_container")
276
277
  # Thread.abort_on_exception = false
277
- MU::Cloud.resource_types.each { |cloudclass, data|
278
+ MU::Cloud.resource_types.values.each { |data|
278
279
  if !@main_config[data[:cfg_plural]].nil? and
279
280
  @main_config[data[:cfg_plural]].size > 0 and
280
281
  data[:instance].include?(:create)
@@ -288,7 +289,7 @@ module MU
288
289
  MU.dupGlobals(parent_thread_id)
289
290
  Thread.current.thread_variable_set("name", "mu_groom_container")
290
291
  # Thread.abort_on_exception = false
291
- MU::Cloud.resource_types.each { |cloudclass, data|
292
+ MU::Cloud.resource_types.values.each { |data|
292
293
  if !@main_config[data[:cfg_plural]].nil? and
293
294
  @main_config[data[:cfg_plural]].size > 0 and
294
295
  data[:instance].include?(:groom)
@@ -311,7 +312,20 @@ module MU
311
312
 
312
313
  @mommacat.save!
313
314
 
314
- rescue Exception => e
315
+ # XXX Functions have a special behavior where we re-invoke their groom
316
+ # methods one more time at the end, so we can guarantee their
317
+ # environments are fully populated with all sibling resource idents
318
+ # regardless of dependency order. This is, obviously, a disgusting
319
+ # hack, and we should revisit our dependency language in the next big
320
+ # release.
321
+ if !@main_config["functions"].nil? and
322
+ @main_config["functions"].size > 0
323
+ createResources(@main_config["functions"], "groom")
324
+ end
325
+
326
+ rescue StandardError => e
327
+ MU.log e.class.name, MU::ERR, details: caller
328
+
315
329
  @my_threads.each do |t|
316
330
  if t.object_id != Thread.current.object_id and
317
331
  t.thread_variable_get("name") != "main_thread" and
@@ -338,6 +352,8 @@ module MU
338
352
  @nocleanup = true # so we don't run this again later
339
353
  end
340
354
  end
355
+
356
+
341
357
  @reraise_thread.raise MuError, e.inspect, e.backtrace if @reraise_thread
342
358
  Thread.current.exit
343
359
  ensure
@@ -390,7 +406,7 @@ module MU
390
406
  Thread.handle_interrupt(MU::Cloud::MuCloudResourceNotImplemented => :never) {
391
407
  begin
392
408
  Thread.handle_interrupt(MU::Cloud::MuCloudResourceNotImplemented => :immediate) {
393
- MU.log "Cost calculator not available for this stack, as it uses a resource not implemented in Mu's CloudFormation layer.", MU::WARN, verbosity: MU::Logger::NORMAL
409
+ MU.log "Cost calculator not available for this stack, as it uses a resource not implemented in Mu's CloudFormation layer.", MU::DEBUG, verbosity: MU::Logger::NORMAL
394
410
  Thread.current.exit
395
411
  }
396
412
  ensure
@@ -550,16 +566,9 @@ MESSAGE_END
550
566
  @dependency_threads["#{name}_groom"]=["#{name}_create", "mu_groom_container"]
551
567
 
552
568
  MU.log "Setting dependencies for #{name}", MU::DEBUG, details: resource["dependencies"]
553
- if resource["dependencies"] != nil then
569
+ if !resource["dependencies"].nil? then
554
570
  resource["dependencies"].each { |dependency|
555
- parent_class = nil
556
- MU::Cloud.resource_types.each_pair { |res_class, attrs|
557
- if attrs[:cfg_name] == dependency['type'] or
558
- attrs[:cfg_plural] == dependency['type']
559
- parent_class = Object.const_get("MU").const_get("Cloud").const_get(res_class)
560
- break
561
- end
562
- }
571
+ parent_class = MU::Cloud.loadBaseType(dependency['type'])
563
572
 
564
573
  parent_type = parent_class.cfg_name
565
574
 
@@ -568,10 +577,10 @@ MESSAGE_END
568
577
  addDependentThread(parent, "#{name}_groom")
569
578
 
570
579
  # should our creation thread also wait on our parent's create?
571
- if !resource["no_create_wait"] and
580
+ if !dependency["no_create_wait"] and
572
581
  (resource["#MU_CLOUDCLASS"].waits_on_parent_completion or
573
582
  dependency['phase'] == "create" or
574
- (parent_class.deps_wait_on_my_creation and parent_type != res_type))
583
+ parent_class.deps_wait_on_my_creation)
575
584
  addDependentThread(parent, "#{name}_create")
576
585
  end
577
586
 
@@ -580,12 +589,18 @@ MESSAGE_END
580
589
  if (dependency['phase'] == "groom" or resource["#MU_CLOUDCLASS"].waits_on_parent_completion) and parent_class.instance_methods(false).include?(:groom)
581
590
  parent = parent_type+"_"+dependency["name"]+"_groom"
582
591
  addDependentThread(parent, "#{name}_groom")
583
- if (parent_class.deps_wait_on_my_creation and parent_type != res_type) or resource["#MU_CLOUDCLASS"].waits_on_parent_completion or dependency['phase'] == "groom"
592
+ if !dependency["no_create_wait"] and (
593
+ parent_class.deps_wait_on_my_creation or
594
+ resource["#MU_CLOUDCLASS"].waits_on_parent_completion or
595
+ dependency['phase'] == "groom"
596
+ )
584
597
  addDependentThread(parent, "#{name}_create")
585
598
  end
586
599
  end
587
600
  }
588
601
  end
602
+ MU.log "Thread dependencies #{res_type}[#{name}]", MU::DEBUG, details: { "create" => @dependency_threads["#{name}_create"], "groom" => @dependency_threads["#{name}_groom"] }
603
+ @dependency_threads["#{name}_groom"]=["#{name}_create", "mu_groom_container"]
589
604
  }
590
605
  end
591
606
 
@@ -596,7 +611,6 @@ MESSAGE_END
596
611
  return if services.nil?
597
612
 
598
613
  parent_thread_id = Thread.current.object_id
599
- parent_thread = Thread.current
600
614
  services.uniq!
601
615
  services.each do |service|
602
616
  begin
@@ -639,17 +653,18 @@ MESSAGE_END
639
653
  else
640
654
  raise e
641
655
  end
642
- rescue Exception => e
656
+ rescue StandardError => e
643
657
  MU::MommaCat.unlockAll
644
658
  @main_thread.raise MuError, "Error instantiating object from #{myservice["#MU_CLOUDCLASS"]} (#{e.inspect})", e.backtrace
645
659
  raise e
646
660
  end
647
661
  begin
648
662
  run_this_method = myservice['#MUOBJECT'].method(mode)
649
- rescue Exception => e
663
+ rescue StandardError => e
650
664
  MU::MommaCat.unlockAll
651
- @main_thread.raise MuError, "Error invoking #{myservice["#MU_CLOUDCLASS"]}.#{mode} for #{myservice['name']} (#{e.inspect})", e.backtrace
652
- raise e
665
+ @main_thread.raise MuError, "Error invoking #{myservice["#MUOBJECT"].class.name}.#{mode} for #{myservice['name']} (#{e.inspect})", e.backtrace
666
+ return
667
+ # raise e
653
668
  end
654
669
  begin
655
670
  MU.log "Checking whether to run #{myservice['#MUOBJECT']}.#{mode} (updating: #{@updating})", MU::DEBUG
@@ -703,7 +718,7 @@ MESSAGE_END
703
718
  @my_threads.reject! { |thr| !thr.alive? }
704
719
  sleep 10+Random.rand(20)
705
720
  retry
706
- rescue Exception => e
721
+ rescue StandardError => e
707
722
  MU.log e.inspect, MU::ERR, details: e.backtrace if @verbosity != MU::Logger::SILENT
708
723
  MU::MommaCat.unlockAll
709
724
  Thread.list.each do |t|
@@ -729,7 +744,9 @@ MESSAGE_END
729
744
  sleep 10+Random.rand(20)
730
745
  retry
731
746
  end
747
+
732
748
  end
749
+
733
750
  end
734
751
 
735
752
  end #class