PATH - /group_vars/all.yml
INICIO
wp_username: 'wordpress_user' wp_user_password: '12345' wp_db_name: 'wordpress_db' wp_installation_dir: '/var/www/wordpress'
FIM
PATH - /group_vars/wordpress.yml
INICIO
wp_host_ip: '192.168.15.40'
FIM
PATH - /group_vars/database.yml
INICIO
wp_db_ip: '192.168.15.41'
FIM
Nome do arquivo - Provisioning.yml
INICIO
- hosts: database
roles:
- mysql
- hosts: wordpress
roles:
- webserver
- wordpress
FIM
ERROR :
PLAY [database] ***
TASK [Gathering Facts] **** ok: [192.168.15.41]
TASK [mysql : Instala pacotes de dependencia do sistema operacional] ** ok: [192.168.15.41] => (item=mysql-server-5.6) ok: [192.168.15.41] => (item=python-mysqldb)
TASK [mysql : Cria o banco no MySQL] ** ok: [192.168.15.41]
TASK [mysql : Cria usuario no MySQL] ** fatal: [192.168.15.41]: FAILED! => {"msg": "'wp_host_ip' is undefined"}
PLAY RECAP **** 192.168.15.41 : ok=3 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0