-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a security_groups container to dsl/compute, and changed provide…
…rs to respect both cloud defined and compute defined security groups.
- Loading branch information
Chris Howe
committed
Jan 16, 2014
1 parent
610cf62
commit c72a466
Showing
9 changed files
with
134 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module Ironfan | ||
class Dsl | ||
class SecurityGroup < Ironfan::Dsl | ||
field :name, String | ||
field :group_authorized, Array, :default => [] | ||
field :group_authorized_by, Array, :default => [] | ||
field :range_authorizations, Array, :default => [] | ||
|
||
def authorize_port_range(range, cidr_ip = '0.0.0.0/0', ip_protocol = 'tcp') | ||
range = (range .. range) if range.is_a?(Integer) | ||
range_authorizations << [range, cidr_ip, ip_protocol] | ||
range_authorizations.compact! | ||
range_authorizations.uniq! | ||
end | ||
|
||
def authorized_by_group(other_name) | ||
group_authorized_by << other_name.to_s | ||
group_authorized_by.compact! | ||
group_authorized_by.uniq! | ||
end | ||
|
||
def authorize_group(other_name) | ||
group_authorized << other_name.to_s | ||
group_authorized.compact! | ||
group_authorized.uniq! | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters