I am trying to install php with ansible but can don't know what is going wrong.
this is my ansible file
---
- apt_repository:
repo: "ppa:ondrej/php"
update_cache: yes
- apt:
name: "{{ item }}"
install_recommends: no
state: present
with_items:
- curl
- php7.2
- php7.2-apcu-bc
- php7.2-cli
- php7.2-common
- php7.2-curl
- php7.2-dev
- php7.2-gd
- php7.2-mysql
- php7.2-simplexml
- php7.2-zip
- name: Turn on short open tags
ini_file:
section: "{{ item.section }}"
dest: /etc/php5/apache2/php.ini
option: "{{ item.option }}"
value: "{{ item.value }}"
with_items:
- { section: 'PHP', option: 'short_open_tag', value: 'On' }
when I am trying to run it with vagrant, I get this error
failed: [aliuqa] (item=['curl', 'php7.2', 'php7.2-apcu-bc', 'php7.2-cli', 'php7.2-common', 'php7.2-curl', 'php7.2-dev', 'php7.2-gd', 'php7.2-mysql', 'php7.2-simplexml', 'php7.2-zip']) => {"ansible_loop_var": "item", "changed": false, "item": ["curl", "php7.2", "php7.2-apcu-bc", "php7.2-cli", "php7.2-common", "php7.2-curl", "php7.2-dev", "php7.2-gd", "php7.2-mysql", "php7.2-simplexml", "php7.2-zip"], "msg": "No package matching 'php7.2' is available"}
I even tried to install php7.2 manually into my virtualbox but it gives the same package not found related error.
One interesting thing is, when I try to install php5 manually, it works. But for this project, I need php7.2
Versions:
vagrant - 2.0.3
Virtualbox - 6.1.32
ansible - 2.9.1