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

#######################################

- name: Grab the SSL certs
      action: shell python2 -c 'import pyrax

        "pyrax.settings.set(identity_type, rackspace)"
        "pyrax.set_credentials(abc, 1234567890...)"

        "con = pyrax.cloudfiles.get_container("ssl-certs")"
        "for filename in ["_.abc.com.combined.pem", "_.abc.com.key"]:"
          "with open("/opt/nginx/conf/" + filename, "wb") as f:"
            f.write(con.get_object(filename).fetch())
            '
      when: check_path.stat.exists
#######################################

When the play is run...

#######################################

stderr:   File "<string>", line 3
    "con = pyrax.cloudfiles.get_container("ssl-certs")" "for filename in 
["_.veracross.com.combined.pem", "_.veracross.com.key"]:" "with 
open("/opt/nginx/conf/" + fi  lename, "wb") as f:" 
f.write(con.get_object(filename).fetch())
                                             ^
SyntaxError: invalid syntax

I've quoted a hundred ways, etc but no luck.....any help/pointers is 
GREATLY appreciated!!

Many thanks in advance.

BuddyD


-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to