Bug with composer module on OSX

Hi All,

I guess this isn’t a common case, but I’ve experienced an error with using the composer module on an OSX machine. Runs perfectly on Linux, with the same exact settings!

`

TASK: [Composer install] *******************************************
REMOTE_MODULE composer no_dev=False working_dir=/tmp/deploy

EXEC [‘/bin/sh’, ‘-c’, ‘mkdir -p
$HOME/.ansible/tmp/ansible-tmp-1404425204.93-218640203058643 &&
chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1404425204.93-218640203058643
&& echo
$HOME/.ansible/tmp/ansible-tmp-1404425204.93-218640203058643’]

PUT /var/folders/fx/51cy7j4978xdtx6b4ck5jcl00000gp/T/tmpwxXuuC TO
/Users/markc/.ansible/tmp/ansible-tmp-1404425204.93-218640203058643/composer

EXEC [‘/bin/sh’, ‘-c’, u’LC_CTYPE=en_US.UTF-8 SYMFONY_ENV=dev
LANG=en_US.UTF-8 /usr/bin/python
/Users/markc/.ansible/tmp/ansible-tmp-1404425204.93-218640203058643/composer;
rm -rf
/Users/markc/.ansible/tmp/ansible-tmp-1404425204.93-218640203058643/

/dev/null 2>&1’]
ok:
[localhost] => {“changed”: false, “msg”: “/usr/bin/env php -d
allow_url_fopen=On -d detect_unicode=Off
/usr/local/Cellar/composer/1.0.0-alpha8/libexec/composer.phar $*”}

`

The last line is strange, completely different to what is shown on Linux (it’s meant to be the composer output).

The task is:

`

  • name: Composer install
    environment: symfony_environment
    tags: [ “composer” ]
    composer:
    working_dir: “{{ composer_dir }}”
    optimize_autoloader: yes
    prefer_dist: yes
    no_dev: “{{ composer_no_dev }}”
    `

Cheers, Cameron

What is composer_dir?

I have a feeling you are pointing to the wrong file (as in not the real phar file). The real phar looks like it’s on your system at /usr/local/Cellar/composer/1.0.0-alpha8/libexec/composer.phar

Changed false seems to imply it did not think it needed to install anything, because it already was present.

Could this be the case?

composer_dir is the location of the composer.json file. There is no composer.phar at that location as I’m relying on it being installed system-wide.

If it’s something to do with how composer was installed, it was done using Homebrew, and the module itself finds the location of the composer.phar executable.

No, as it was a fresh checkout from Git with no vendors installed.

The same playbook runs perfectly on Linux, but fails on OSX.

Filing a ticket may be a good idea :slight_smile: