T
T
Tylen2020-12-08 11:26:46
MySQL
Tylen, 2020-12-08 11:26:46

How to create a mysql user using ansible?

Hello, I can’t solve this problem in any way, I’m just learning ansible, I can’t figure it out with mysql
Playbook:
GNU nano 2.3.1 File: mysql.yml Changed

---
- name: Install Mysql playbook

hosts: all
become: true
tasks:
- name: Download sql rep
get_url:
url: https://dev.mysql.com/get/mysql80-community-releases...
dest: /home/idkuznetsov/internship/day8
- name: Install rmp
yum:
name: / home/idkuznetsov/internship/day8/mysql80-community-release-el7-3.noarch.rpm
state: present
- name: Install MySQL!!!
yum:
name: "{{ name }}"
vars:
name:
- mysql-server
- name: Up mysql
systemd:
state: started
name: mysqld

#Mysql Setting
- name: Creat user
community.mysql.mysql_user:
name: Test
password : '12345'
priv: '*.*:ALL'
state: present

- name: Create a new database with name test11
community.mysql.mysql_db:
name: test11
state: present

5fcf38b5e709a247690985.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanes, 2020-12-08
@Tylen

Mariadb example . When this playbook was being written, something was wrong with MySQL 8.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question