cloud-mu 3.2.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.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +1 -1
  3. data/ansible/roles/mu-nat/tasks/main.yml +3 -0
  4. data/bin/mu-adopt +12 -1
  5. data/bin/mu-aws-setup +41 -7
  6. data/bin/mu-azure-setup +34 -0
  7. data/bin/mu-configure +214 -119
  8. data/bin/mu-gcp-setup +37 -2
  9. data/bin/mu-load-config.rb +2 -1
  10. data/bin/mu-node-manage +3 -0
  11. data/bin/mu-refresh-ssl +67 -0
  12. data/bin/mu-run-tests +28 -6
  13. data/bin/mu-self-update +30 -10
  14. data/bin/mu-upload-chef-artifacts +30 -26
  15. data/cloud-mu.gemspec +10 -8
  16. data/cookbooks/mu-master/attributes/default.rb +5 -1
  17. data/cookbooks/mu-master/metadata.rb +2 -2
  18. data/cookbooks/mu-master/recipes/default.rb +81 -26
  19. data/cookbooks/mu-master/recipes/init.rb +197 -62
  20. data/cookbooks/mu-master/recipes/update_nagios_only.rb +1 -1
  21. data/cookbooks/mu-master/recipes/vault.rb +78 -77
  22. data/cookbooks/mu-master/templates/default/mods/rewrite.conf.erb +1 -0
  23. data/cookbooks/mu-master/templates/default/nagios.conf.erb +103 -0
  24. data/cookbooks/mu-master/templates/default/web_app.conf.erb +14 -30
  25. data/cookbooks/mu-tools/attributes/default.rb +12 -0
  26. data/cookbooks/mu-tools/files/centos-6/CentOS-Base.repo +47 -0
  27. data/cookbooks/mu-tools/libraries/helper.rb +98 -4
  28. data/cookbooks/mu-tools/libraries/monkey.rb +1 -1
  29. data/cookbooks/mu-tools/recipes/apply_security.rb +31 -9
  30. data/cookbooks/mu-tools/recipes/aws_api.rb +8 -2
  31. data/cookbooks/mu-tools/recipes/base_repositories.rb +1 -1
  32. data/cookbooks/mu-tools/recipes/gcloud.rb +2 -9
  33. data/cookbooks/mu-tools/recipes/google_api.rb +7 -0
  34. data/cookbooks/mu-tools/recipes/rsyslog.rb +8 -1
  35. data/cookbooks/mu-tools/resources/disk.rb +113 -42
  36. data/cookbooks/mu-tools/resources/mommacat_request.rb +1 -2
  37. data/cookbooks/mu-tools/templates/centos-8/sshd_config.erb +215 -0
  38. data/extras/Gemfile.lock.bootstrap +394 -0
  39. data/extras/bucketstubs/error.html +0 -0
  40. data/extras/bucketstubs/index.html +0 -0
  41. data/extras/clean-stock-amis +11 -3
  42. data/extras/generate-stock-images +6 -3
  43. data/extras/git_rpm/build.sh +20 -0
  44. data/extras/git_rpm/mugit.spec +53 -0
  45. data/extras/image-generators/AWS/centos7.yaml +19 -16
  46. data/extras/image-generators/AWS/{rhel7.yaml → rhel71.yaml} +0 -0
  47. data/extras/image-generators/AWS/{win2k12.yaml → win2k12r2.yaml} +0 -0
  48. data/extras/image-generators/VMWare/centos8.yaml +15 -0
  49. data/extras/openssl_rpm/build.sh +19 -0
  50. data/extras/openssl_rpm/mussl.spec +46 -0
  51. data/extras/python_rpm/muthon.spec +14 -4
  52. data/extras/ruby_rpm/muby.spec +9 -5
  53. data/extras/sqlite_rpm/build.sh +19 -0
  54. data/extras/sqlite_rpm/muqlite.spec +47 -0
  55. data/install/installer +7 -5
  56. data/modules/mommacat.ru +2 -2
  57. data/modules/mu.rb +14 -7
  58. data/modules/mu/adoption.rb +5 -5
  59. data/modules/mu/cleanup.rb +47 -25
  60. data/modules/mu/cloud.rb +29 -1
  61. data/modules/mu/cloud/dnszone.rb +0 -2
  62. data/modules/mu/cloud/machine_images.rb +1 -1
  63. data/modules/mu/cloud/providers.rb +6 -1
  64. data/modules/mu/cloud/resource_base.rb +16 -7
  65. data/modules/mu/cloud/ssh_sessions.rb +5 -1
  66. data/modules/mu/cloud/wrappers.rb +20 -7
  67. data/modules/mu/config.rb +28 -12
  68. data/modules/mu/config/bucket.rb +31 -2
  69. data/modules/mu/config/cache_cluster.rb +1 -1
  70. data/modules/mu/config/cdn.rb +100 -0
  71. data/modules/mu/config/container_cluster.rb +1 -1
  72. data/modules/mu/config/database.rb +3 -3
  73. data/modules/mu/config/dnszone.rb +4 -3
  74. data/modules/mu/config/endpoint.rb +1 -0
  75. data/modules/mu/config/firewall_rule.rb +1 -1
  76. data/modules/mu/config/function.rb +16 -7
  77. data/modules/mu/config/job.rb +89 -0
  78. data/modules/mu/config/notifier.rb +7 -18
  79. data/modules/mu/config/ref.rb +55 -9
  80. data/modules/mu/config/schema_helpers.rb +12 -3
  81. data/modules/mu/config/server.rb +11 -5
  82. data/modules/mu/config/server_pool.rb +2 -2
  83. data/modules/mu/config/vpc.rb +11 -10
  84. data/modules/mu/defaults/AWS.yaml +106 -106
  85. data/modules/mu/deploy.rb +40 -14
  86. data/modules/mu/groomers/chef.rb +2 -2
  87. data/modules/mu/master.rb +70 -3
  88. data/modules/mu/mommacat.rb +28 -9
  89. data/modules/mu/mommacat/daemon.rb +13 -7
  90. data/modules/mu/mommacat/naming.rb +2 -2
  91. data/modules/mu/mommacat/search.rb +16 -5
  92. data/modules/mu/mommacat/storage.rb +67 -32
  93. data/modules/mu/providers/aws.rb +298 -85
  94. data/modules/mu/providers/aws/alarm.rb +5 -5
  95. data/modules/mu/providers/aws/bucket.rb +284 -50
  96. data/modules/mu/providers/aws/cache_cluster.rb +26 -26
  97. data/modules/mu/providers/aws/cdn.rb +782 -0
  98. data/modules/mu/providers/aws/collection.rb +16 -16
  99. data/modules/mu/providers/aws/container_cluster.rb +84 -64
  100. data/modules/mu/providers/aws/database.rb +59 -55
  101. data/modules/mu/providers/aws/dnszone.rb +29 -12
  102. data/modules/mu/providers/aws/endpoint.rb +535 -50
  103. data/modules/mu/providers/aws/firewall_rule.rb +32 -26
  104. data/modules/mu/providers/aws/folder.rb +1 -1
  105. data/modules/mu/providers/aws/function.rb +300 -134
  106. data/modules/mu/providers/aws/group.rb +16 -14
  107. data/modules/mu/providers/aws/habitat.rb +4 -4
  108. data/modules/mu/providers/aws/job.rb +469 -0
  109. data/modules/mu/providers/aws/loadbalancer.rb +67 -45
  110. data/modules/mu/providers/aws/log.rb +17 -17
  111. data/modules/mu/providers/aws/msg_queue.rb +22 -13
  112. data/modules/mu/providers/aws/nosqldb.rb +99 -8
  113. data/modules/mu/providers/aws/notifier.rb +137 -65
  114. data/modules/mu/providers/aws/role.rb +119 -83
  115. data/modules/mu/providers/aws/search_domain.rb +166 -30
  116. data/modules/mu/providers/aws/server.rb +209 -118
  117. data/modules/mu/providers/aws/server_pool.rb +95 -130
  118. data/modules/mu/providers/aws/storage_pool.rb +19 -11
  119. data/modules/mu/providers/aws/user.rb +5 -5
  120. data/modules/mu/providers/aws/userdata/linux.erb +5 -4
  121. data/modules/mu/providers/aws/vpc.rb +109 -54
  122. data/modules/mu/providers/aws/vpc_subnet.rb +43 -39
  123. data/modules/mu/providers/azure.rb +78 -12
  124. data/modules/mu/providers/azure/server.rb +20 -4
  125. data/modules/mu/providers/cloudformation/server.rb +1 -1
  126. data/modules/mu/providers/google.rb +21 -5
  127. data/modules/mu/providers/google/bucket.rb +1 -1
  128. data/modules/mu/providers/google/container_cluster.rb +1 -1
  129. data/modules/mu/providers/google/database.rb +1 -1
  130. data/modules/mu/providers/google/firewall_rule.rb +1 -1
  131. data/modules/mu/providers/google/folder.rb +7 -3
  132. data/modules/mu/providers/google/function.rb +66 -31
  133. data/modules/mu/providers/google/group.rb +1 -1
  134. data/modules/mu/providers/google/habitat.rb +1 -1
  135. data/modules/mu/providers/google/loadbalancer.rb +1 -1
  136. data/modules/mu/providers/google/role.rb +6 -3
  137. data/modules/mu/providers/google/server.rb +1 -1
  138. data/modules/mu/providers/google/server_pool.rb +1 -1
  139. data/modules/mu/providers/google/user.rb +1 -1
  140. data/modules/mu/providers/google/vpc.rb +28 -3
  141. data/modules/tests/aws-jobs-functions.yaml +46 -0
  142. data/modules/tests/aws-servers-with-handrolled-iam.yaml +37 -0
  143. data/modules/tests/centos6.yaml +4 -0
  144. data/modules/tests/centos7.yaml +4 -0
  145. data/modules/tests/ecs.yaml +2 -2
  146. data/modules/tests/eks.yaml +1 -1
  147. data/modules/tests/functions/node-function/lambda_function.js +10 -0
  148. data/modules/tests/functions/python-function/lambda_function.py +12 -0
  149. data/modules/tests/k8s.yaml +1 -1
  150. data/modules/tests/microservice_app.yaml +288 -0
  151. data/modules/tests/rds.yaml +5 -5
  152. data/modules/tests/regrooms/rds.yaml +5 -5
  153. data/modules/tests/server-with-scrub-muisms.yaml +1 -1
  154. data/modules/tests/super_complex_bok.yml +2 -2
  155. data/modules/tests/super_simple_bok.yml +2 -2
  156. metadata +42 -17
