Error running ec2.py script

786 views
Skip to first unread message

Bruce Bundy

unread,
Oct 23, 2014, 11:32:36 AM10/23/14
to ansible...@googlegroups.com
I have a freshly installed Ubuntu 14.04 LTS instance running ansible 1.5.4 and python 2.7.6
In general my ansible playbooks are running normally, using modules such as apt, gem, pip, authorized_key, user, etc.

Now I am trying to use AWS dynamic inventory features.  I fetched ec2.py using

wget https://raw.github.com/ansible/ansible/devel/plugins/inventory/ec2.py

and ec2.ini using 

wget https://raw.github.com/ansible/ansible/devel/plugins/inventory/ec2.ini

 but have not made any mods to either file.

When I try the test command provided, I receive the following error:

-----------------

ansible@admin-staging:~/Ansible$ ansible -i ec2.py -u ubuntu us-east-1d -m ping

Traceback (most recent call last):

  File "/usr/bin/ansible", line 226, in <module>

    (runner, results) = cli.run(options, args)

  File "/usr/bin/ansible", line 142, in run

    inventory_manager = inventory.Inventory(options.inventory)

  File "/usr/lib/python2.7/dist-packages/ansible/inventory/__init__.py", line 106, in __init__

    self.parser = InventoryParser(filename=host_list)

  File "/usr/lib/python2.7/dist-packages/ansible/inventory/ini.py", line 41, in __init__

    self._parse()

  File "/usr/lib/python2.7/dist-packages/ansible/inventory/ini.py", line 45, in _parse

    self._parse_base_groups()

  File "/usr/lib/python2.7/dist-packages/ansible/inventory/ini.py", line 83, in _parse_base_groups

    tokens = shlex.split(line)

  File "/usr/lib/python2.7/shlex.py", line 279, in split

    return list(lex)

  File "/usr/lib/python2.7/shlex.py", line 269, in next

    token = self.get_token()

  File "/usr/lib/python2.7/shlex.py", line 96, in get_token

    raw = self.read_token()

  File "/usr/lib/python2.7/shlex.py", line 172, in read_token

    raise ValueError, "No closing quotation"

ValueError: No closing quotation

-----------------

Does anyone have an idea of what may be going on here?  Thanks very much for your help!

Michael Peters

unread,
Oct 23, 2014, 11:53:07 AM10/23/14
to ansible...@googlegroups.com
Try running the dynamic inventory by itself to see what output is generated.

./ec2.py
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/7674bdf3-4b6a-405c-8178-9ddd4206790e%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Bruce Bundy

unread,
Oct 23, 2014, 12:28:35 PM10/23/14
to ansible...@googlegroups.com
Thanks Michael.  That enabled me to debug the problem.  Two things:  I needed to "pip install boto" and "export EC2_INI_PATH=/etc/ansible/ec2.ini".
:-) works now!
-Bruce

Christian Laguerre

unread,
Oct 23, 2014, 2:48:58 PM10/23/14
to ansible...@googlegroups.com
Bruce,

You may want to run a more recent version Ansible. There a a lot of parameters need 1.6, and even the current release 1.7.2 is starting to fall behind for AWS stuff. For instance, spinning up a Encrypted ESB volume requires 1.8. Here's a link to where this is discussed. http://docs.ansible.com/intro_installation.html

-Christian 

Michael DeHaan

unread,
Oct 24, 2014, 9:30:30 AM10/24/14
to ansible...@googlegroups.com
No closing quotation has little to do with AWS parameter usage, but error handling is greatly improved in numerous cases in the 1.7.X series.



Reply all
Reply to author
Forward
0 new messages