I'm trying to install a list of packages with ansible, and I can't seem to understand what the problem is.
- name: Add PHP 7.2 repo
apt_repository:
repo: ppa:ondrej/php
state: present
register: ppastable
- name: install php7.2-fpm and all necessary modules
apt: name={{ item }} state=present
with_items:
- php7.2-fpm
- php7.2-gd
- php7.2-curl
- php7.2-mysql
- php7.2-mcrypt
- php7.2-mbstring
- php7.2-xml
update_cache: true
when: ppastable is success
However, when I run the playbook, I get the following error:
failed: [172.31.110.103] (item=[u'php7.2-fpm', u'php7.2-gd', u'php7.2-curl', u'php7.2-mysql', u'php7.2-mcrypt', u'php7.2-mbstring', u'php7.2-xml']) => {"changed": false, "item": ["php7.2-fpm", "php7.2-gd", "php7.2-curl", "php7.2-mysql", "php7.2-mcrypt", "php7.2-mbstring", "php7.2-xml"], "msg": "No package matching 'php7.2-mcrypt' is available"}
On the server I'm testing this on, all the packages can be installed. That's not a problem. Any ideas what's going on? I'm running ansible 2.6.3 on ubuntu 16.04 and I'm trying to install the packages also on another system running the same OS.