--- - name: install pillow prerequisites for Debian < 8 apt: pkg={{ item }} state=present with_items: - libtiff4-dev - tcl8.5-dev - tk8.5-dev when: ansible_distribution_version | version_compare('8', 'lt') - name: install pillow prerequisites for Debian >= 8 apt: pkg={{ item }} state=present with_items: - libtiff5-dev - tcl8.5-dev - tk8.5-dev when: ansible_distribution_version | version_compare('8', 'ge')