I'm trying to have a template placed on some servers and while the file is beeing placed to contain the contents of another file (Public key) like so:
As you can see, I tried to include the "/opt/encapserver.crt" file on the machine beeing managed at that moment.
mmaas@xmgtansible:~/playbooks$ ansible-playbook forge_rock.yml -l t1atham* -vvvv --tags=test
But i'm running into this error:
TASK: [openam | Plaats binck_encapmodule.properties] **************************
<t1athamyar> ESTABLISH CONNECTION FOR USER: mmaas
<t1athamyar> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/mmaas/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', 't1athamyar', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1395828889.82-55430178152696 && chmod a+rx $HOME/.ansible/tmp/ansible-1395828889.82-55430178152696 && echo $HOME/.ansible/tmp/ansible-1395828889.82-55430178152696'"]
fatal: [t1athamyar] => {'msg': '/opt/encapserver.crt', 'failed': True}
fatal: [t1athamyar] => {'msg': '/opt/encapserver.crt', 'failed': True}
I could ofcourse simply "cat" the contents of that file and register the output as a variable. And then use that variabel. But that would not be as clean as when using jinja2 stuff directly ;-)