I’m using a variable to specify a relative path to where I want my output written. It looks like ansible can figure out what I’m telling it, but then cheerily ignores me and writes to /tmp
vars:
local_dest: “~/STIG\ Results/”
- name: Retrieve result
fetch: src=/tmp/{{ dest_file }}
dest=“{{ local_dest }}”
flat=yes
validate_checksum=no
TASK: [debug msg=“{{ local_dest }}”] ******************************************
ESTABLISH CONNECTION FOR USER: joliver
ok: [flamingo] => {
“msg”: “~/STIG Results/”
}
TASK: [Retrieve result] *******************************************************
ESTABLISH CONNECTION FOR USER: joliver
EXEC ssh -C -tt -v -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/joliver/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 flamingo /bin/sh -c ‘rc=flag; [ -r /tmp/U_FLAMINGO_JRE7_20150511.ckl ] || rc=2; [ -f /tmp/U_FLAMINGO_JRE7_20150511.ckl ] || rc=1; [ -d /tmp/U_FLAMINGO_JRE7_20150511.ckl ] && rc=3; python -V 2>/dev/null || rc=4; [ x"$rc" != “xflag” ] && echo "${rc} “/tmp/U_FLAMINGO_JRE7_20150511.ckl && exit 0; (python -c '”’“'import hashlib; BLOCKSIZE = 65536; hasher = hashlib.sha1(); afile = open(”‘"’“‘/tmp/U_FLAMINGO_JRE7_20150511.ckl’”‘"’“, “rb”) buf = afile.read(BLOCKSIZE) while len(buf) > 0: hasher.update(buf) buf = afile.read(BLOCKSIZE) afile.close() print(hasher.hexdigest())'”‘"’ 2>/dev/null) || (python -c ‘"’“'import sha; BLOCKSIZE = 65536; hasher = sha.sha(); afile = open(”‘"’“‘/tmp/U_FLAMINGO_JRE7_20150511.ckl’”‘"’“, “rb”) buf = afile.read(BLOCKSIZE) while len(buf) > 0: hasher.update(buf) buf = afile.read(BLOCKSIZE) afile.close() print(hasher.hexdigest())'”‘"’ 2>/dev/null) || (echo ‘"’“'0 '”‘"’/tmp/U_FLAMINGO_JRE7_20150511.ckl)’
FETCH /tmp/U_FLAMINGO_JRE7_20150511.ckl TO /Users/joliver/STIG Results/U_FLAMINGO_JRE7_20150511.ckl
changed: [flamingo] => {“changed”: true, “checksum”: null, “dest”: “/Users/joliver/STIG Results/U_FLAMINGO_JRE7_20150511.ckl”, “md5sum”: null, “remote_checksum”: “6890cd809b2a8d98bed77236499a304e627752c8”, “remote_md5sum”: null}
joliver@flamingo U_JRE7_UNIX_V1R4 $ ls -l ~/STIG\ Results/U_F*
ls: /Users/joliver/STIG Results/U_F*: No such file or directory
joliver@flamingo U_JRE7_UNIX_V1R4 $ ls -l /tmp/U_FLAMINGO_JRE7_20150511.ckl
-rw-r–r-- 1 joliver wheel 50913 May 11 11:49 /tmp/U_FLAMINGO_JRE7_20150511.ckl