cloud-mu 1.9.0.pre.beta → 2.0.0.pre.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Berksfile +16 -54
- data/Berksfile.lock +14 -62
- data/bin/mu-aws-setup +131 -108
- data/bin/mu-configure +311 -74
- data/bin/mu-gcp-setup +84 -62
- data/bin/mu-load-config.rb +46 -2
- data/bin/mu-self-update +11 -9
- data/bin/mu-upload-chef-artifacts +4 -4
- data/{mu.gemspec → cloud-mu.gemspec} +2 -2
- data/cookbooks/awscli/Berksfile +8 -0
- data/cookbooks/mu-activedirectory/Berksfile +11 -0
- data/cookbooks/mu-firewall/Berksfile +9 -0
- data/cookbooks/mu-firewall/metadata.rb +1 -1
- data/cookbooks/mu-glusterfs/Berksfile +10 -0
- data/cookbooks/mu-jenkins/Berksfile +14 -0
- data/cookbooks/mu-master/Berksfile +23 -0
- data/cookbooks/mu-master/attributes/default.rb +1 -1
- data/cookbooks/mu-master/metadata.rb +2 -2
- data/cookbooks/mu-master/recipes/default.rb +1 -1
- data/cookbooks/mu-master/recipes/init.rb +7 -3
- data/cookbooks/mu-master/recipes/ssl-certs.rb +1 -0
- data/cookbooks/mu-mongo/Berksfile +10 -0
- data/cookbooks/mu-openvpn/Berksfile +11 -0
- data/cookbooks/mu-php54/Berksfile +13 -0
- data/cookbooks/mu-splunk/Berksfile +10 -0
- data/cookbooks/mu-tools/Berksfile +21 -0
- data/cookbooks/mu-tools/files/default/Mu_CA.pem +15 -15
- data/cookbooks/mu-utility/Berksfile +9 -0
- data/cookbooks/mu-utility/metadata.rb +2 -1
- data/cookbooks/nagios/Berksfile +7 -4
- data/cookbooks/s3fs/Berksfile +9 -0
- data/environments/dev.json +6 -6
- data/environments/prod.json +6 -6
- data/modules/mu.rb +20 -42
- data/modules/mu/cleanup.rb +102 -100
- data/modules/mu/cloud.rb +90 -28
- data/modules/mu/clouds/aws.rb +449 -218
- data/modules/mu/clouds/aws/alarm.rb +29 -17
- data/modules/mu/clouds/aws/cache_cluster.rb +78 -64
- data/modules/mu/clouds/aws/collection.rb +25 -18
- data/modules/mu/clouds/aws/container_cluster.rb +73 -66
- data/modules/mu/clouds/aws/database.rb +124 -116
- data/modules/mu/clouds/aws/dnszone.rb +27 -20
- data/modules/mu/clouds/aws/firewall_rule.rb +30 -22
- data/modules/mu/clouds/aws/folder.rb +18 -3
- data/modules/mu/clouds/aws/function.rb +77 -23
- data/modules/mu/clouds/aws/group.rb +19 -12
- data/modules/mu/clouds/aws/habitat.rb +153 -0
- data/modules/mu/clouds/aws/loadbalancer.rb +59 -52
- data/modules/mu/clouds/aws/log.rb +30 -23
- data/modules/mu/clouds/aws/msg_queue.rb +29 -20
- data/modules/mu/clouds/aws/notifier.rb +222 -0
- data/modules/mu/clouds/aws/role.rb +178 -90
- data/modules/mu/clouds/aws/search_domain.rb +40 -24
- data/modules/mu/clouds/aws/server.rb +169 -137
- data/modules/mu/clouds/aws/server_pool.rb +60 -83
- data/modules/mu/clouds/aws/storage_pool.rb +59 -31
- data/modules/mu/clouds/aws/user.rb +36 -27
- data/modules/mu/clouds/aws/userdata/linux.erb +101 -93
- data/modules/mu/clouds/aws/vpc.rb +250 -189
- data/modules/mu/clouds/azure.rb +132 -0
- data/modules/mu/clouds/cloudformation.rb +65 -1
- data/modules/mu/clouds/cloudformation/alarm.rb +8 -0
- data/modules/mu/clouds/cloudformation/cache_cluster.rb +7 -0
- data/modules/mu/clouds/cloudformation/collection.rb +7 -0
- data/modules/mu/clouds/cloudformation/database.rb +7 -0
- data/modules/mu/clouds/cloudformation/dnszone.rb +7 -0
- data/modules/mu/clouds/cloudformation/firewall_rule.rb +9 -2
- data/modules/mu/clouds/cloudformation/loadbalancer.rb +7 -0
- data/modules/mu/clouds/cloudformation/log.rb +7 -0
- data/modules/mu/clouds/cloudformation/server.rb +7 -0
- data/modules/mu/clouds/cloudformation/server_pool.rb +7 -0
- data/modules/mu/clouds/cloudformation/vpc.rb +7 -0
- data/modules/mu/clouds/google.rb +214 -110
- data/modules/mu/clouds/google/container_cluster.rb +42 -24
- data/modules/mu/clouds/google/database.rb +15 -6
- data/modules/mu/clouds/google/firewall_rule.rb +17 -25
- data/modules/mu/clouds/google/group.rb +13 -5
- data/modules/mu/clouds/google/habitat.rb +105 -0
- data/modules/mu/clouds/google/loadbalancer.rb +28 -20
- data/modules/mu/clouds/google/server.rb +93 -354
- data/modules/mu/clouds/google/server_pool.rb +18 -10
- data/modules/mu/clouds/google/user.rb +22 -14
- data/modules/mu/clouds/google/vpc.rb +97 -69
- data/modules/mu/config.rb +133 -38
- data/modules/mu/config/alarm.rb +25 -0
- data/modules/mu/config/cache_cluster.rb +5 -3
- data/modules/mu/config/cache_cluster.yml +23 -0
- data/modules/mu/config/database.rb +25 -16
- data/modules/mu/config/database.yml +3 -3
- data/modules/mu/config/function.rb +1 -2
- data/modules/mu/config/{project.rb → habitat.rb} +10 -10
- data/modules/mu/config/notifier.rb +85 -0
- data/modules/mu/config/notifier.yml +9 -0
- data/modules/mu/config/role.rb +1 -1
- data/modules/mu/config/search_domain.yml +2 -2
- data/modules/mu/config/server.rb +13 -1
- data/modules/mu/config/server.yml +3 -3
- data/modules/mu/config/server_pool.rb +3 -1
- data/modules/mu/config/storage_pool.rb +3 -1
- data/modules/mu/config/storage_pool.yml +19 -0
- data/modules/mu/config/vpc.rb +70 -8
- data/modules/mu/groomers/chef.rb +2 -3
- data/modules/mu/kittens.rb +500 -122
- data/modules/mu/master.rb +5 -5
- data/modules/mu/mommacat.rb +151 -91
- data/modules/tests/super_complex_bok.yml +12 -0
- data/modules/tests/super_simple_bok.yml +12 -0
- data/spec/mu/clouds/azure_spec.rb +82 -0
- data/spec/spec_helper.rb +105 -0
- metadata +26 -5
- data/modules/mu/clouds/aws/notification.rb +0 -139
- data/modules/mu/config/notification.rb +0 -44
@@ -39,3 +39,15 @@ search_domains:
|
|
39
39
|
databases:
|
40
40
|
-
|
41
41
|
<%= include("../mu/config/database.yml") %>
|
42
|
+
|
43
|
+
container_clusters:
|
44
|
+
-
|
45
|
+
<%= include("../mu/config/container_cluster.yml") %>
|
46
|
+
|
47
|
+
cache_clusters:
|
48
|
+
-
|
49
|
+
<%= include("../mu/config/cache_cluster.yml") %>
|
50
|
+
|
51
|
+
notifiers:
|
52
|
+
-
|
53
|
+
<%= include("../mu/config/notifier.yml") %>
|
@@ -38,3 +38,15 @@ search_domains:
|
|
38
38
|
databases:
|
39
39
|
-
|
40
40
|
<%= include("../mu/config/database.yml") %>
|
41
|
+
|
42
|
+
container_clusters:
|
43
|
+
-
|
44
|
+
<%= include("../mu/config/container_cluster.yml") %>
|
45
|
+
|
46
|
+
cache_clusters:
|
47
|
+
-
|
48
|
+
<%= include("../mu/config/cache_cluster.yml") %>
|
49
|
+
|
50
|
+
notifiers:
|
51
|
+
-
|
52
|
+
<%= include("../mu/config/notifier.yml") %>
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'mu/clouds/azure'
|
3
|
+
|
4
|
+
describe MU::Cloud::Azure do
|
5
|
+
|
6
|
+
# @azure = nil
|
7
|
+
|
8
|
+
# before(:all) do
|
9
|
+
# @azure = MU::Cloud::Azure.new
|
10
|
+
# end
|
11
|
+
|
12
|
+
describe ".hosted?" do
|
13
|
+
|
14
|
+
it "responds with true or false" do
|
15
|
+
expect(MU::Cloud::Azure.hosted?).to be(true).or be(false)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
describe ".hosted" do
|
21
|
+
|
22
|
+
it "responds with true or false" do
|
23
|
+
expect(MU::Cloud::Azure.hosted?).to be(true).or be(false)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
describe ".required_instance_methods" do
|
29
|
+
it "responds with an empty array of required methods" do
|
30
|
+
methods = MU::Cloud::Azure.required_instance_methods
|
31
|
+
expect(methods).to eql([])
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe ".listRegions" do
|
36
|
+
it "responds with false" do
|
37
|
+
expect(MU::Cloud::Azure.listRegions).to eql("TODO")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe ".listAZs" do
|
42
|
+
it "responds with false" do
|
43
|
+
expect(MU::Cloud::Azure.listAZs).to eql("TODO")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe ".hosted_config" do
|
48
|
+
it "responds with false" do
|
49
|
+
expect(MU::Cloud::Azure.hosted_config).to eql("TODO")
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe ".config_example" do
|
54
|
+
it "responds with false" do
|
55
|
+
expect(MU::Cloud::Azure.config_example).to eql("TODO")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
describe ".writeDeploySecret" do
|
60
|
+
it "responds with false" do
|
61
|
+
expect(MU::Cloud::Azure.writeDeploySecret).to eql("TODO")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe ".listCredentials" do
|
66
|
+
it "responds with false" do
|
67
|
+
expect(MU::Cloud::Azure.listCredentials).to eql("TODO")
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe ".credConfig" do
|
72
|
+
it "responds with false" do
|
73
|
+
expect(MU::Cloud::Azure.credConfig).to eql("TODO")
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe ".listInstanceTypes" do
|
78
|
+
it "responds with false" do
|
79
|
+
expect(MU::Cloud::Azure.listInstanceTypes).to eql("TODO")
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
4
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
5
|
+
# files.
|
6
|
+
#
|
7
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
8
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
9
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
10
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
11
|
+
# a separate helper file that requires the additional dependencies and performs
|
12
|
+
# the additional setup, and require it from the spec files that actually need
|
13
|
+
# it.
|
14
|
+
#
|
15
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
16
|
+
|
17
|
+
$LOAD_PATH << "#{File.realpath(File.expand_path(File.dirname(__FILE__))+"/..")}/modules"
|
18
|
+
# require 'mu'
|
19
|
+
|
20
|
+
RSpec.configure do |config|
|
21
|
+
# rspec-expectations config goes here. You can use an alternate
|
22
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
23
|
+
# assertions if you prefer.
|
24
|
+
config.expect_with :rspec do |expectations|
|
25
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
26
|
+
# and `failure_message` of custom matchers include text for helper methods
|
27
|
+
# defined using `chain`, e.g.:
|
28
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
29
|
+
# # => "be bigger than 2 and smaller than 4"
|
30
|
+
# ...rather than:
|
31
|
+
# # => "be bigger than 2"
|
32
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
33
|
+
end
|
34
|
+
|
35
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
36
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
37
|
+
config.mock_with :rspec do |mocks|
|
38
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
39
|
+
# a real object. This is generally recommended, and will default to
|
40
|
+
# `true` in RSpec 4.
|
41
|
+
mocks.verify_partial_doubles = true
|
42
|
+
end
|
43
|
+
|
44
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
45
|
+
# have no way to turn it off -- the option exists only for backwards
|
46
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
47
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
48
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
49
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
50
|
+
|
51
|
+
# The settings below are suggested to provide a good initial experience
|
52
|
+
# with RSpec, but feel free to customize to your heart's content.
|
53
|
+
=begin
|
54
|
+
# This allows you to limit a spec run to individual examples or groups
|
55
|
+
# you care about by tagging them with `:focus` metadata. When nothing
|
56
|
+
# is tagged with `:focus`, all examples get run. RSpec also provides
|
57
|
+
# aliases for `it`, `describe`, and `context` that include `:focus`
|
58
|
+
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
59
|
+
config.filter_run_when_matching :focus
|
60
|
+
|
61
|
+
# Allows RSpec to persist some state between runs in order to support
|
62
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
63
|
+
# you configure your source control system to ignore this file.
|
64
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
65
|
+
|
66
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
67
|
+
# recommended. For more details, see:
|
68
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
69
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
70
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
71
|
+
config.disable_monkey_patching!
|
72
|
+
|
73
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
74
|
+
# be too noisy due to issues in dependencies.
|
75
|
+
config.warnings = true
|
76
|
+
|
77
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
78
|
+
# file, and it's useful to allow more verbose output when running an
|
79
|
+
# individual spec file.
|
80
|
+
if config.files_to_run.one?
|
81
|
+
# Use the documentation formatter for detailed output,
|
82
|
+
# unless a formatter has already been configured
|
83
|
+
# (e.g. via a command-line flag).
|
84
|
+
config.default_formatter = "doc"
|
85
|
+
end
|
86
|
+
|
87
|
+
# Print the 10 slowest examples and example groups at the
|
88
|
+
# end of the spec run, to help surface which specs are running
|
89
|
+
# particularly slow.
|
90
|
+
config.profile_examples = 10
|
91
|
+
|
92
|
+
# Run specs in random order to surface order dependencies. If you find an
|
93
|
+
# order dependency and want to debug it, you can fix the order by providing
|
94
|
+
# the seed, which is printed after each run.
|
95
|
+
# --seed 1234
|
96
|
+
config.order = :random
|
97
|
+
|
98
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
99
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
100
|
+
# test failures related to randomization by passing the same `--seed` value
|
101
|
+
# as the one that triggered the failure.
|
102
|
+
Kernel.srand config.seed
|
103
|
+
=end
|
104
|
+
|
105
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud-mu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.pre.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Stange
|
@@ -356,6 +356,8 @@ files:
|
|
356
356
|
- bin/mu-tunnel-nagios
|
357
357
|
- bin/mu-upload-chef-artifacts
|
358
358
|
- bin/mu-user-manage
|
359
|
+
- cloud-mu.gemspec
|
360
|
+
- cookbooks/awscli/Berksfile
|
359
361
|
- cookbooks/awscli/LICENSE
|
360
362
|
- cookbooks/awscli/README.md
|
361
363
|
- cookbooks/awscli/attributes/default.rb
|
@@ -363,6 +365,7 @@ files:
|
|
363
365
|
- cookbooks/awscli/metadata.rb
|
364
366
|
- cookbooks/awscli/recipes/default.rb
|
365
367
|
- cookbooks/awscli/templates/default/config.erb
|
368
|
+
- cookbooks/mu-activedirectory/Berksfile
|
366
369
|
- cookbooks/mu-activedirectory/CHANGELOG.md
|
367
370
|
- cookbooks/mu-activedirectory/LICENSE
|
368
371
|
- cookbooks/mu-activedirectory/README.md
|
@@ -400,12 +403,14 @@ files:
|
|
400
403
|
- cookbooks/mu-activedirectory/templates/windows/gpreprt.xml.erb
|
401
404
|
- cookbooks/mu-activedirectory/templates/windows/gptmpl.inf.erb
|
402
405
|
- cookbooks/mu-activedirectory/templates/windows/manifest.xml.erb
|
406
|
+
- cookbooks/mu-firewall/Berksfile
|
403
407
|
- cookbooks/mu-firewall/CHANGELOG.md
|
404
408
|
- cookbooks/mu-firewall/LICENSE
|
405
409
|
- cookbooks/mu-firewall/README.md
|
406
410
|
- cookbooks/mu-firewall/attributes/default.rb
|
407
411
|
- cookbooks/mu-firewall/metadata.rb
|
408
412
|
- cookbooks/mu-firewall/recipes/default.rb
|
413
|
+
- cookbooks/mu-glusterfs/Berksfile
|
409
414
|
- cookbooks/mu-glusterfs/CHANGELOG.md
|
410
415
|
- cookbooks/mu-glusterfs/LICENSE
|
411
416
|
- cookbooks/mu-glusterfs/README.md
|
@@ -417,6 +422,7 @@ files:
|
|
417
422
|
- cookbooks/mu-glusterfs/recipes/server.rb
|
418
423
|
- cookbooks/mu-glusterfs/templates/default/mu-gluster-client.erb
|
419
424
|
- cookbooks/mu-glusterfs/templates/default/smb.conf.erb
|
425
|
+
- cookbooks/mu-jenkins/Berksfile
|
420
426
|
- cookbooks/mu-jenkins/CHANGELOG.md
|
421
427
|
- cookbooks/mu-jenkins/LICENSE
|
422
428
|
- cookbooks/mu-jenkins/README.md
|
@@ -430,6 +436,7 @@ files:
|
|
430
436
|
- cookbooks/mu-jenkins/templates/default/example_job.config.xml.erb
|
431
437
|
- cookbooks/mu-jenkins/templates/default/org.jvnet.hudson.plugins.SSHBuildWrapper.xml.erb
|
432
438
|
- cookbooks/mu-jenkins/templates/default/ssh_config.erb
|
439
|
+
- cookbooks/mu-master/Berksfile
|
433
440
|
- cookbooks/mu-master/CHANGELOG.md
|
434
441
|
- cookbooks/mu-master/LICENSE
|
435
442
|
- cookbooks/mu-master/README.md
|
@@ -472,6 +479,7 @@ files:
|
|
472
479
|
- cookbooks/mu-master/templates/default/openssl.cnf.erb
|
473
480
|
- cookbooks/mu-master/templates/default/sssd.conf.erb
|
474
481
|
- cookbooks/mu-master/templates/default/web_app.conf.erb
|
482
|
+
- cookbooks/mu-mongo/Berksfile
|
475
483
|
- cookbooks/mu-mongo/CHANGELOG.md
|
476
484
|
- cookbooks/mu-mongo/LICENSE
|
477
485
|
- cookbooks/mu-mongo/README.md
|
@@ -486,6 +494,7 @@ files:
|
|
486
494
|
- cookbooks/mu-mongo/templates/default/mongo_logrotate.erb
|
487
495
|
- cookbooks/mu-mongo/templates/default/mongo_replset_addnodes.js.erb
|
488
496
|
- cookbooks/mu-mongo/templates/default/replset_init.js.erb
|
497
|
+
- cookbooks/mu-openvpn/Berksfile
|
489
498
|
- cookbooks/mu-openvpn/CHANGELOG.md
|
490
499
|
- cookbooks/mu-openvpn/LICENSE
|
491
500
|
- cookbooks/mu-openvpn/README.md
|
@@ -493,6 +502,7 @@ files:
|
|
493
502
|
- cookbooks/mu-openvpn/metadata.rb
|
494
503
|
- cookbooks/mu-openvpn/recipes/default.rb
|
495
504
|
- cookbooks/mu-openvpn/templates/default/users.json.erb
|
505
|
+
- cookbooks/mu-php54/Berksfile
|
496
506
|
- cookbooks/mu-php54/CHANGELOG.md
|
497
507
|
- cookbooks/mu-php54/LICENSE
|
498
508
|
- cookbooks/mu-php54/README.md
|
@@ -500,6 +510,7 @@ files:
|
|
500
510
|
- cookbooks/mu-php54/files/ubuntu/php.ini
|
501
511
|
- cookbooks/mu-php54/metadata.rb
|
502
512
|
- cookbooks/mu-php54/recipes/default.rb
|
513
|
+
- cookbooks/mu-splunk/Berksfile
|
503
514
|
- cookbooks/mu-splunk/CHANGELOG.md
|
504
515
|
- cookbooks/mu-splunk/LICENSE
|
505
516
|
- cookbooks/mu-splunk/README.md
|
@@ -528,6 +539,7 @@ files:
|
|
528
539
|
- cookbooks/mu-splunk/templates/default/outputs.conf.erb
|
529
540
|
- cookbooks/mu-splunk/templates/default/splunk-init.erb
|
530
541
|
- cookbooks/mu-splunk/templates/default/system-web.conf.erb
|
542
|
+
- cookbooks/mu-tools/Berksfile
|
531
543
|
- cookbooks/mu-tools/CHANGELOG.md
|
532
544
|
- cookbooks/mu-tools/LICENSE
|
533
545
|
- cookbooks/mu-tools/README.md
|
@@ -659,6 +671,7 @@ files:
|
|
659
671
|
- cookbooks/mu-tools/templates/windows/manifest.xml.erb
|
660
672
|
- cookbooks/mu-tools/templates/windows/set_ad_dns_scheduled_task.ps1.erb
|
661
673
|
- cookbooks/mu-tools/templates/windows/sshd_config.erb
|
674
|
+
- cookbooks/mu-utility/Berksfile
|
662
675
|
- cookbooks/mu-utility/CHANGELOG.md
|
663
676
|
- cookbooks/mu-utility/LICENSE
|
664
677
|
- cookbooks/mu-utility/README.md
|
@@ -745,6 +758,7 @@ files:
|
|
745
758
|
- cookbooks/nagios/templates/default/services.cfg.erb
|
746
759
|
- cookbooks/nagios/templates/default/templates.cfg.erb
|
747
760
|
- cookbooks/nagios/templates/default/timeperiods.cfg.erb
|
761
|
+
- cookbooks/s3fs/Berksfile
|
748
762
|
- cookbooks/s3fs/CHANGELOG.md
|
749
763
|
- cookbooks/s3fs/LICENSE
|
750
764
|
- cookbooks/s3fs/README.md
|
@@ -816,10 +830,11 @@ files:
|
|
816
830
|
- modules/mu/clouds/aws/folder.rb
|
817
831
|
- modules/mu/clouds/aws/function.rb
|
818
832
|
- modules/mu/clouds/aws/group.rb
|
833
|
+
- modules/mu/clouds/aws/habitat.rb
|
819
834
|
- modules/mu/clouds/aws/loadbalancer.rb
|
820
835
|
- modules/mu/clouds/aws/log.rb
|
821
836
|
- modules/mu/clouds/aws/msg_queue.rb
|
822
|
-
- modules/mu/clouds/aws/
|
837
|
+
- modules/mu/clouds/aws/notifier.rb
|
823
838
|
- modules/mu/clouds/aws/role.rb
|
824
839
|
- modules/mu/clouds/aws/search_domain.rb
|
825
840
|
- modules/mu/clouds/aws/server.rb
|
@@ -830,6 +845,7 @@ files:
|
|
830
845
|
- modules/mu/clouds/aws/userdata/linux.erb
|
831
846
|
- modules/mu/clouds/aws/userdata/windows.erb
|
832
847
|
- modules/mu/clouds/aws/vpc.rb
|
848
|
+
- modules/mu/clouds/azure.rb
|
833
849
|
- modules/mu/clouds/cloudformation.rb
|
834
850
|
- modules/mu/clouds/cloudformation/alarm.rb
|
835
851
|
- modules/mu/clouds/cloudformation/cache_cluster.rb
|
@@ -848,6 +864,7 @@ files:
|
|
848
864
|
- modules/mu/clouds/google/database.rb
|
849
865
|
- modules/mu/clouds/google/firewall_rule.rb
|
850
866
|
- modules/mu/clouds/google/group.rb
|
867
|
+
- modules/mu/clouds/google/habitat.rb
|
851
868
|
- modules/mu/clouds/google/loadbalancer.rb
|
852
869
|
- modules/mu/clouds/google/server.rb
|
853
870
|
- modules/mu/clouds/google/server_pool.rb
|
@@ -860,6 +877,7 @@ files:
|
|
860
877
|
- modules/mu/config/README.md
|
861
878
|
- modules/mu/config/alarm.rb
|
862
879
|
- modules/mu/config/cache_cluster.rb
|
880
|
+
- modules/mu/config/cache_cluster.yml
|
863
881
|
- modules/mu/config/collection.rb
|
864
882
|
- modules/mu/config/container_cluster.rb
|
865
883
|
- modules/mu/config/container_cluster.yml
|
@@ -870,13 +888,14 @@ files:
|
|
870
888
|
- modules/mu/config/folder.rb
|
871
889
|
- modules/mu/config/function.rb
|
872
890
|
- modules/mu/config/group.rb
|
891
|
+
- modules/mu/config/habitat.rb
|
873
892
|
- modules/mu/config/loadbalancer.rb
|
874
893
|
- modules/mu/config/log.rb
|
875
894
|
- modules/mu/config/log.yml
|
876
895
|
- modules/mu/config/msg_queue.rb
|
877
896
|
- modules/mu/config/msg_queue.yml
|
878
|
-
- modules/mu/config/
|
879
|
-
- modules/mu/config/
|
897
|
+
- modules/mu/config/notifier.rb
|
898
|
+
- modules/mu/config/notifier.yml
|
880
899
|
- modules/mu/config/role.rb
|
881
900
|
- modules/mu/config/search_domain.rb
|
882
901
|
- modules/mu/config/search_domain.yml
|
@@ -885,6 +904,7 @@ files:
|
|
885
904
|
- modules/mu/config/server_pool.rb
|
886
905
|
- modules/mu/config/server_pool.yml
|
887
906
|
- modules/mu/config/storage_pool.rb
|
907
|
+
- modules/mu/config/storage_pool.yml
|
888
908
|
- modules/mu/config/user.rb
|
889
909
|
- modules/mu/config/vpc.rb
|
890
910
|
- modules/mu/config/vpc.yml
|
@@ -905,7 +925,6 @@ files:
|
|
905
925
|
- modules/scratchpad.erb
|
906
926
|
- modules/tests/super_complex_bok.yml
|
907
927
|
- modules/tests/super_simple_bok.yml
|
908
|
-
- mu.gemspec
|
909
928
|
- roles/demo-dbservice-configure.json
|
910
929
|
- roles/demo-portal-configure.json
|
911
930
|
- roles/mu-master-jenkins.json
|
@@ -914,6 +933,8 @@ files:
|
|
914
933
|
- roles/mu-node.json
|
915
934
|
- roles/mu-splunk-server.json
|
916
935
|
- roles/mu-splunk.json
|
936
|
+
- spec/mu/clouds/azure_spec.rb
|
937
|
+
- spec/spec_helper.rb
|
917
938
|
- test/clean_up.py
|
918
939
|
- test/demo-test-profile/README.md
|
919
940
|
- test/demo-test-profile/controls/flask.rb
|
@@ -1,139 +0,0 @@
|
|
1
|
-
# Copyright:: Copyright (c) 2014 eGlobalTech, Inc., all rights reserved
|
2
|
-
#
|
3
|
-
# Licensed under the BSD-3 license (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License in the root of the project or at
|
6
|
-
#
|
7
|
-
# http://egt-labs.com/mu/LICENSE.html
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
module MU
|
16
|
-
class Cloud
|
17
|
-
class AWS
|
18
|
-
# Support for AWS SNS
|
19
|
-
class Notification < MU::Cloud::Notification
|
20
|
-
# Remove all notifications associated with the currently loaded deployment.
|
21
|
-
# @param noop [Boolean]: If true, will only print what would be done
|
22
|
-
# @param ignoremaster [Boolean]: If true, will remove resources not flagged as originating from this Mu server
|
23
|
-
# @param region [String]: The cloud provider region
|
24
|
-
# @return [void]
|
25
|
-
def self.cleanup(noop: false, ignoremaster: false, region: MU.curRegion, flags: {})
|
26
|
-
MU::Cloud::AWS.sns(region).list_topics.topics.each { |topic|
|
27
|
-
if topic.topic_arn.match(MU.deploy_id)
|
28
|
-
# We don't have a way to tag our SNS topics, so we will delete any topic that has the MU-ID in its ARN.
|
29
|
-
# This may fail to find notification groups in some cases (eg. cache_cluster) so we might want to delete from each API as well.
|
30
|
-
MU::Cloud::AWS.sns(region).delete_topic(topic_arn: topic.topic_arn)
|
31
|
-
MU.log "Deleted SNS topic: #{topic.topic_arn}"
|
32
|
-
end
|
33
|
-
}
|
34
|
-
end
|
35
|
-
|
36
|
-
# Canonical Amazon Resource Number for this resource
|
37
|
-
# @return [String]
|
38
|
-
def arn
|
39
|
-
"arn:"+(MU::Cloud::AWS.isGovCloud?(@config["region"]) ? "aws-us-gov" : "aws")+":sns:"+@config['region']+":"+MU.account_number+":"+@cloud_id
|
40
|
-
end
|
41
|
-
|
42
|
-
# Locate an existing notification.
|
43
|
-
# @param cloud_id [String]: The cloud provider's identifier for this resource.
|
44
|
-
# @param region [String]: The cloud provider region.
|
45
|
-
# @param flags [Hash]: Optional flags
|
46
|
-
# @return [OpenStruct]: The cloud provider's complete descriptions of matching notification.
|
47
|
-
def self.find(cloud_id: nil, region: MU.curRegion, flags: {})
|
48
|
-
# Not implemented
|
49
|
-
# XXX well it fuckin' needs to be
|
50
|
-
end
|
51
|
-
|
52
|
-
# Cloud-specific configuration properties.
|
53
|
-
# @param config [MU::Config]: The calling MU::Config object
|
54
|
-
# @return [Array<Array,Hash>]: List of required fields, and json-schema Hash of cloud-specific configuration parameters for this resource
|
55
|
-
def self.schema(config)
|
56
|
-
toplevel_required = []
|
57
|
-
schema = {}
|
58
|
-
[toplevel_required, schema]
|
59
|
-
end
|
60
|
-
|
61
|
-
# Cloud-specific pre-processing of {MU::Config::BasketofKittens::notifications}, bare and unvalidated.
|
62
|
-
|
63
|
-
# XXX placeholder (notification is not a BoK primitive, is it?)
|
64
|
-
# @param notification [Hash]: The resource to process and validate
|
65
|
-
# @param configurator [MU::Config]: The overall deployment configurator of which this resource is a member
|
66
|
-
# @return [Boolean]: True if validation succeeded, False otherwise
|
67
|
-
def self.validateConfig(notification, configurator)
|
68
|
-
true
|
69
|
-
end
|
70
|
-
|
71
|
-
# Create a new notification group. Will check if the group exists before creating it.
|
72
|
-
# @param topic_name [String]: The cloud provider's name for the notification group.
|
73
|
-
# @param region [String]: The cloud provider region.
|
74
|
-
# @param account_number [String]: The cloud provider account number.
|
75
|
-
# @return [string]: The cloud provider's identifier.
|
76
|
-
def self.createTopic(topic_name, region: MU.curRegion, account_number: MU.account_number)
|
77
|
-
unless topicExist(topic_name, region: region, account_number: account_number)
|
78
|
-
MU::Cloud::AWS.sns(region).create_topic(name: topic_name).topic_arn
|
79
|
-
MU.log "Created SNS topic #{topic_name}"
|
80
|
-
end
|
81
|
-
topicExist(topic_name, region: region, account_number: account_number)
|
82
|
-
end
|
83
|
-
|
84
|
-
# Subscribe to a notification group. This can either be an email address, SQS queue, application endpoint, etc...
|
85
|
-
# Will create the subscription only if it doesn't already exist.
|
86
|
-
# @param arn [String]: The cloud provider's identifier of the notification group.
|
87
|
-
# @param protocol [String]: The type of the subscription (eg. email,https, etc..).
|
88
|
-
# @param endpoint [String]: The endpoint of the subscription. This will depend on the 'protocol' (as an example if protocol is email, endpoint will be the email address) ..
|
89
|
-
# @param region [String]: The cloud provider region.
|
90
|
-
def self.subscribe(arn: nil, protocol: nil, endpoint: nil, region: MU.curRegion)
|
91
|
-
retries = 0
|
92
|
-
begin
|
93
|
-
resp = MU::Cloud::AWS.sns(region).list_subscriptions_by_topic(topic_arn: arn).subscriptions
|
94
|
-
rescue Aws::SNS::Errors::NotFound
|
95
|
-
if retries < 5
|
96
|
-
MU.log "Couldn't find topic #{arn}, retrying several times in case of a lagging resource"
|
97
|
-
retries += 1
|
98
|
-
sleep 30
|
99
|
-
retry
|
100
|
-
else
|
101
|
-
raise MuError, "Couldn't find topic #{arn}, giving up"
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
already_subscribed = false
|
106
|
-
if resp && !resp.empty?
|
107
|
-
resp.each { |subscription|
|
108
|
-
already_subscribed = true if subscription.protocol == protocol && subscription.endpoint == endpoint
|
109
|
-
}
|
110
|
-
end
|
111
|
-
|
112
|
-
unless already_subscribed
|
113
|
-
MU::Cloud::AWS.sns(region).subscribe(topic_arn: arn, protocol: protocol, endpoint: endpoint)
|
114
|
-
MU.log "Subscribed #{endpoint} to SNS topic #{arn}"
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
# Test if a notification group exists
|
119
|
-
# Create a new notification group. Will check if the group exists before creating it.
|
120
|
-
# @param topic_name [String]: The cloud provider's name for the notification group.
|
121
|
-
# @param region [String]: The cloud provider region.
|
122
|
-
# @param account_number [String]: The cloud provider account number.
|
123
|
-
# @return [string]: The cloud provider's identifier.
|
124
|
-
def self.topicExist(topic_name, region: MU.curRegion, account_number: MU.account_number)
|
125
|
-
arn = "arn:#{MU::Cloud::AWS.isGovCloud?(region) ? "aws-us-gov" : "aws"}:sns:#{region}:#{account_number}:#{topic_name}"
|
126
|
-
match = nil
|
127
|
-
MU::Cloud::AWS.sns(region).list_topics.topics.each { |topic|
|
128
|
-
if topic.topic_arn == arn
|
129
|
-
match = topic.topic_arn
|
130
|
-
break
|
131
|
-
end
|
132
|
-
}
|
133
|
-
return match
|
134
|
-
end
|
135
|
-
|
136
|
-
end
|
137
|
-
end
|
138
|
-
end
|
139
|
-
end
|