On Wed, 04 Feb 2015 13:04 -0800, Eff Ggl <[email protected]>
wrote:
> 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

Have you installed MySQL before and changed the password? If so, specify
the user/password with privileges to create databases.

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

- name: Create the Drupal database
  mysql_db: 
    name: db_name
    login_user:  XXX
    login_password: XXX
    state: present
  
- name: Create the Drupal user
  mysql_user:
    name: db_user
    password: db_password
    priv: "{{ db_name }}.*:ALL"
    host: localhost

You can simplify your setup.yml playbook too:

- name: Install packages
  yum:
    name: "{{ item }}"
    state: latest
  with_items:
    - mariadb-server
    - php-gd
    - php-ldap
    - php-odbc
    - php-pear
    - php-xml
    - php-xmlrpc
    - php-mbstring
    - php-snmp
    - php-soap
    - curl
    - curl-devel
    - php-mysql

Giovanni

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1423133253.268009.223426917.0994C27F%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to