2015-Middleware-Keynote / demo-ansible

Apache License 2.0
18 stars 24 forks source link

Add wrapper script for ansible playbook #22

Closed detiber closed 9 years ago

detiber commented 9 years ago

@thoraxe mind giving this a test to see if it meets your requirements for a scripted approach?

I tried to leave sensible defaults where they made sense. Default values are provided for cluster-id, env-size, region, ami, instance-type, keypair, and app-dns-prefix . Users are always prompted for rhsm-user, rhsm-pass and r53-zone if they are not specified. I also added a flag (--no-confirm) that allows for skipping the confirmation prompt and would allow a fully unattended install

thoraxe commented 9 years ago
Traceback (most recent call last):
  File "./run.py", line 3, in <module>
    import click
ImportError: No module named click

Looks like there are some Python prereqs that are not clearly defined... ?

thoraxe commented 9 years ago
TASK: [Create ec2 node security group] **************************************** 
failed: [localhost] => {"failed": true, "parsed": false}
Traceback (most recent call last):
  File "/home/thoraxe/.ansible/tmp/ansible-tmp-1438259050.97-247214210344236/ec2_group", line 2192, in <module>
    main()
  File "/home/thoraxe/.ansible/tmp/ansible-tmp-1438259050.97-247214210344236/ec2_group", line 302, in main
    group.authorize(rule['proto'], rule['from_port'], rule['to_port'], ip, grantGroup)
  File "/usr/lib/python2.7/site-packages/boto-2.31.1-py2.7.egg/boto/ec2/securitygroup.py", line 204, in authorize
    dry_run=dry_run)
  File "/usr/lib/python2.7/site-packages/boto-2.31.1-py2.7.egg/boto/ec2/connection.py", line 3179, in authorize_security_group
    params, verb='POST')
  File "/usr/lib/python2.7/site-packages/boto-2.31.1-py2.7.egg/boto/connection.py", line 1197, in get_status
    raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>InvalidGroup.NotFound</Code><Message>You have specified two resources that belong to different networks.</Message></Error></Errors><RequestID>9fa21356-e03e-49c6-bfd1-e91b3f2ec54e</
RequestID></Response>

FATAL: all hosts have already failed -- aborting

I don't see a way to pass verbosity into run.py (-vvv doesn't work) and also -h doesn't provide help (only --help).

detiber commented 9 years ago

@thoraxe I believe I've addressed the issues you've raised.

Now the error message you pasted, I believe is related to an ansible bug where security groups where not properly taking vpcs into account (https://github.com/ansible/ansible-modules-core/pull/1212). I believe 1.9.2 addressed this, but I'm not certain.