Ansible playbook to create a new database

0 votes
Can someone help me write an ansible task to create database? Thanks in advance.
Aug 8 in Ansible by Pravalika

1 answer to this question.

0 votes

Hi pravalika, its pretty simple.  You just have to use the mysql_db module if you're using mysql. Mention the name of the database and the state. 

- name: Create a new database with name 'bobdata'
    name: mydatabase
    state: present

answered Aug 8 by Trvais

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How can I create a new user using ansible ploybook?

You're switching from the root user. Root ...READ MORE

answered Mar 29, 2018 in Ansible by DareDev
• 6,810 points
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
0 votes
1 answer
0 votes
1 answer

Ansible Playbook to create a Load Balancer

Hey @Himanshu, you can try something like ...READ MORE

answered Mar 25 in Ansible by Jack