stumped by Ansible/python/pyrax...

Hi all,

Working to convert bash scripts to Ansible, I’ve been wrestling with the following ( and having no luck ). It runs perfectly from a shell CLI so the problem appears to be my Ansible syntax.Specifically, the f.write line with the filename in ()'s is being flagged by Ansible as a syntax issue, plesase see below

Write the python out into a script file, then use the script: module to transfer it out and execute it. Far easier than trying to quote it all in yaml/jinja.

-jlk

Also, note that we have pull requests in to add Rackspace cloud files support which will likely be seen in the 1.5 release:

https://github.com/ansible/ansible/pull/5496
https://github.com/ansible/ansible/pull/5540

You could always start using the rax_files_objects file from 5496 now to get the functionality you are looking for.

Thanks Jesse!! That crossed my mind but I wanted to see if I was unaware of some additional Ansible functionality. But the script method seems the way to go.

Much appreciated!

Thanks Matt!! I’ll take a look at the links in order to familiarize myself with what’s coming in Ansible. I appreciate the response.