geerlingguy/ansible-role-php-pecl — pull request #3 by LewisW (2014-11-02 12:03:48+00:00)
Title: Fixed "error while evaluating conditional"

When the role fails it doesn't always generate a stdout (i.e. because PEAR isn't installed), so ansible fails when checking the failed_when conditional rather than the real error message:

fatal: [127.0.0.1] => error while evaluating conditional: not (('already installed' in pecl_result.stdout) or ('install ok:' in pecl_result.stdout))

When the actual error is:
failed: [127.0.0.1] => (item=xdebug) => {"changed": false, "cmd": "pecl install xdebug", "failed": true, "failed_when_result": true, "item": "xdebug", "rc": 2}
msg: [Errno 2] No such file or directory

So I've just added a default of null to the variables. I wasn't sure if PECL always returns a stdout so I didn't just want to always fail when there's no stdout, but I can change it if you think that's the better solution?

*Feel free to reject this PR if you think this is a non-issue, since the readme.md does state that PECL is required anyway*