Commit graph

27 commits

Author SHA1 Message Date
CorbanR
42f54238e4 updating example, to be more consistent with parameter names 2014-05-30 15:57:55 -06:00
James Cammarata
713657d684 Make sure the default ec2_group egress rule is not removed
Upon a second run, the default egress rule will be removed when a
vpc is specified but no other egress rules were set. This patch
corrects that behavior by removing the default egress rule from the
list of unmatched outbound rules.

Fixes #7309
2014-05-07 20:52:03 -05:00
James Cammarata
1ef0402f03 Make sure a default allow out rule exists if no other egress rules do
Fixes #7027
2014-04-17 15:24:18 -05:00
willthames
509561f658 Moved AWS modules over to common module fragments
Created common module doc fragment, and applied to all
modules that use ec2_connect or connect_to_aws as
they definitely share the common doc fragments
2014-04-09 21:19:12 +10:00
Michael DeHaan
5b5ab78183 Add version_added to docs. 2014-03-28 13:51:22 -04:00
Maykel Moya
6a92d48b0f ec2_group: Document group_desc rule param 2014-03-21 08:35:25 +01:00
Maykel Moya
a429ff26dc ec2_group: Add documentation for rules_egress 2014-03-20 17:24:22 +01:00
Maykel Moya
b642e39e67 ec2_group: rules are not a required task argument 2014-03-20 17:24:22 +01:00
Maykel Moya
3156df9931 ec2_group: Request a fresh group object after creation
When a group is created, an egress_rule ALLOW ALL to 0.0.0.0/0 is added
automatically but it's not reflected in the object returned by the AWS API
call. After creation we re-read the group for getting an updated object.
2014-03-20 17:24:22 +01:00
Maykel Moya
649fcd3e1c ec2_group: Auto create missing groups referenced in rules
Suppose a pair of groups, A and B, depending on each other. One solution
for breaking the circular dependency at playbook level:

    - declare group A without dependencies
    - declare group B depending on A
    - declare group A depending on B

This patch breaks the dependency at module level. Whenever a depended-on
group is missing it's first created. This approach requires only two tasks:

    - declare group A depending on B (group B will be auto created)
    - declare group B depending on A

When creating a group EC2 requires you to pass the group description. In
order to fullfil this, rules now accept the `group_desc` param. Note
that group description can't be changed once the group is created so
it's nice to keep descriptions in sync.

Concrete example:

- ec2_group:
    name: mysql-client
    description: MySQL Client
    rules_egress:
      - proto: tcp
        from_port: 3306
        to_port: 3306
        group_name: mysql-server
        group_desc: MySQL Server

- ec2_group:
    name: mysql-server
    description: MySQL Server
    rules:
      - proto: tcp
        from_port: 3306
        to_port: 3306
        group_name: mysql-client
2014-03-20 17:24:17 +01:00
Maykel Moya
77d7165dde ec2_group: Deduplicate rule parsing/validation code 2014-03-20 16:19:35 +01:00
Maykel Moya
f97243d6ed ec2_group: Add support for handling egress rules 2014-03-20 15:50:08 +01:00
James Cammarata
8ca3bb4137 Updating profile/security_token version_added labels 2014-03-11 10:48:16 -05:00
Will Thames
b9a7352e0a Work to allow security tokens and profiles to work with Ansible
Allow security tokens and profiles to be used as arguments
to the 'common' ec2 modules

Mostly refactoring to provide two new methods,
`get_aws_connection_info`, which results in a dict that can be
passed through to the boto `connect_to_region` calls, and
`connect_to_aws` that can pass that dict through to the
`connect_to_region` method of the appropriate module.

Tidied up some variable names

Works around boto/boto#2100

profiles don't work with boto < 2.24, but this detects for that
and fails with an appropriate message. It is designed to work
if profile is not passed but boto < 2.24 is installed.

Modifications to allow empty aws auth variables to be passed
(this is useful if wanting to have the keys as an optional
parameter in ec2 calls - if set, use this value, if not set,
use boto config or env variables)

Reworked validate_certs improvements to work with refactoring

Added documentation for profile and security_token to affected modules
2014-03-06 16:28:30 +10:00
Patryk Zawadzki
da1efee21f Properly match existing security group
If we don't care about `vpc_id` then neither should the code.
2014-02-26 13:39:03 +01:00
James Cammarata
056d54ebd3 Adding 'validate_certs' option to EC2 modules
When disabled, the boto connection will be instantiated without validating
the SSL certificate from the target endpoint. This allows the modules to connect
to Eucalyptus instances running with self-signed certs without errors.

Fixes #3978
2014-02-13 12:32:49 -06:00
Will Thames
7600c664fe Create a common EC2 connection argument spec for EC2 modules
Refactor the currently well-factored ec2 modules (i.e. those that already use ec2_connect) to
have a common argument spec. The idea is that new modules can use this spec without duplication
of code, and that new functionality can be added to the ec2 connection code (e.g. security
token argument)
2014-02-06 15:27:41 +10:00
jctanner
821858ed08 Merge pull request #5380 from dhml/devel
ec2_group: rules can't reference containing group fix #5309
2014-01-27 11:41:21 -08:00
David Hummel
c5433d9742 Check for group_name and cidr_ip. 2013-12-23 15:57:47 -05:00
David Hummel
bd67c6756a Add rule group_name parameter whose value can reference containing group name. 2013-12-20 16:06:55 -05:00
willthames
12005a1cd0 Move more responsibility to common EC2 module
Moved `AWS_REGIONS` into `ec2` module
Created `ec2_connect` method in `ec2` module
Updated modules able to use `ec2_connect` and `AWS_REGIONS`
2013-12-17 14:07:24 +10:00
Michael DeHaan
f7c3975f21 Add version_added to all modules missing version_added information, the docs formatter will now
raise errors when omitted, updated changelog with new modules.
2013-11-18 18:55:49 -05:00
James Tanner
afa5988391 Fixes #4540 Use shared module snippet to evaluate ec2 credentials 2013-11-01 11:59:24 -04:00
Brian Schott
bdc8ea828e added aws_access_key and aws_secret_key aliases to ec2_group arguments 2013-10-17 15:23:24 -04:00
James Laska
e002496f0e Add idempotency support to ec2_group 2013-10-02 11:29:59 -04:00
James Cammarata
77b98df63b Minor fix, vpc_id is not required for the ec2_group 2013-08-19 11:38:06 -05:00
Andrew de Quincey
58e85855e4 Add module to control EC2 security groups 2013-08-19 11:38:06 -05:00