piculet 0.2.6 → 0.2.7.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/bin/piculet +24 -15
- data/lib/piculet/client.rb +16 -0
- data/lib/piculet/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d9cafe5310dd7b6df5016c66c85dfc47f9a04c1
|
4
|
+
data.tar.gz: a261ba1ff4378fdf62dd876b90f57c71a0d56689
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1f778f163c7d3da3b924d9f9e313ca925b27d3967bd39549f2e405518067ea8681f43ef3cf3440f7ef1bfeeece5d1c8cb1c76d7276d22140d13ccbd4de0da19
|
7
|
+
data.tar.gz: 44f11549930395ba2ab2b28bbd035be43c1589b45ccf7b4369129ec96202cf555bcdd692b8e0f4b8581551fbd342b962f9661bea0975a3f0d899141f18807676
|
data/README.md
CHANGED
data/bin/piculet
CHANGED
@@ -29,21 +29,22 @@ ARGV.options do |opt|
|
|
29
29
|
profile_name = nil
|
30
30
|
credentials_path = nil
|
31
31
|
|
32
|
-
opt.on('-p', '--profile PROFILE_NAME')
|
33
|
-
opt.on('' , '--credentials-path PATH')
|
34
|
-
opt.on('-k', '--access-key ACCESS_KEY')
|
35
|
-
opt.on('-s', '--secret-key SECRET_KEY')
|
36
|
-
opt.on('-r', '--region REGION')
|
37
|
-
opt.on('-a', '--apply')
|
38
|
-
opt.on('-f', '--file FILE')
|
39
|
-
opt.on('-n', '--names SG_LIST', Array)
|
40
|
-
opt.on('',
|
41
|
-
opt.on('', '--
|
42
|
-
opt.on('
|
43
|
-
opt.on('-
|
44
|
-
opt.on('',
|
45
|
-
opt.on(''
|
46
|
-
opt.on('' , '--
|
32
|
+
opt.on('-p', '--profile PROFILE_NAME') {|v| profile_name = v }
|
33
|
+
opt.on('' , '--credentials-path PATH') {|v| credentials_path = v }
|
34
|
+
opt.on('-k', '--access-key ACCESS_KEY') {|v| access_key = v }
|
35
|
+
opt.on('-s', '--secret-key SECRET_KEY') {|v| secret_key = v }
|
36
|
+
opt.on('-r', '--region REGION') {|v| region = v }
|
37
|
+
opt.on('-a', '--apply') {|v| mode = :apply }
|
38
|
+
opt.on('-f', '--file FILE') {|v| file = v }
|
39
|
+
opt.on('-n', '--names SG_LIST', Array) {|v| options[:sg_names] = v }
|
40
|
+
opt.on('-x', '--exclude SG_LIST', Array) {|v| options[:exclude_sgs] = v }
|
41
|
+
opt.on('', '--ec2s VPC_IDS', Array) {|v| options[:ec2s] = v }
|
42
|
+
opt.on('', '--dry-run') {|v| options[:dry_run] = true }
|
43
|
+
opt.on('-e', '--export') {|v| mode = :export }
|
44
|
+
opt.on('-o', '--output FILE') {|v| output_file = v }
|
45
|
+
opt.on('', '--split') {|v| split = true }
|
46
|
+
opt.on('' , '--no-color') { options[:color] = false }
|
47
|
+
opt.on('' , '--debug') { options[:debug] = true }
|
47
48
|
opt.parse!
|
48
49
|
|
49
50
|
aws_opts = {}
|
@@ -65,6 +66,14 @@ ARGV.options do |opt|
|
|
65
66
|
|
66
67
|
aws_opts[:region] = region if region
|
67
68
|
AWS.config(aws_opts)
|
69
|
+
|
70
|
+
# Remap groups to exclude to regular expressions (if they're surrounded by '/')
|
71
|
+
if options[:exclude_sgs]
|
72
|
+
options[:exclude_sgs].map! do |name|
|
73
|
+
name =~ /\A\/(.*)\/\z/ ? Regexp.new($1) : Regexp.new("\A#{Regexp.escape(name)}\z")
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
68
77
|
rescue => e
|
69
78
|
$stderr.puts("[ERROR] #{e.message}")
|
70
79
|
exit 1
|
data/lib/piculet/client.rb
CHANGED
@@ -80,6 +80,10 @@ module Piculet
|
|
80
80
|
next unless @options.sg_names.include?(name)
|
81
81
|
end
|
82
82
|
|
83
|
+
if @options.exclude_sgs
|
84
|
+
next if @options.exclude_sgs.any? {|regex| name =~ regex}
|
85
|
+
end
|
86
|
+
|
83
87
|
sg_aws = sg_list_aws[key]
|
84
88
|
|
85
89
|
unless sg_aws
|
@@ -100,6 +104,10 @@ module Piculet
|
|
100
104
|
next unless @options.sg_names.include?(name)
|
101
105
|
end
|
102
106
|
|
107
|
+
if @options.exclude_sgs
|
108
|
+
next if @options.exclude_sgs.any? {|regex| name =~ regex}
|
109
|
+
end
|
110
|
+
|
103
111
|
sg_aws = sg_list_aws.delete(key)
|
104
112
|
walk_security_group(sg_dsl, sg_aws)
|
105
113
|
end
|
@@ -111,6 +119,10 @@ module Piculet
|
|
111
119
|
next unless @options.sg_names.include?(name)
|
112
120
|
end
|
113
121
|
|
122
|
+
if @options.exclude_sgs
|
123
|
+
next if @options.exclude_sgs.any? {|regex| name =~ regex}
|
124
|
+
end
|
125
|
+
|
114
126
|
sg_aws.ingress_ip_permissions.each {|i| i.delete }
|
115
127
|
sg_aws.egress_ip_permissions.each {|i| i.delete } if vpc
|
116
128
|
end
|
@@ -122,6 +134,10 @@ module Piculet
|
|
122
134
|
next unless @options.sg_names.include?(name)
|
123
135
|
end
|
124
136
|
|
137
|
+
if @options.exclude_sgs
|
138
|
+
next if @options.exclude_sgs.any? {|regex| name =~ regex}
|
139
|
+
end
|
140
|
+
|
125
141
|
sg_aws.delete
|
126
142
|
end
|
127
143
|
end
|
data/lib/piculet/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: piculet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- winebarrel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -146,9 +146,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: '0'
|
147
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
|
-
- - '
|
149
|
+
- - '>'
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version:
|
151
|
+
version: 1.3.1
|
152
152
|
requirements: []
|
153
153
|
rubyforge_project:
|
154
154
|
rubygems_version: 2.0.14
|