geerlingguy / ansible-role-php-versions

Ansible Role - PHP Versions
https://galaxy.ansible.com/geerlingguy/php-versions/
MIT License
98 stars 73 forks source link

conditional check ''php' + php_version not in item' failed - cannot concatenate 'str' and 'float' objects #16

Closed geerlingguy closed 6 years ago

geerlingguy commented 6 years ago

Got this today with Ansible 2.5.0, not sure if it affects other Ansible versions:

TASK [geerlingguy.php-versions : Purge PHP version packages.] **********************************************************
fatal: [10.0.100.44]: FAILED! => 
  msg: |-
    The conditional check ''php' + php_version not in item' failed. The error was: Unexpected templating type error occurred on ({% if 'php' + php_version not in item %} True {% else %} False {% endif %}): cannot concatenate 'str' and 'float' objects

    The error appears to have been in '/Users/jeff.geerling/Dropbox/Development/GitHub/drupal-pi/roles/geerlingguy.php-versions/tasks/setup-Debian.yml': line 41, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.

    The offending line appears to be:

    # PHP package purges.
    - name: Purge PHP version packages.
      ^ here
geerlingguy commented 6 years ago

Ah... had php_version: 7.0 in my configuration. Needed to change it to php_version: "7.0" :)