New module - elastic_beanstalk #789

Closed
wants to merge 4 commits into
from

Projects

None yet

9 participants

@adisharoon-socialware

A new module for creating, terminating, and restarting AWS Elastic Beanstalk environments, including support for blue-green deployments using CNAME swapping.

@robynbergeron
Contributor

Hi @adisharoon-socialware -- copying in new process info here. We will be evaluating all new module PRs according to this process, effective immediately.

Thanks for submitting this new module to Ansible Extras! This module is now in community review, a process that is open to all Ansible users. In order for this module to be approved, it must gain the following votes:

“works_for_me”: If you have tested the module thoroughly, including testing of all of the module’s options, and if the module works for you, please add “works_for_me” in the comments.

“passes_guidelines”: If you have gone through the module guidelines and the module meets all of the requirements, please add “passes_guidelines” in the comments. Guidelines are available here: http://docs.ansible.com/developing_modules.html#module-checklist

“needs_revision”: If the module fails to work for you, or if it doesn’t meet guidelines, please add “needs_revision” in the comments with details about what needs to be fixed.

When a module has both “works_for_me” and “passes_guidelines” tags, we will promote the module for inclusion in Ansible Extras. At this point, you will be expected to maintain the module by fixing bugs and evaluating pull requests in a timely manner.

Thanks again for submitting your Ansible module!

@gregdek gregdek removed the core_review label Oct 5, 2015
@Yanchek99

+1 For this module

@noqcks
noqcks commented Dec 31, 2015

Im hitting an error when testing.

command is:

hacking/test-module -m lib/ansible/modules/extras/cloud/amazon/elastic_beanstalk.py -a "state=\"present\" application_name=\"testing\""

output is:

* including generated source, if any, saving to: /Users/benvisser/.ansible_module_generated
* this may offset any line numbers in tracebacks/debuggers!
***********************************
RAW OUTPUT
{"msg": "Solution stack 'None' is not in the list of available solution stacks.", "failed": true, "invocation": {"profile": null, "aws_secret_key": null, "aws_access_key": null, "security_token": null, "solution_stack": null, "application_s3_key": null, "validate_certs": true, "region": null, "environment_name": "JAYOemVGdh", "redeploy": false, "environment_options": null, "state": "present", "cname": "74pLpksliP", "ec2_url": null, "application_name": "testing", "application_s3_bucket": null, "application_version": null}}


***********************************
PARSED OUTPUT
{
    "failed": true, 
    "invocation": {
        "application_name": "testing", 
        "application_s3_bucket": null, 
        "application_s3_key": null, 
        "application_version": null, 
        "aws_access_key": null, 
        "aws_secret_key": null, 
        "cname": "74pLpksliP", 
        "ec2_url": null, 
        "environment_name": "JAYOemVGdh", 
        "environment_options": null, 
        "profile": null, 
        "redeploy": false, 
        "region": null, 
        "security_token": null, 
        "solution_stack": null, 
        "state": "present", 
        "validate_certs": true
    }, 
    "msg": "Solution stack 'None' is not in the list of available solution stacks."
}

I believe you might need to add something like and solution_stack != None: here

@adisharoon-socialware

The way this module is designed, a solution stack is required, rather than a configuration template.

@adisharoon-socialware

@noqcks The way I wrote it, solution_stack is required only if state: present.

@noqcks
noqcks commented Jan 8, 2016

🆒 could we add some docs for that then? because I ran it and didnt know it was required when state=present and it was failing for me.

Maybe adding Required when C(state=present) at the end of the description for solution_stack?

@sivel
Member
sivel commented Jan 15, 2016

This module has failed validation due to incorrectly formatted DOCUMENTATION and missing RETURN docs.

============================================================================
./cloud/amazon/elastic_beanstalk.py
============================================================================
ParserError: while parsing a flow sequence
  in "<string>", line 56, column 14:
        choices: [ "present, "absent", "restarted" ]
                 ^
expected ',' or ']', but got '<scalar>'
  in "<string>", line 56, column 27:
        choices: [ "present, "absent", "restarted" ]
                              ^
ERROR: Invalid or no DOCUMENTATION provided
ERROR: No RETURN provided
@gregdek
Contributor
gregdek commented Mar 21, 2016

@adisharoon-socialware A friendly reminder: this pull request has been marked as needing your action. If you still believe that this PR applies, and you intend to address the issues with this PR, just let us know in the PR itself and we will keep it open pending your changes.

@gregdek
Contributor
gregdek commented Apr 6, 2016

@adisharoon-socialware Another friendly reminder: this pull request has been marked as needing your action. If you still believe that this PR applies, and you intend to address the issues with this PR, just let us know in the PR itself and we will keep it open. If we don't hear from you within another 14 days, we will close this pull request.

[This message brought to you by your friendly Ansibull-bot.]

@sidewinder12s sidewinder12s commented on the diff Apr 14, 2016
cloud/amazon/elastic_beanstalk.py
+ state=dict(choices=["present", "absent", "restarted"], required=True),
+ redeploy=dict(default=False, type="bool")
+ )
+ )
+ module = AnsibleModule(
+ argument_spec=argument_spec,
+ mutually_exclusive=[[
+ "configuration_template",
+ "environment_options"
+ ]]
+ )
+ if not HAS_BOTO:
+ module.fail_json(msg='boto required for this module')
+ region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module)
+ aws_connect_kwargs.pop("validate_certs")
+ beanstalk = boto.connect_beanstalk(**aws_connect_kwargs)
@sidewinder12s
sidewinder12s Apr 14, 2016 edited

This does not properly respect a region specified from the get_aws_connection_info() helper ansible python module. Looks like it currently uses this connect_beanstalk which just connects to us-east-1. Switching to the boto.beanstalk.connect_to_region() method seems to have the same functionality along with region support.

Should look like this: https://gist.github.com/sidewinder12s/114b880aa29216574f4bcb3acaef1f5f

@gregdek
Contributor
gregdek commented Apr 21, 2016

@adisharoon-socialware A friendly reminder: this pull request has been marked as needing your action. If you still believe that this PR applies, and you intend to address the issues with this PR, just let us know in the PR itself and we will keep it open pending your changes. When you do address the issues, please respond with ready_for_review in your comment, so that we can notify the maintainer.

[This message brought to you by your friendly Ansibull-bot.]

@sidewinder12s

@gregdek What's the process if I wanted to fix the issues with this Pull Request to get it accepted? Open another pull request with this Pull request with the required fixes?

@gregdek
Contributor
gregdek commented May 2, 2016

@sidewinder12s I'd say that's fair. Thanks. Pull from the @adisharoon-socialware fork so they get credit for the code. I'm going to go ahead and close this PR.

@gregdek gregdek closed this May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment