I think I may have uncovered a bug in the template module. Whatever I do, I can't remove inserted quotes for a dest path which are inserted by Ansible.
The same combination DOES work for other modules.
I have tried using the join filter but this produces the same results!
Below is the relevant debug info:
------------------
vars:
xbmc_docker_dir: xbmc
docker_home: /opt/docker
- name: Create advanced_settings file for our Mysql XBMC server
template: src=advancedsettings.xml.j2
dest={{docker_home}}/{{xbmc_docker_dir}}/xbmcdata/userdata/advancedsettings.xml
owner=root
group=root
mode=0644
Error:
TASK: [xbmc-headless-docker | Create advanced_settings file for our Mysql XBMC server] ***
msg: Destination directory "/opt/docker"/"xbmc"/xbmcdata/userdata does not exist
FATAL: all hosts have already failed -- aborting
--------------
I have had to horribly hard code the paths in my dest command as a temporary workaround - please help me remove the abomination! :)
This variable combination/concatenation DOES work for the command module - for example the following runs the docker command with no problem ( I do know I can use the docker module for this but am testing to see wtf works and what doesn't...... )
- name: Run the docker image
command: docker run -d --net=host --privileged -v "{{docker_home}}"/"{{xbmc_docker_dir}}"/xbmcdata/:/opt/xbmc-server/portable_data -v "{{mount_point}}":"{{mount_point}}" wernerb/docker-xbmc-server