erro ao criar banco de dados usando ansible on centos 7

2

Estou tentando instalar o banco de dados mysql AND setup usando ANSIBLE no CentOS7 (não tenho idéia de por que toda a documentação do mundo agora só fala sobre o Ubuntu e NO CentOS mais ... realmente triste!)

aqui está o meu arquivo create_db.yml

---
- name: Install Python MySQLdb
yum: name=MySQL-python state=latest

- name: Create the Drupal database
mysql_db: db={{ db_name }} state=present

- name: Create the Drupal user
mysql_user: >
name={{ db_user }}
password={{ db_password }}
priv={{ db_name }}.*:ALL
host=localhost

TAMBÉM aqui está o meu arquivo setup.yml

---

- name: Install MySQL server
yum: name=mariadb-server state=latest

- name: Install php apache modules
  yum: name=php-gd state=latest

- name: Install php apache modules
 yum: name=php-ldap state=latest

- name: Install php apache modules
 yum: name=php-odbc state=latest

- name: Install php apache modules
 yum: name=php-pear state=latest

- name: Install php apache modules
yum: name=php-xml state=latest

- name: Install php apache modules
yum: name=php-xmlrpc state=latest

- name: Install php apache modules
yum: name=php-mbstring state=latest

- name: Install php apache modules
yum: name=php-snmp state=latest

- name: Install php apache modules
yum: name=php-soap state=latest

- name: Install php apache modules
yum: name=curl state=latest

- name: Install php apache modules
yum: name=curl-devel state=latest

- name: Install MySQL module for PHP
yum: name=php-mysql state=latest

AGORA, quando ansible está sendo executado para instalá-lo, aqui está o erro que recebo

TASK: [mysql | Install MySQL server] ******************************************
ok: [ansiblev1]

TASK: [mysql | Install php apache modules] ************************************
ok: [ansiblev1]

TASK: [mysql | Install php apache modules] ************************************
changed: [ansiblev1]

TASK: [mysql | Install php apache modules] ************************************
changed: [ansiblev1]

TASK: [mysql | Install php apache modules] ************************************
changed: [ansiblev1]

TASK: [mysql | Install php apache modules] ************************************
ok: [ansiblev1]

TASK: [mysql | Install php apache modules] ************************************
changed: [ansiblev1]

TASK: [mysql | Install php apache modules] ************************************
changed: [ansiblev1]

TASK: [mysql | Install php apache modules] ************************************
changed: [ansiblev1]

TASK: [mysql | Install php apache modules] ************************************
changed: [ansiblev1]

TASK: [mysql | Install php apache modules] ************************************
ok: [ansiblev1]

TASK: [mysql | Install php apache modules] ************************************
changed: [ansiblev1]

TASK: [mysql | Install MySQL module for PHP] **********************************
changed: [ansiblev1]

TASK: [mysql | Install Python MySQLdb] ****************************************
changed: [ansiblev1]

TASK: [mysql | Create the Drupal database] ************************************
failed: [ansiblev1] => {"failed": true}
msg: unable to connect, check login_user and login_password are correct, or    alternatively check ~/.my.cnf contains credentials

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
       to retry, use: --limit @/home/bbusari/site.retry

ansiblev1                  : ok=18   changed=10   unreachable=0    failed=1

O que eu faço para resolver isso? Rodando o CentOS 7 e ansible-1.8.2-1.el7.noarch

Obrigado

    
por grant tailor 04.02.2015 / 22:40

1 resposta

0

Para responder à pergunta sobre como garantir que o MariaDB seja iniciado:

- name: Set MariaDB to start now and on boot
  service: name=mysql state=started enabled=yes
    
por 15.01.2016 / 17:16