Answer the question
In order to leave comments, you need to log in
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
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question