I am trying to install mysql server on centos using ansible playbook. My yml file looks like above.
---
- name: Install MySQL database server
hosts: test
become: yes
become_method: sudo
gather_facts: true
tags: [database]
tasks:
- name: Update the software package repository
yum:
update_cache: yes
- name: Install MySQL
package:
name: "{{ item }}"
state: latest
with_items:
- mysql-server
- mysql-client
- python-mysqldb
But it getting error.
failed: [192.168.94.151] (item=mysql-server) => {"changed": false, "item": "mysql-server", "msg": "No package matching 'mysql-server' found available, installed or updated", "rc": 126, "results": ["No package matching 'mysql-server' found available, installed or updated"]}
How can i fix this issue?