Estou com um erro na conexão do wordpress com o banco de Dados todo o resto do código esta dando certo. Alguém pode me ajudar?
---
- hosts: db
tasks:
- name: 'banco de dados'
apt:
name: ['mysql-server','python3-mysqldb','python3-apt','python-pymysql']
become: yes
- name: 'criando um banco de dados'
mysql_db:
login_unix_socket: /var/run/mysqld/mysqld.sock
name: wordpress_db
state: present
become: yes
- name: 'crinado usuário no banco'
mysql_user:
login_unix_socket: /var/run/mysqld/mysqld.sock
login_user: root
name: wordpress_user
password: 12345
priv: 'wordpress_db.*:ALL'
state: present
become: yes
- hosts: wordpress
handlers:
- name: restart apache
service:
name: apache2
state: restarted
become: yes
tasks:
- name: 'instalando php'
apt:
update_cache: yes
name:
- php
- apache2
- libapache2-mod-php
- php-cli
- php-common
- php-mbstring
- php-gd
- php-xml
- php-mysql
- php-zip
state: latest
become: yes
- name: 'dowload do wordpress'
get_url:
url: 'https://wordpress.org/latest.tar.gz'
dest: '/tmp/wordpress.tar.gz'
- name: 'descompacta arquivo'
unarchive:
src: '/tmp/wordpress.tar.gz'
dest: '/var/www/'
remote_src: yes
become: yes
- name: 'copiando arquivo'
copy:
src: '/var/www/wordpress/wp-config-sample.php'
dest: '/var/www/wordpress/wp-config.php'
remote_src: yes
become: yes
- name: 'módulo replace'
replace:
path: '/var/www/wordpress/wp-config.php'
regexp: "{{ item.regex }}"
replace: "{{ item.value }}"
backup: yes
with_items:
- {regex: 'database_name_here', value: 'wordpress_db'}
- {regex: 'username_here', value: 'wordpress_user'}
- {regex: 'password_here', value: '12345'}
become: yes
- name: 'configuração do apache'
copy:
src: '/vagrant/000-default.conf'
dest: '/etc/apache2/sites-available/000-default.conf'
become: yes
notify:
- restart apache