Hello,
I'm hooking up Ansible and a Vagrant VM running Ubuntu 14.04 LTS. To do this, I have the following inventory file:
The path to the private key is relative to the directory the inventory file is in, and the private key exists. The other values - host, port and user - were populated based on the output of `vagrant ssh-config` after the Vagrant VM had booted:
default \ansible_ssh_host="127.0.0.1" \ansible_ssh_port="2202" \ansible_ssh_user="vagrant" \ansible_ssh_private_key_file=".vagrant/machines/default/virtualbox/private_key"
✗ vagrant ssh-configHost defaultHostName 127.0.0.1User vagrantPort 2202UserKnownHostsFile /dev/nullStrictHostKeyChecking noPasswordAuthentication noIdentityFile /projects/ansible/.vagrant/machines/default/virtualbox/private_keyIdentitiesOnly yesLogLevel FATAL
✗ ansible default -i hosts -m pingTraceback (most recent call last):File "/usr/local/Cellar/ansible/1.9.4/libexec/bin/ansible", line 197, in <module>(runner, results) = cli.run(options, args)File "/usr/local/Cellar/ansible/1.9.4/libexec/bin/ansible", line 121, in runinventory_manager = inventory.Inventory(options.inventory, vault_password=vault_pass)File "/usr/local/Cellar/ansible/1.9.4/libexec/lib/python2.7/site-packages/ansible/inventory/__init__.py", line 128, in __init__self.parser = InventoryParser(filename=host_list)File "/usr/local/Cellar/ansible/1.9.4/libexec/lib/python2.7/site-packages/ansible/inventory/ini.py", line 43, in __init__self._parse()File "/usr/local/Cellar/ansible/1.9.4/libexec/lib/python2.7/site-packages/ansible/inventory/ini.py", line 47, in _parseself._parse_base_groups()File "/usr/local/Cellar/ansible/1.9.4/libexec/lib/python2.7/site-packages/ansible/inventory/ini.py", line 108, in _parse_base_groupstokens = shlex.split(line)File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 279, in splitreturn list(lex)File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 269, in nexttoken = self.get_token()File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 96, in get_tokenraw = self.read_token()File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 191, in read_tokenraise ValueError, "No escaped character"ValueError: No escaped character
Thanks!
________________________________________
From: ansible...@googlegroups.com <ansible...@googlegroups.com> on behalf of Brian Coca <bc...@ansible.com>
Sent: 29 November 2015 04:46
To: Ansible Project
Subject: Re: [ansible-project] "No escaped character" in inventory file
--
Brian Coca
--
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/CAJ5XC8%3D4iqc68nUGWiHCny%2BPnWH7equfHVHL6vBT1z1D-uyE9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.