This seems like it's related to some of the anti-dangerous-variable usage logic in the system.
Please file a bug on this one and we can take a look. 1.7 will include numerous parser improvements and also massively increases parser test coverage, and will be out very soon. On Mon, Aug 4, 2014 at 9:42 AM, Lucas, Sascha <[email protected]> wrote: > Hi, > > after upgrading from 1.4 to 1.6.10 I have following problem with dynamic > inventory: > > static inventory /tmp/inv: > [somegroup] > server15 ansible_ssh_host=X.X.X.X > ansible_python_interpreter=/home/${SUDO_USER:-${USER}}/python-2.7/bin/python > > Task with static inventory works as expected: > $ ansible -i /tmp/inv -m ping server15 > server15 | success >> { > "changed": false, > "ping": "pong" > } > > dynamic inventory script (output): > { > "_meta": { > "server15": { > "ansible_python_interpreter": > "/home/${SUDO_USER:-${USER}}/python-2.7/bin/python", > "ansible_ssh_host": "X.X.X.X" > } > }, > "somegroup": [ > "server15" > ] > } > > Task with dynamic seems to mangle ${SUDO_USER:-${USER}} into > ${SUDO_USER:-${USER#}: > $ ansible -i inventory/dyn_cmdb_inv.py -m ping server -vvv > < X.X.X.X > ESTABLISH CONNECTION FOR USER: someuser > < X.X.X.X > REMOTE_MODULE ping > < X.X.X.X > EXEC ['ssh', '-C', '-q', '-o', 'ControlMaster=auto', '-o', > 'ControlPersist=60s', '-o', > 'ControlPath=/home/someuser/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', > 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', > 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', > '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', u' X.X.X.X, > u"/bin/sh -c 'LC_CTYPE=C LANG=C > /home/${SUDO_USER:-${USER#}/python-2.7/bin/python'"] > server15 | FAILED >> { > "failed": true, > "msg": "/bin/sh: -c: line 0: unexpected EOF while looking for matching > `}'\n/bin/sh: -c: line 1: syntax error: unexpected end of file\n", > "parsed": false > } > > Anything I can do better? > > Thanks, Sascha. > > Stellvertretender Vorsitzender des Aufsichtsrates: Detlef Hillebrand > Geschäftsführung: Michael Krüger > Sitz der Gesellschaft: Halle/Saale > Registergericht: Amtsgericht Stendal | Handelsregister-Nr. HRB 208414 > UST-ID-Nr. DE 158253683 > > Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte > Informationen. Wenn Sie nicht der richtige Empfänger sind oder diese E-Mail > irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und > vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte > Weitergabe dieser Mail oder des Inhalts dieser Mail sind nicht gestattet. > Diese Kommunikation per E-Mail ist nicht gegen den Zugriff durch Dritte > geschützt. Die GISA GmbH haftet ausdrücklich nicht für den Inhalt und die > Vollständigkeit von E-Mails und den gegebenenfalls daraus entstehenden > Schaden. Sollte trotz der bestehenden Viren-Schutzprogramme durch diese > E-Mail ein Virus in Ihr System gelangen, so haftet die GISA GmbH - soweit > gesetzlich zulässig - nicht für die hieraus entstehenden Schäden. > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/383FAD2C9609F74D8F075EFF2B86B5795DAA1837%40SGIS111.gisa-halle.de > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzDMoWzorsUaF7QE3yVSRHXF_7cuvm86Z2YHuJYnY%3DTkQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
