Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- # tasks file for mysql
- - name: Actualizar APT
- apt: update_cache=yes
- - name: Instalar MySQL
- apt: name={{ item }} state=latest
- with_items:
- - mysql-server
- - python-mysqldb
- - name: Crear base de datos para WordPress
- mysql_db:
- name: wordpress
- state: present
- - name: Crear usuario MySQL
- mysql_user:
- name: '{{ wp_db_name }}'
- password: '{{ wp_db_password }}'
- priv: '{{ wp_db_name }}.*:ALL'
- host: '{{ wp_db_host }}'
- notify: reiniciar mysql
- - name: Modificar my.cnf para aceptar conexiones remotas
- lineinfile:
- dest=/etc/mysql/mysql.conf.d/mysqld.cnf
- regexp="{{ item.regexp }}"
- line="{{ item.line}}"
- with_items:
- - {'regexp': "bind-address(.)+= 127.0.0.1", 'line': "bind-address = 0.0.0.0"}
- notify: reiniciar mysql
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement