I am trying to install Php, Apache in RHEL
using the Ansible Playbook
. But I am getting following error.
*failed: [18.191.65.251] (item=[u'php', u'php-mysql', u'php-pdo', u'php-gd', u'php-mbstring']) => {"ansible_loop_var": "item", "changed": false, "failures": ["No package php-mysql available."], "item": ["php", "php-mysql", "php-pdo", "php-gd", "php-mbstring"], "msg": ["Failed to install some of the specified packages"], "rc": 1, "results": []}
The code that I have used to write the playbook is as follows
---
- hosts: all
become: yes
tasks:
- name: Install httpd
yum:
name: httpd
state: present
- name: starting httpd service
service:
name: httpd
enabled: yes
state: started
- name: Installing php packages
yum:
name: "{{ item }}"
state: present
with_items:
- php
- php-mysql
- php-pdo
- php-gd
- php-mbstring
- name: restart Apache service
service:
name: httpd
state: restarted