wombat-cli 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +23 -23
- data/.travis.yml +22 -27
- data/CHANGELOG.md +438 -423
- data/DESIGN.md +49 -49
- data/Gemfile +5 -5
- data/README.md +146 -146
- data/Rakefile +26 -26
- data/bin/wombat +24 -24
- data/generator_files/Vagrantfile +120 -120
- data/generator_files/cookbooks/automate/.gitignore +16 -16
- data/generator_files/cookbooks/automate/.kitchen.ec2.yml +34 -34
- data/generator_files/cookbooks/automate/.kitchen.yml +24 -24
- data/generator_files/cookbooks/automate/Berksfile +6 -6
- data/generator_files/cookbooks/automate/README.md +4 -4
- data/generator_files/cookbooks/automate/chefignore +102 -102
- data/generator_files/cookbooks/automate/libraries/_helper.rb +52 -52
- data/generator_files/cookbooks/automate/libraries/delivery_api.rb +204 -204
- data/generator_files/cookbooks/automate/libraries/delivery_project.rb +31 -31
- data/generator_files/cookbooks/automate/libraries/dsl.rb +4 -4
- data/generator_files/cookbooks/automate/metadata.rb +11 -11
- data/generator_files/cookbooks/automate/recipes/default.rb +118 -124
- data/generator_files/cookbooks/automate/recipes/update-users.rb +48 -48
- data/generator_files/cookbooks/automate/templates/delivery.erb +6 -6
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/metadata.rb +3 -3
- data/generator_files/cookbooks/automate/test/fixtures/cookbooks/mock_data/recipes/default.rb +27 -27
- data/generator_files/cookbooks/automate/test/integration/default/automate_spec.rb +56 -56
- data/generator_files/cookbooks/build_node/.gitignore +16 -16
- data/generator_files/cookbooks/build_node/.kitchen.ec2.yml +37 -37
- data/generator_files/cookbooks/build_node/.kitchen.yml +23 -23
- data/generator_files/cookbooks/build_node/Berksfile +8 -8
- data/generator_files/cookbooks/build_node/README.md +4 -4
- data/generator_files/cookbooks/build_node/chefignore +102 -102
- data/generator_files/cookbooks/build_node/metadata.rb +12 -12
- data/generator_files/cookbooks/build_node/recipes/default.rb +38 -38
- data/generator_files/cookbooks/build_node/templates/client.erb +2 -2
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/metadata.rb +2 -2
- data/generator_files/cookbooks/build_node/test/fixtures/cookbooks/mock_data/recipes/default.rb +18 -18
- data/generator_files/cookbooks/build_node/test/integration/default/build-node_spec.rb +40 -40
- data/generator_files/cookbooks/chef_server/.gitignore +16 -16
- data/generator_files/cookbooks/chef_server/.kitchen.ec2.yml +34 -34
- data/generator_files/cookbooks/chef_server/.kitchen.yml +24 -24
- data/generator_files/cookbooks/chef_server/Berksfile +6 -6
- data/generator_files/cookbooks/chef_server/README.md +4 -4
- data/generator_files/cookbooks/chef_server/chefignore +102 -102
- data/generator_files/cookbooks/chef_server/metadata.rb +11 -11
- data/generator_files/cookbooks/chef_server/recipes/bootstrap_users.rb +91 -91
- data/generator_files/cookbooks/chef_server/recipes/default.rb +113 -113
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/metadata.rb +2 -2
- data/generator_files/cookbooks/chef_server/test/fixtures/cookbooks/mock_data/recipes/default.rb +23 -23
- data/generator_files/cookbooks/chef_server/test/integration/default/chef_server_spec.rb +50 -50
- data/generator_files/cookbooks/compliance/.gitignore +16 -16
- data/generator_files/cookbooks/compliance/.kitchen.ec2.yml +34 -34
- data/generator_files/cookbooks/compliance/.kitchen.yml +24 -24
- data/generator_files/cookbooks/compliance/Berksfile +7 -7
- data/generator_files/cookbooks/compliance/README.md +4 -4
- data/generator_files/cookbooks/compliance/chefignore +102 -102
- data/generator_files/cookbooks/compliance/metadata.rb +11 -11
- data/generator_files/cookbooks/compliance/recipes/default.rb +57 -57
- data/generator_files/cookbooks/compliance/spec/spec_helper.rb +2 -2
- data/generator_files/cookbooks/compliance/spec/unit/recipes/default_spec.rb +20 -20
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/metadata.rb +4 -4
- data/generator_files/cookbooks/compliance/test/fixtures/cookbooks/mock_data/recipes/default.rb +21 -21
- data/generator_files/cookbooks/compliance/test/integration/default/compliance.rb +28 -28
- data/generator_files/cookbooks/infranodes/.gitignore +16 -16
- data/generator_files/cookbooks/infranodes/.kitchen.ec2.yml +48 -48
- data/generator_files/cookbooks/infranodes/.kitchen.yml +21 -21
- data/generator_files/cookbooks/infranodes/Berksfile +6 -6
- data/generator_files/cookbooks/infranodes/README.md +4 -4
- data/generator_files/cookbooks/infranodes/attributes/default.rb +2 -2
- data/generator_files/cookbooks/infranodes/chefignore +102 -102
- data/generator_files/cookbooks/infranodes/metadata.rb +13 -13
- data/generator_files/cookbooks/infranodes/recipes/default.rb +57 -57
- data/generator_files/cookbooks/infranodes/spec/spec_helper.rb +2 -2
- data/generator_files/cookbooks/infranodes/spec/unit/recipes/default_spec.rb +20 -20
- data/generator_files/cookbooks/infranodes/templates/default/client.rb.erb +5 -5
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/chef.crt +25 -25
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/metadata.rb +3 -3
- data/generator_files/cookbooks/infranodes/test/fixtures/cookbooks/mock_data/recipes/default.rb +27 -27
- data/generator_files/cookbooks/infranodes/test/integration/default/infranodes_spec.rb +22 -22
- data/generator_files/cookbooks/infranodes/test/integration/helpers/serverspec/spec_helper.rb +8 -8
- data/generator_files/cookbooks/wombat/.gitignore +16 -16
- data/generator_files/cookbooks/wombat/.kitchen.yml +43 -43
- data/generator_files/cookbooks/wombat/Berksfile +5 -5
- data/generator_files/cookbooks/wombat/README.md +4 -4
- data/generator_files/cookbooks/wombat/attributes/default.rb +79 -80
- data/generator_files/cookbooks/wombat/attributes/packer.rb +18 -18
- data/generator_files/cookbooks/wombat/chefignore +102 -102
- data/generator_files/cookbooks/wombat/metadata.rb +13 -13
- data/generator_files/cookbooks/wombat/recipes/authorized-keys.rb +20 -20
- data/generator_files/cookbooks/wombat/recipes/default.rb +111 -111
- data/generator_files/cookbooks/wombat/recipes/etc-hosts.rb +51 -51
- data/generator_files/cookbooks/workstation/.gitignore +16 -16
- data/generator_files/cookbooks/workstation/.kitchen.azure.yml +45 -0
- data/generator_files/cookbooks/workstation/.kitchen.ec2.yml +46 -30
- data/generator_files/cookbooks/workstation/.kitchen.yml +42 -22
- data/generator_files/cookbooks/workstation/Berksfile +7 -7
- data/generator_files/cookbooks/workstation/README.md +3 -3
- data/generator_files/cookbooks/workstation/chefignore +106 -102
- data/generator_files/cookbooks/workstation/files/atom.apm.list +10 -7
- data/generator_files/cookbooks/workstation/files/atom.config.cson +6 -3
- data/generator_files/cookbooks/workstation/{templates/default/ise_profile.ps1.erb → files/ise_profile.ps1} +11 -11
- data/generator_files/cookbooks/workstation/libraries/home.rb +4 -4
- data/generator_files/cookbooks/workstation/metadata.rb +14 -14
- data/generator_files/cookbooks/workstation/recipes/browser.rb +53 -58
- data/generator_files/cookbooks/workstation/recipes/certs-keys.rb +41 -45
- data/generator_files/cookbooks/workstation/recipes/chef.rb +29 -28
- data/generator_files/cookbooks/workstation/recipes/default.rb +24 -21
- data/generator_files/cookbooks/workstation/recipes/dotnet.rb +19 -17
- data/generator_files/cookbooks/workstation/recipes/editor.rb +46 -18
- data/generator_files/cookbooks/workstation/recipes/profile.rb +14 -41
- data/generator_files/cookbooks/workstation/recipes/terminal.rb +11 -11
- data/generator_files/cookbooks/workstation/templates/default/bookmarks.html.erb +23 -23
- data/generator_files/cookbooks/workstation/templates/default/data_collector.rb.erb +2 -2
- data/generator_files/cookbooks/workstation/templates/default/knife.rb.erb +10 -10
- data/generator_files/cookbooks/workstation/templates/default/master_preferences.json.erb +28 -28
- data/generator_files/cookbooks/workstation/templates/default/ssh_config.erb +16 -16
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/automate.crt +26 -26
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/automate.key +27 -27
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/chef.crt +26 -26
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/chef.key +27 -27
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/compliance.crt +26 -26
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/compliance.key +27 -27
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/private.pem +27 -27
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/files/public.pub +1 -1
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/metadata.rb +2 -2
- data/generator_files/cookbooks/workstation/test/fixtures/cookbooks/mock_data/recipes/default.rb +21 -21
- data/generator_files/cookbooks/workstation/test/integration/default/workstation_spec.rb +77 -37
- data/generator_files/packer/automate.json +136 -136
- data/generator_files/packer/build-node.json +142 -142
- data/generator_files/packer/chef-server.json +137 -137
- data/generator_files/packer/compliance.json +133 -133
- data/generator_files/packer/infranodes-windows.json +143 -143
- data/generator_files/packer/infranodes.json +134 -134
- data/generator_files/packer/scripts/PreSysprep.ps1 +9 -0
- data/generator_files/packer/workstation.json +160 -142
- data/generator_files/templates/arm.md.json.erb +754 -754
- data/generator_files/templates/arm.vhd.json.erb +630 -630
- data/generator_files/templates/bootstrap-aws.erb +39 -39
- data/generator_files/templates/cfn.json.erb +675 -674
- data/generator_files/wombat.yml +75 -74
- data/lib/wombat/aws.rb +67 -67
- data/lib/wombat/build.rb +392 -392
- data/lib/wombat/cli.rb +254 -254
- data/lib/wombat/common.rb +420 -420
- data/lib/wombat/crypto.rb +65 -65
- data/lib/wombat/delete.rb +67 -67
- data/lib/wombat/deploy.rb +128 -128
- data/lib/wombat/init.rb +32 -32
- data/lib/wombat/latest.rb +27 -27
- data/lib/wombat/output.rb +101 -101
- data/lib/wombat/update.rb +20 -20
- data/lib/wombat/version.rb +3 -3
- data/lib/wombat.rb +8 -8
- data/spec/functional/common_spec.rb +26 -26
- data/spec/spec_helper.rb +103 -103
- data/spec/unit/common_spec.rb +116 -116
- data/terraform/README.md +13 -13
- data/terraform/templates/terraform.tfvars.erb +12 -12
- data/terraform/wombat.tf +328 -328
- data/wombat-cli.gemspec +36 -36
- metadata +6 -4
data/lib/wombat/output.rb
CHANGED
@@ -1,101 +1,101 @@
|
|
1
|
-
require 'wombat/common'
|
2
|
-
require 'aws-sdk'
|
3
|
-
require 'azure_mgmt_network'
|
4
|
-
|
5
|
-
module Wombat
|
6
|
-
class OutputRunner
|
7
|
-
include Wombat::Common
|
8
|
-
|
9
|
-
attr_reader :stack, :cloud
|
10
|
-
attr_accessor :network_management_client
|
11
|
-
|
12
|
-
def initialize(opts)
|
13
|
-
@stack = opts.stack
|
14
|
-
@cloud = opts.cloud.nil? ? "aws" : opts.cloud
|
15
|
-
end
|
16
|
-
|
17
|
-
def start
|
18
|
-
|
19
|
-
# Get the IP addresses for the workstations
|
20
|
-
case cloud
|
21
|
-
when "aws"
|
22
|
-
cfn_workstation_ips(stack)
|
23
|
-
when "azure"
|
24
|
-
azure_workstation_ips(stack)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
private
|
29
|
-
|
30
|
-
def cfn_workstation_ips(stack)
|
31
|
-
ec2 = ::Aws::EC2::Resource.new
|
32
|
-
instances = cfn_stack_instances(stack)
|
33
|
-
instances.each do |name, id|
|
34
|
-
instance = ec2.instance(id)
|
35
|
-
if /Workstation/.match(name)
|
36
|
-
puts "#{name} (#{id}) => #{instance.public_ip_address}"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def cfn_stack_instances(stack)
|
42
|
-
cfn = ::Aws::CloudFormation::Client.new
|
43
|
-
resp = cfn.describe_stack_resources({
|
44
|
-
stack_name: stack
|
45
|
-
})
|
46
|
-
|
47
|
-
instances = {}
|
48
|
-
resp.stack_resources.map do |resource|
|
49
|
-
if resource.resource_type == 'AWS::EC2::Instance'
|
50
|
-
instances[resource.logical_resource_id] = resource.physical_resource_id
|
51
|
-
end
|
52
|
-
end
|
53
|
-
instances
|
54
|
-
end
|
55
|
-
|
56
|
-
def azure_workstation_ips(stack)
|
57
|
-
|
58
|
-
# Connect to Azure
|
59
|
-
azure_conn = connect_azure()
|
60
|
-
|
61
|
-
# Create a resource client so that the resource groups can be interrogated
|
62
|
-
resource_management_client = Azure::ARM::Resources::ResourceManagementClient.new(azure_conn)
|
63
|
-
resource_management_client.subscription_id = ENV['AZURE_SUBSCRIPTION_ID']
|
64
|
-
|
65
|
-
# Create a resource client so that the template can be deployed
|
66
|
-
@network_management_client = Azure::ARM::Network::NetworkManagementClient.new(azure_conn)
|
67
|
-
network_management_client.subscription_id = ENV['AZURE_SUBSCRIPTION_ID']
|
68
|
-
|
69
|
-
# Return a list of all the resource groups that begin with the stack name
|
70
|
-
resource_groups = resource_management_client.resource_groups.list()
|
71
|
-
|
72
|
-
# filter the resource groups looking for thos that start with the stack name
|
73
|
-
filtered_groups = resource_groups.select { |n| n.name.start_with?(stack) }
|
74
|
-
|
75
|
-
# iterate around the filtered resource groups idenfitying the public_ipaddresses in the group
|
76
|
-
filtered_groups.each do |group|
|
77
|
-
|
78
|
-
# Obtain a list of all the Public IP addresses in the stack
|
79
|
-
public_ip_addresses = network_management_client.public_ipaddresses.list(group.name)
|
80
|
-
|
81
|
-
banner(format("Public IP Addresses in '%s'", group.name))
|
82
|
-
|
83
|
-
# Check that there are IP addresses in the stack
|
84
|
-
if public_ip_addresses.length == 0
|
85
|
-
|
86
|
-
warn('No public IP addresses')
|
87
|
-
|
88
|
-
else
|
89
|
-
|
90
|
-
# Iterate around the public IP addresses and output each one
|
91
|
-
public_ip_addresses.each do |public_ip_address|
|
92
|
-
|
93
|
-
# Output the details about the IP address
|
94
|
-
puts format("%s:\t%s (%s)", public_ip_address.name, public_ip_address.ip_address, public_ip_address.dns_settings.fqdn)
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
1
|
+
require 'wombat/common'
|
2
|
+
require 'aws-sdk'
|
3
|
+
require 'azure_mgmt_network'
|
4
|
+
|
5
|
+
module Wombat
|
6
|
+
class OutputRunner
|
7
|
+
include Wombat::Common
|
8
|
+
|
9
|
+
attr_reader :stack, :cloud
|
10
|
+
attr_accessor :network_management_client
|
11
|
+
|
12
|
+
def initialize(opts)
|
13
|
+
@stack = opts.stack
|
14
|
+
@cloud = opts.cloud.nil? ? "aws" : opts.cloud
|
15
|
+
end
|
16
|
+
|
17
|
+
def start
|
18
|
+
|
19
|
+
# Get the IP addresses for the workstations
|
20
|
+
case cloud
|
21
|
+
when "aws"
|
22
|
+
cfn_workstation_ips(stack)
|
23
|
+
when "azure"
|
24
|
+
azure_workstation_ips(stack)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def cfn_workstation_ips(stack)
|
31
|
+
ec2 = ::Aws::EC2::Resource.new
|
32
|
+
instances = cfn_stack_instances(stack)
|
33
|
+
instances.each do |name, id|
|
34
|
+
instance = ec2.instance(id)
|
35
|
+
if /Workstation/.match(name)
|
36
|
+
puts "#{name} (#{id}) => #{instance.public_ip_address}"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def cfn_stack_instances(stack)
|
42
|
+
cfn = ::Aws::CloudFormation::Client.new
|
43
|
+
resp = cfn.describe_stack_resources({
|
44
|
+
stack_name: stack
|
45
|
+
})
|
46
|
+
|
47
|
+
instances = {}
|
48
|
+
resp.stack_resources.map do |resource|
|
49
|
+
if resource.resource_type == 'AWS::EC2::Instance'
|
50
|
+
instances[resource.logical_resource_id] = resource.physical_resource_id
|
51
|
+
end
|
52
|
+
end
|
53
|
+
instances
|
54
|
+
end
|
55
|
+
|
56
|
+
def azure_workstation_ips(stack)
|
57
|
+
|
58
|
+
# Connect to Azure
|
59
|
+
azure_conn = connect_azure()
|
60
|
+
|
61
|
+
# Create a resource client so that the resource groups can be interrogated
|
62
|
+
resource_management_client = Azure::ARM::Resources::ResourceManagementClient.new(azure_conn)
|
63
|
+
resource_management_client.subscription_id = ENV['AZURE_SUBSCRIPTION_ID']
|
64
|
+
|
65
|
+
# Create a resource client so that the template can be deployed
|
66
|
+
@network_management_client = Azure::ARM::Network::NetworkManagementClient.new(azure_conn)
|
67
|
+
network_management_client.subscription_id = ENV['AZURE_SUBSCRIPTION_ID']
|
68
|
+
|
69
|
+
# Return a list of all the resource groups that begin with the stack name
|
70
|
+
resource_groups = resource_management_client.resource_groups.list()
|
71
|
+
|
72
|
+
# filter the resource groups looking for thos that start with the stack name
|
73
|
+
filtered_groups = resource_groups.select { |n| n.name.start_with?(stack) }
|
74
|
+
|
75
|
+
# iterate around the filtered resource groups idenfitying the public_ipaddresses in the group
|
76
|
+
filtered_groups.each do |group|
|
77
|
+
|
78
|
+
# Obtain a list of all the Public IP addresses in the stack
|
79
|
+
public_ip_addresses = network_management_client.public_ipaddresses.list(group.name)
|
80
|
+
|
81
|
+
banner(format("Public IP Addresses in '%s'", group.name))
|
82
|
+
|
83
|
+
# Check that there are IP addresses in the stack
|
84
|
+
if public_ip_addresses.length == 0
|
85
|
+
|
86
|
+
warn('No public IP addresses')
|
87
|
+
|
88
|
+
else
|
89
|
+
|
90
|
+
# Iterate around the public IP addresses and output each one
|
91
|
+
public_ip_addresses.each do |public_ip_address|
|
92
|
+
|
93
|
+
# Output the details about the IP address
|
94
|
+
puts format("%s:\t%s (%s)", public_ip_address.name, public_ip_address.ip_address, public_ip_address.dns_settings.fqdn)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
data/lib/wombat/update.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
require 'wombat/common'
|
2
|
-
|
3
|
-
module Wombat
|
4
|
-
class UpdateRunner
|
5
|
-
include Wombat::Common
|
6
|
-
|
7
|
-
attr_reader :cloud, :update_file
|
8
|
-
|
9
|
-
def initialize(opts)
|
10
|
-
@cloud = opts.cloud.nil? ? "aws" : opts.cloud
|
11
|
-
@update_file = opts.file.nil? ? "all" : opts.file
|
12
|
-
@wombat_yml = opts.wombat_yml
|
13
|
-
end
|
14
|
-
|
15
|
-
def start
|
16
|
-
update_lock(cloud) if /(all|lock)/.match(update_file)
|
17
|
-
update_template(cloud) if /(all|template)/.match(update_file)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
1
|
+
require 'wombat/common'
|
2
|
+
|
3
|
+
module Wombat
|
4
|
+
class UpdateRunner
|
5
|
+
include Wombat::Common
|
6
|
+
|
7
|
+
attr_reader :cloud, :update_file
|
8
|
+
|
9
|
+
def initialize(opts)
|
10
|
+
@cloud = opts.cloud.nil? ? "aws" : opts.cloud
|
11
|
+
@update_file = opts.file.nil? ? "all" : opts.file
|
12
|
+
@wombat_yml = opts.wombat_yml
|
13
|
+
end
|
14
|
+
|
15
|
+
def start
|
16
|
+
update_lock(cloud) if /(all|lock)/.match(update_file)
|
17
|
+
update_template(cloud) if /(all|template)/.match(update_file)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/wombat/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module Wombat
|
2
|
-
VERSION = "0.6.
|
3
|
-
end
|
1
|
+
module Wombat
|
2
|
+
VERSION = "0.6.2"
|
3
|
+
end
|
data/lib/wombat.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
|
2
|
-
require 'wombat/common'
|
3
|
-
require 'wombat/cli'
|
4
|
-
require 'wombat/delete'
|
5
|
-
require 'wombat/build'
|
6
|
-
require 'wombat/deploy'
|
7
|
-
require 'wombat/output'
|
8
|
-
require 'wombat/version'
|
1
|
+
|
2
|
+
require 'wombat/common'
|
3
|
+
require 'wombat/cli'
|
4
|
+
require 'wombat/delete'
|
5
|
+
require 'wombat/build'
|
6
|
+
require 'wombat/deploy'
|
7
|
+
require 'wombat/output'
|
8
|
+
require 'wombat/version'
|
@@ -1,26 +1,26 @@
|
|
1
|
-
require "wombat/common"
|
2
|
-
require "yaml"
|
3
|
-
|
4
|
-
describe "Common" do
|
5
|
-
let(:common) do
|
6
|
-
klass = Class.new { include Wombat::Common }
|
7
|
-
|
8
|
-
return klass.new
|
9
|
-
end
|
10
|
-
|
11
|
-
describe "#wombat" do
|
12
|
-
it "reads a configuration file" do
|
13
|
-
wombat_yml = File.join(
|
14
|
-
File.expand_path("../..", File.dirname(__FILE__)),
|
15
|
-
"generator_files",
|
16
|
-
"wombat.yml"
|
17
|
-
)
|
18
|
-
|
19
|
-
stub_const("ENV", {"WOMBAT_YML" => wombat_yml})
|
20
|
-
|
21
|
-
content = common.wombat
|
22
|
-
|
23
|
-
expect(content["name"]).to eq("wombat")
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
1
|
+
require "wombat/common"
|
2
|
+
require "yaml"
|
3
|
+
|
4
|
+
describe "Common" do
|
5
|
+
let(:common) do
|
6
|
+
klass = Class.new { include Wombat::Common }
|
7
|
+
|
8
|
+
return klass.new
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "#wombat" do
|
12
|
+
it "reads a configuration file" do
|
13
|
+
wombat_yml = File.join(
|
14
|
+
File.expand_path("../..", File.dirname(__FILE__)),
|
15
|
+
"generator_files",
|
16
|
+
"wombat.yml"
|
17
|
+
)
|
18
|
+
|
19
|
+
stub_const("ENV", {"WOMBAT_YML" => wombat_yml})
|
20
|
+
|
21
|
+
content = common.wombat
|
22
|
+
|
23
|
+
expect(content["name"]).to eq("wombat")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,103 +1,103 @@
|
|
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
|
-
# The `.rspec` file also contains a few flags that are not defaults but that
|
16
|
-
# users commonly want.
|
17
|
-
#
|
18
|
-
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
19
|
-
RSpec.configure do |config|
|
20
|
-
# rspec-expectations config goes here. You can use an alternate
|
21
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
22
|
-
# assertions if you prefer.
|
23
|
-
config.expect_with :rspec do |expectations|
|
24
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
25
|
-
# and `failure_message` of custom matchers include text for helper methods
|
26
|
-
# defined using `chain`, e.g.:
|
27
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
28
|
-
# # => "be bigger than 2 and smaller than 4"
|
29
|
-
# ...rather than:
|
30
|
-
# # => "be bigger than 2"
|
31
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
32
|
-
end
|
33
|
-
|
34
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
35
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
36
|
-
config.mock_with :rspec do |mocks|
|
37
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
38
|
-
# a real object. This is generally recommended, and will default to
|
39
|
-
# `true` in RSpec 4.
|
40
|
-
mocks.verify_partial_doubles = true
|
41
|
-
end
|
42
|
-
|
43
|
-
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
44
|
-
# have no way to turn it off -- the option exists only for backwards
|
45
|
-
# compatibility in RSpec 3). It causes shared context metadata to be
|
46
|
-
# inherited by the metadata hash of host groups and examples, rather than
|
47
|
-
# triggering implicit auto-inclusion in groups with matching metadata.
|
48
|
-
config.shared_context_metadata_behavior = :apply_to_host_groups
|
49
|
-
|
50
|
-
# The settings below are suggested to provide a good initial experience
|
51
|
-
# with RSpec, but feel free to customize to your heart's content.
|
52
|
-
=begin
|
53
|
-
# This allows you to limit a spec run to individual examples or groups
|
54
|
-
# you care about by tagging them with `:focus` metadata. When nothing
|
55
|
-
# is tagged with `:focus`, all examples get run. RSpec also provides
|
56
|
-
# aliases for `it`, `describe`, and `context` that include `:focus`
|
57
|
-
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
58
|
-
config.filter_run_when_matching :focus
|
59
|
-
|
60
|
-
# Allows RSpec to persist some state between runs in order to support
|
61
|
-
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
62
|
-
# you configure your source control system to ignore this file.
|
63
|
-
config.example_status_persistence_file_path = "spec/examples.txt"
|
64
|
-
|
65
|
-
# Limits the available syntax to the non-monkey patched syntax that is
|
66
|
-
# recommended. For more details, see:
|
67
|
-
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
68
|
-
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
69
|
-
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
70
|
-
config.disable_monkey_patching!
|
71
|
-
|
72
|
-
# This setting enables warnings. It's recommended, but in some cases may
|
73
|
-
# be too noisy due to issues in dependencies.
|
74
|
-
config.warnings = true
|
75
|
-
|
76
|
-
# Many RSpec users commonly either run the entire suite or an individual
|
77
|
-
# file, and it's useful to allow more verbose output when running an
|
78
|
-
# individual spec file.
|
79
|
-
if config.files_to_run.one?
|
80
|
-
# Use the documentation formatter for detailed output,
|
81
|
-
# unless a formatter has already been configured
|
82
|
-
# (e.g. via a command-line flag).
|
83
|
-
config.default_formatter = 'doc'
|
84
|
-
end
|
85
|
-
|
86
|
-
# Print the 10 slowest examples and example groups at the
|
87
|
-
# end of the spec run, to help surface which specs are running
|
88
|
-
# particularly slow.
|
89
|
-
config.profile_examples = 10
|
90
|
-
|
91
|
-
# Run specs in random order to surface order dependencies. If you find an
|
92
|
-
# order dependency and want to debug it, you can fix the order by providing
|
93
|
-
# the seed, which is printed after each run.
|
94
|
-
# --seed 1234
|
95
|
-
config.order = :random
|
96
|
-
|
97
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
98
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
99
|
-
# test failures related to randomization by passing the same `--seed` value
|
100
|
-
# as the one that triggered the failure.
|
101
|
-
Kernel.srand config.seed
|
102
|
-
=end
|
103
|
-
end
|
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
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
16
|
+
# users commonly want.
|
17
|
+
#
|
18
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
19
|
+
RSpec.configure do |config|
|
20
|
+
# rspec-expectations config goes here. You can use an alternate
|
21
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
22
|
+
# assertions if you prefer.
|
23
|
+
config.expect_with :rspec do |expectations|
|
24
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
25
|
+
# and `failure_message` of custom matchers include text for helper methods
|
26
|
+
# defined using `chain`, e.g.:
|
27
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
28
|
+
# # => "be bigger than 2 and smaller than 4"
|
29
|
+
# ...rather than:
|
30
|
+
# # => "be bigger than 2"
|
31
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
32
|
+
end
|
33
|
+
|
34
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
35
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
36
|
+
config.mock_with :rspec do |mocks|
|
37
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
38
|
+
# a real object. This is generally recommended, and will default to
|
39
|
+
# `true` in RSpec 4.
|
40
|
+
mocks.verify_partial_doubles = true
|
41
|
+
end
|
42
|
+
|
43
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
44
|
+
# have no way to turn it off -- the option exists only for backwards
|
45
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
46
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
47
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
48
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
49
|
+
|
50
|
+
# The settings below are suggested to provide a good initial experience
|
51
|
+
# with RSpec, but feel free to customize to your heart's content.
|
52
|
+
=begin
|
53
|
+
# This allows you to limit a spec run to individual examples or groups
|
54
|
+
# you care about by tagging them with `:focus` metadata. When nothing
|
55
|
+
# is tagged with `:focus`, all examples get run. RSpec also provides
|
56
|
+
# aliases for `it`, `describe`, and `context` that include `:focus`
|
57
|
+
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
58
|
+
config.filter_run_when_matching :focus
|
59
|
+
|
60
|
+
# Allows RSpec to persist some state between runs in order to support
|
61
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
62
|
+
# you configure your source control system to ignore this file.
|
63
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
64
|
+
|
65
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
66
|
+
# recommended. For more details, see:
|
67
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
68
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
69
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
70
|
+
config.disable_monkey_patching!
|
71
|
+
|
72
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
73
|
+
# be too noisy due to issues in dependencies.
|
74
|
+
config.warnings = true
|
75
|
+
|
76
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
77
|
+
# file, and it's useful to allow more verbose output when running an
|
78
|
+
# individual spec file.
|
79
|
+
if config.files_to_run.one?
|
80
|
+
# Use the documentation formatter for detailed output,
|
81
|
+
# unless a formatter has already been configured
|
82
|
+
# (e.g. via a command-line flag).
|
83
|
+
config.default_formatter = 'doc'
|
84
|
+
end
|
85
|
+
|
86
|
+
# Print the 10 slowest examples and example groups at the
|
87
|
+
# end of the spec run, to help surface which specs are running
|
88
|
+
# particularly slow.
|
89
|
+
config.profile_examples = 10
|
90
|
+
|
91
|
+
# Run specs in random order to surface order dependencies. If you find an
|
92
|
+
# order dependency and want to debug it, you can fix the order by providing
|
93
|
+
# the seed, which is printed after each run.
|
94
|
+
# --seed 1234
|
95
|
+
config.order = :random
|
96
|
+
|
97
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
98
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
99
|
+
# test failures related to randomization by passing the same `--seed` value
|
100
|
+
# as the one that triggered the failure.
|
101
|
+
Kernel.srand config.seed
|
102
|
+
=end
|
103
|
+
end
|