Nas aulas anteriores, o Wordpress funcionou normal. Mas quando separou, mesmo com todas as configurações (aparentemente) certinhas, a página do apache insiste em aparecer.
Este é meu provisioning.yml
---
- hosts: database
handlers:
- name: restart mysql
service:
name: mysql
state: restarted
become: yes
tasks:
- name: 'Instala pacotes de dependência do sistema operacional'
apt:
name: "{{ item }}"
state: latest
become: yes
with_items:
- mysql-server-5.6
- python-mysqldb
- name: 'Cria o banco do MySQL'
mysql_db:
name: wordpress_db
login_user: root
state: present
- name: 'Cria o usuário MySQL'
mysql_user:
login_user: root
name: wordpress_user
password: 12345
priv: 'wordpress_db.*:ALL'
state: present
host: "{{ item }}"
with_items:
- 'localhost'
- '127.0.0.1'
- '172.17.177.40'
- name: 'Configura MySQL para aceitar conexões remotas'
copy:
src: 'files/my.cnf'
dest: '/etc/mysql/my.cnf'
become: yes
notify:
- restart mysql
- hosts: wordpress
handlers:
- name: restart apache
service:
name: apache2
state: restarted
tasks:
- name: 'Instala pacotes de dependência do sistema operacional'
apt:
name: "{{ item }}"
state: latest
become: yes
with_items:
- php5
- apache2
- libapache2-mod-php5
- php5-gd
- libssh2-php
- php5-mcrypt
- php5-mysql
- name: 'Baixa o arquivo de instalacao do Wordpress'
get_url:
url: 'https://wordpress.org/wordpress-5.0.tar.gz'
dest: '/tmp//wordpress.tar.gz'
- name: 'Decompacta o Wordpress'
unarchive:
src: '/tmp//wordpress.tar.gz'
dest: '/var/www/'
remote_src: yes
become: yes
- name: 'Copia arquivo wp-config'
copy:
src: '/var/www/wordpress/wp-config-sample.php'
dest: /var/www/wordpress/wp-config.php
remote_src: yes
become: yes
- name: 'Configura o wp-config com as entradas do banco de dados'
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'}
- { regex: 'localhost', value: '172.17.177.42'}
become: yes
- name: 'Configura Apache para servir o Wordpress'
copy:
src: 'files/000-default.conf'
dest: '/etc/apache2/sites-available/000-default.conf'
become: yes
notify:
- restart apache
Se eu vou na url direta (http://172.17.177.40/wp-admin/install.php), aparece
Not Found The requested URL /wp-admin/install.php was not found on this server.
Apache/2.4.7 (Ubuntu) Server at 172.17.177.40 Port 80
Alguém consegue me ajudar?