File: module fails when path contains $HOME (or other env variables) in the name #25005
Labels
affects_2.3
This issue/PR affects Ansible v2.3
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
P2
Priority 2 - Issue Blocks Release
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
ISSUE TYPE
COMPONENT NAME
file module
ANSIBLE VERSION
OS / ENVIRONMENT
Ubuntu 14.04
SUMMARY
IF a path includes a "known envrionment variable" (For example, $HOME) as a file/directory
(i.e. /tmp2/$HOME/my_file.txt)
, then ansible will evaluate it (rather than treating it as a literal), resulting in/tmp2//root/my_file.txt
which produces an OSError - No such file/directory.STEPS TO REPRODUCE
1. Create a directory and some files:
#2. Create a new role with one task:
(Assumes a user:group named
www-data
exists)EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: