diff --git a/Ansible/apdb.yml b/Ansible/apdb.yml new file mode 100644 index 0000000..b6b272b --- /dev/null +++ b/Ansible/apdb.yml @@ -0,0 +1,34 @@ +--- +- hosts: all + become: yes + tasks: + - name: installation de python3 + apt: + name: python3-pymysql + + - name: creation de la base de donnees "sdis29" + community.mysql.mysql_db: + name: sdis29 + state: present + login_unix_socket: /run/mysqld/mysqld.sock + + - name: Creation d'un utilisateur avec tous les privileges + community.mysql.mysql_user: + name: admin + password: password123* + priv: '*.*:ALL' + state: present + login_unix_socket: /run/mysqld/mysqld.sock + + - name: copie du dump mysql sur la machine pt + copy: + src: sdis29.sql + dest: /tmp + + - name: Import du fichier sdis29.sql sur la base de données sdis29 + community.mysql.mysql_db: + name: sdis29 + state: import + target: /tmp/sdis29.sql + force: true + login_unix_socket: /run/mysqld/mysqld.sock \ No newline at end of file