@@ -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
- "phase" => {
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
- "default" => false,
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
  }
@@ -386,8 +386,7 @@ module MU
386
386
  },
387
387
  "associate_public_ip" => {
388
388
  "type" => "boolean",
389
- "default" => false,
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" => {
@@ -546,7 +545,7 @@ module MU
546
545
  "additionalProperties" => false,
547
546
  "description" => "Create individual server instances.",
548
547
  "properties" => {
549
- "dns_records" => MU::Config::DNSZone.records_primitive(need_target: false, default_type: "A", need_zone: true),
548
+ "dns_records" => MU::Config::DNSZone.records_primitive(need_target: false, default_type: "A", need_zone: true, embedded_type: "server"),
550
549
  "bastion" => {
551
550
  "type" => "boolean",
552
551
  "default" => false,
@@ -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", phase: "groom", no_create_wait: true)
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", phase: "groom", no_create_wait: true)
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", phase: "groom", no_create_wait: true)
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", phase: "groom")
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
@@ -417,6 +417,7 @@ 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
422
  configurator.existing_deploy.original_config['vpcs'].each { |v|
422
423
  if v['name'].to_s == vpc['name'].to_s
@@ -539,7 +540,7 @@ module MU
539
540
  end
540
541
  end
541
542
 
542
- # Feeling that, generate a generic bastion/NAT host to do the job.
543
+ # Failing that, generate a generic bastion/NAT host to do the job.
543
544
  # Clouds that don't have some kind of native NAT gateway can also
544
545
  # leverage this host to honor "gateway" => "#NAT" situations.
545
546
  if !can_peer and !already_peered and have_public and vpc["create_bastion"]
@@ -562,13 +563,13 @@ module MU
562
563
  "name" => vpc["name"],
563
564
  "subnet_pref" => "public"
564
565
  }
565
- MU::Config.addDependency(vpc, bastion['name'], "server", no_create_wait: true)
566
- vpc["bastion"] = MU::Config::Ref.get(
567
- name: bastion['name'],
568
- cloud: vpc['cloud'],
569
- credentials: vpc['credentials'],
570
- type: "servers"
571
- )
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
+ # )
572
573
 
573
574
  ok = false if !configurator.insertKitten(bastion, "servers", true)
574
575
  end
@@ -614,11 +615,11 @@ module MU
614
615
  append_me = { "vpc" => peer["vpc"].dup }
615
616
  append_me['vpc']['name'] = sib['name']
616
617
  append << append_me
617
- MU::Config.addDependency(vpc, sib['name'], "vpc", phase: "groom", no_create_wait: true)
618
+ MU::Config.addDependency(vpc, sib['name'], "vpc", their_phase: "create", my_phase: "groom")
618
619
  end
619
620
  delete << peer
620
621
  else
621
- MU::Config.addDependency(vpc, peer['vpc']['name'], "vpc", phase: "groom", no_create_wait: true)
622
+ MU::Config.addDependency(vpc, peer['vpc']['name'], "vpc", their_phase: "create", my_phase: "groom")
622
623
  end
623
624
  delete << peer if sib['name'] == vpc['name']
624
625
  }
@@ -1,56 +1,56 @@
1
1
  ---
2
- rhel71: &4
3
- us-east-1: ami-0f05fce24aa75ba9f
4
- ap-northeast-1: ami-0c0ec19eb19055763
5
- ap-northeast-2: ami-0717ac5c67c99f745
6
- ap-south-1: ami-03454a4bef3ec6a9a
7
- ap-southeast-1: ami-0f3aa03320c0f6524
8
- ap-southeast-2: ami-0aa5e6888260cdb3c
9
- ca-central-1: ami-03e72964d7646b689
10
- eu-central-1: ami-02df259ca785eff54
11
- eu-north-1: ami-05253c445bdf7777d
12
- eu-west-1: ami-0c21c559f6d0f2401
13
- eu-west-2: ami-057c8d4259087594f
14
- eu-west-3: ami-05a428dc7a7f4ba46
15
- sa-east-1: ami-0a1d1cf6a89a2db56
16
- us-east-2: ami-02f6682c7816b3cfc
17
- us-west-1: ami-04898e596c06e802b
18
- us-west-2: ami-02db5457189a8a8c2
19
- centos6: &3
20
- us-east-1: ami-0ccdc671f12147a1d
21
- us-east-2: ami-00d0e8bc2f05ab949
22
- ap-northeast-1: ami-0726801ceef87f5f8
23
- ap-northeast-2: ami-05fa4afc4a0493b0a
24
- ap-south-1: ami-0d6e4f3b6592b3139
25
- ap-southeast-1: ami-0c988e3dc80b14653
26
- ap-southeast-2: ami-02ac856fd094675ef
27
- ca-central-1: ami-0ce7e343953af2292
28
- eu-central-1: ami-0ce8317423cea27b8
29
- eu-north-1: ami-0a923b493d5fc9743
30
- eu-west-1: ami-06e0f02328921c865
31
- eu-west-2: ami-07ae118c8814df140
32
- eu-west-3: ami-03c1017cd1ccc6e9d
33
- sa-east-1: ami-05212ae133b9c3ba1
34
- us-west-1: ami-0b05ec54412b9f8b0
35
- us-west-2: ami-0447e036b102b2ca0
2
+ rhel71: &5
3
+ us-east-1: ami-0c834836b3bd45e2f
4
+ ap-northeast-1: ami-036bb589253fe929e
5
+ ap-northeast-2: ami-0e39b4957dbc7e14d
6
+ ap-south-1: ami-0cd0554d9a05dddc9
7
+ ap-southeast-1: ami-0bae2684e9ed09b8b
8
+ ap-southeast-2: ami-0711ccf93abe3989b
9
+ ca-central-1: ami-0d75d90f73e417c25
10
+ eu-central-1: ami-0cae3cb53b9bbd783
11
+ eu-north-1: ami-0cd30fe8547a809f7
12
+ eu-west-1: ami-01441cca97c35eb0e
13
+ eu-west-2: ami-051aaf1b532b3e6bc
14
+ eu-west-3: ami-09a7af6793a3e8d09
15
+ sa-east-1: ami-0c4064cfe711311d5
16
+ us-east-2: ami-0124fd8917f59f8ce
17
+ us-west-1: ami-00457c55541605cb4
18
+ us-west-2: ami-02211d4e254a9e10f
19
+ centos6: &4
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-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: &2
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
+ ubuntu16: &3
54
54
  us-east-1: ami-bcdc16c6
55
55
  us-west-1: ami-1b17257b
56
56
  us-west-2: ami-19e92861
@@ -73,56 +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-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: &5
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
76
+ us-east-1: ami-0d28b9a40ed446e35
77
+ us-east-2: ami-010d247b7ee850d55
78
+ ca-central-1: ami-0c223858875f62d11
79
+ us-west-2: ami-01d188c5c06078fee
80
+ us-west-1: ami-0dbcc051c49ec24ec
81
+ eu-west-1: ami-080c7b4d6e32bf9f3
82
+ eu-west-2: ami-01b1edb5894a54bcc
83
+ eu-west-3: ami-09445cdc7a2acb1c0
84
+ eu-north-1: ami-0093cc63496e435df
85
+ sa-east-1: ami-04d015c8b371ba7b3
86
+ eu-central-1: ami-04d6144bcbb029141
87
+ ap-northeast-1: ami-07fad72f121aa157c
88
+ ap-south-1: ami-0b3241fd09b1ce87f
89
+ ap-northeast-2: ami-0ba7cd822e36dc0df
90
+ ap-southeast-1: ami-0648522a4cb50953c
91
+ ap-southeast-2: ami-0fc0bd73cd61a970f
92
+ win2k16: &2
93
+ us-east-1: ami-018151f8c8339a093
94
+ us-east-2: ami-09e045936c7d9ecd5
95
+ ca-central-1: ami-0a16abf0f1c35667a
96
+ us-west-2: ami-00d4216f80a82894d
97
+ eu-west-1: ami-07afc1525928ccad7
98
+ us-west-1: ami-0d2f7d4198b79a625
99
+ eu-west-2: ami-04eb62f17efc84a37
100
+ eu-west-3: ami-0b4affcd5848cf50c
101
+ eu-central-1: ami-0a92ae047ebc7a3da
102
+ sa-east-1: ami-0cc9a87c95fb37832
103
+ ap-northeast-1: ami-014c730050acef11d
104
+ ap-south-1: ami-0c3c8739263aa4844
105
+ ap-northeast-2: ami-0018a05eb15503b5e
106
+ ap-southeast-2: ami-0b50bfbb507285a89
107
+ ap-southeast-1: ami-073c677bcf225774a
108
+ eu-north-1: ami-09bb6d618593f2e7f
109
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
110
+ us-east-1: ami-09c18c34c341f2b6a
111
+ us-east-2: ami-030371d5ee8881350
112
+ ca-central-1: ami-018e5bf45c30fa58f
113
+ us-west-2: ami-07d1e5c4f906877e1
114
+ eu-west-2: ami-0b9d95fef44aa7c11
115
+ us-west-1: ami-0e7e082d6fa1769f3
116
+ eu-west-1: ami-05573fafa080144b6
117
+ eu-central-1: ami-0122b027c265988ea
118
+ eu-west-3: ami-0ba7c0a3dc4148b6a
119
+ eu-north-1: ami-03d8c3307f72f9847
120
+ sa-east-1: ami-0d0f66c3e0dfc09ee
121
+ ap-northeast-2: ami-07eff56de9293ab16
122
+ ap-northeast-1: ami-020fb790a3bed4cda
123
+ ap-southeast-1: ami-0b5d036d6d711a4c8
124
+ ap-southeast-2: ami-0fff96935fef7bf60
125
+ ap-south-1: ami-030ec249497f66a33
126
126
  amazon:
127
127
  us-east-1: ami-b73b63a0
128
128
  us-east-2: ami-58277d3d
@@ -137,9 +137,9 @@ amazon:
137
137
  ap-southeast-1: ami-b953f2da
138
138
  ap-southeast-2: ami-db704cb8
139
139
  win2k12: *1
140
- windows: *5
141
- ubuntu: *2
142
- centos: *3
143
- rhel7: *4
144
- rhel: *4
145
- linux: *3
140
+ windows: *2
141
+ ubuntu: *3
142
+ centos: *4
143
+ rhel7: *5
144
+ rhel: *5
145
+ linux: *4
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 {
@@ -312,6 +313,17 @@ module MU
312
313
 
313
314
  @mommacat.save!
314
315
 
316
+ # XXX Functions have a special behavior where we re-invoke their groom
317
+ # methods one more time at the end, so we can guarantee their
318
+ # environments are fully populated with all sibling resource idents
319
+ # regardless of dependency order. This is, obviously, a disgusting
320
+ # hack, and we should revisit our dependency language in the next big
321
+ # release.
322
+ if !@main_config["functions"].nil? and
323
+ @main_config["functions"].size > 0
324
+ createResources(@main_config["functions"], "groom")
325
+ end
326
+
315
327
  rescue StandardError => e
316
328
  MU.log e.class.name, MU::ERR, details: caller
317
329
 
@@ -426,10 +438,10 @@ module MU
426
438
  MU.log "Failed to generate AWS cost-calculation URL. Skipping.", MU::WARN, details: "Deployment uses a feature not available in CloudFormation layer.", verbosity: MU::Logger::NORMAL
427
439
  ensure
428
440
  MU.setLogging(@verbosity)
429
- MU.log "Deployment #{MU.deploy_id} \"#{MU.handle}\" complete", details: deployment, verbosity: @verbosity
441
+ MU.log "Deployment #{MU.deploy_id} \"#{MU.handle}\" #{@updating ? "updated" : "complete"}", details: deployment, verbosity: @verbosity
430
442
  end
431
443
  else
432
- MU.log "Deployment #{MU.deploy_id} \"#{MU.handle}\" complete", details: deployment, verbosity: @verbosity
444
+ MU.log "Deployment #{MU.deploy_id} \"#{MU.handle}\" #{@updating ? "updated" : "complete"}", details: deployment, verbosity: @verbosity
433
445
  end
434
446
 
435
447
 
@@ -439,7 +451,7 @@ module MU
439
451
  }
440
452
  end
441
453
 
442
- @mommacat.sendAdminSlack("Deploy completed succesfully", msg: MU.summary.join("\n"))
454
+ @mommacat.sendAdminSlack("Deploy #{MU.deploy_id} \"#{MU.handle}\" #{@updating ? "updated" : "complete"}", msg: MU.summary.join("\n"))
443
455
  end
444
456
 
445
457
  private
@@ -524,8 +536,9 @@ MESSAGE_END
524
536
  #########################################################################
525
537
  def addDependentThread(parent, child)
526
538
  @dependency_semaphore.synchronize {
527
- @dependency_threads[child] = Array.new if !@dependency_threads[child]
539
+ @dependency_threads[child] ||= []
528
540
  @dependency_threads[child] << parent
541
+ @dependency_threads[child].uniq!
529
542
  MU.log "Thread #{child} will wait on #{parent}", MU::DEBUG, details: @dependency_threads[child]
530
543
  }
531
544
  end
@@ -556,6 +569,7 @@ MESSAGE_END
556
569
 
557
570
  MU.log "Setting dependencies for #{name}", MU::DEBUG, details: resource["dependencies"]
558
571
  if !resource["dependencies"].nil? then
572
+
559
573
  resource["dependencies"].each { |dependency|
560
574
  parent_class = MU::Cloud.loadBaseType(dependency['type'])
561
575
 
@@ -565,31 +579,41 @@ MESSAGE_END
565
579
  parent = parent_type+"_"+dependency["name"]+"_create"
566
580
  addDependentThread(parent, "#{name}_groom")
567
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
+
568
590
  # should our creation thread also wait on our parent's create?
569
- if !dependency["no_create_wait"] and
591
+ if dependency["my_phase"] == "create" and
570
592
  (resource["#MU_CLOUDCLASS"].waits_on_parent_completion or
571
- dependency['phase'] == "create" or
572
- parent_class.deps_wait_on_my_creation)
593
+ parent_class.deps_wait_on_my_creation
594
+ )
573
595
  addDependentThread(parent, "#{name}_create")
574
596
  end
575
597
 
576
598
 
577
599
  # how about our groom thread waiting on our parents' grooms?
578
- if (dependency['phase'] == "groom" or resource["#MU_CLOUDCLASS"].waits_on_parent_completion) and parent_class.instance_methods(false).include?(:groom)
600
+ if (dependency['their_phase'] == "groom" or resource["#MU_CLOUDCLASS"].waits_on_parent_completion) and parent_class.instance_methods(false).include?(:groom)
579
601
  parent = parent_type+"_"+dependency["name"]+"_groom"
580
602
  addDependentThread(parent, "#{name}_groom")
581
- if !dependency["no_create_wait"] and (
603
+ if dependency["my_phase"] == "groom" and
604
+ (dependency['their_phase'] == "create" or
605
+ (!dependency['their_phase'] and
582
606
  parent_class.deps_wait_on_my_creation or
583
- resource["#MU_CLOUDCLASS"].waits_on_parent_completion or
584
- dependency['phase'] == "groom"
607
+ resource["#MU_CLOUDCLASS"].waits_on_parent_completion)
585
608
  )
586
609
  addDependentThread(parent, "#{name}_create")
587
610
  end
588
611
  end
589
612
  }
590
613
  end
591
- MU.log "Thread dependencies #{res_type}[#{name}]", MU::DEBUG, details: { "create" => @dependency_threads["#{name}_create"], "groom" => @dependency_threads["#{name}_groom"] }
592
- @dependency_threads["#{name}_groom"]=["#{name}_create", "mu_groom_container"]
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"
593
617
  }
594
618
  end
595
619
 
@@ -623,7 +647,7 @@ MESSAGE_END
623
647
  begin
624
648
  if myservice['#MUOBJECT'].nil?
625
649
  if @mommacat
626
- ext_obj = @mommacat.findLitterMate(type: myservice["#MU_CLOUDCLASS"].cfg_plural, name: myservice['name'], credentials: myservice['credentials'], created_only: true, return_all: false)
650
+ ext_obj = @mommacat.findLitterMate(type: myservice["#MU_CLOUDCLASS"].cfg_plural, name: myservice['name'], credentials: myservice['credentials'], created_only: true, return_all: false, ignore_missing: !@updating)
627
651
  if @updating and ext_obj
628
652
  ext_obj.config!(myservice)
629
653
  end
@@ -733,7 +757,9 @@ MESSAGE_END
733
757
  sleep 10+Random.rand(20)
734
758
  retry
735
759
  end
760
+
736
761
  end
762
+
737
763
  end
738
764
 
739
765
  end #class