The composer module is not able to use "working-dir" with directories that contain a space.
STEPS TO REPRODUCE
mkdir /tmp/test\ directory
# Create a simple composer.json with contents:
{
"require": {
"rfd/imagemagick": "*"
}
}
ansible localhost -m composer -a "working-dir=\"/tmp/test directory\""
EXPECTED RESULTS
Composer is able descend into the requested directory.
ACTUAL RESULTS
Composer complains that the directory doesn't exist, but the error message lists the wrong directory.
[RuntimeException] Invalid working directory specified, /tmp/test does not exist.
$ ansible localhost -m composer -a "working-dir=\"/tmp/test directory\"" -vvv
No config file found; using defaults
[WARNING]: Host file not found: /etc/ansible/hosts
[WARNING]: provided hosts list is empty, only localhost is available
Using module file /Library/Python/2.7/site-packages/ansible/modules/extras/packaging/language/composer.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: tylerlawson
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1484583081.77-153904708810732 `" && echo ansible-tmp-1484583081.77-153904708810732="` echo $HOME/.ansible/tmp/ansible-tmp-1484583081.77-153904708810732 `" ) && sleep 0'
<127.0.0.1> PUT /var/folders/wj/lx9yl6t56nvdwgmq90c642f00000gn/T/tmpmIQHYO TO /Users/tylerlawson/.ansible/tmp/ansible-tmp-1484583081.77-153904708810732/composer.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /Users/tylerlawson/.ansible/tmp/ansible-tmp-1484583081.77-153904708810732/ /Users/tylerlawson/.ansible/tmp/ansible-tmp-1484583081.77-153904708810732/composer.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python /Users/tylerlawson/.ansible/tmp/ansible-tmp-1484583081.77-153904708810732/composer.py; rm -rf "/Users/tylerlawson/.ansible/tmp/ansible-tmp-1484583081.77-153904708810732/" > /dev/null 2>&1 && sleep 0'
localhost | FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"arguments": "",
"command": "install",
"ignore_platform_reqs": false,
"no_dev": true,
"no_plugins": false,
"no_scripts": false,
"optimize_autoloader": true,
"prefer_dist": false,
"prefer_source": false,
"working-dir": "/tmp/test directory",
"working_dir": "/tmp/test directory"
},
"module_name": "composer"
},
"msg": "[RuntimeException] Invalid working directory specified, /tmp/test does not exist.",
"stdout": "\n \n [RuntimeException] \n Invalid working directory specified, /tmp/test does not exist. \n \n\n",
"stdout_lines": [
"",
" ",
" [RuntimeException] ",
" Invalid working directory specified, /tmp/test does not exist. ",
" ",
""
]
}
ISSUE TYPE
COMPONENT NAME
composer
ANSIBLE VERSION
CONFIGURATION
N/A
OS / ENVIRONMENT
N/A
SUMMARY
The composer module is not able to use "working-dir" with directories that contain a space.
STEPS TO REPRODUCE
mkdir /tmp/test\ directory
EXPECTED RESULTS
Composer is able descend into the requested directory.
ACTUAL RESULTS
Composer complains that the directory doesn't exist, but the error message lists the wrong directory.
[RuntimeException] Invalid working directory specified, /tmp/test does not exist.