Create a RDS mysql user using mysql_user module

609 views
Skip to first unread message

prateek gupta

unread,
Apr 11, 2014, 9:02:41 AM4/11/14
to ansibl...@googlegroups.com
Im trying to create a mysql user for the following 

#creating a sql user
 - hosts: localhost
 tasks:
    #- name: test
   mysql_user: host=abcde.us-west-2.rds.amazonaws.com login_user=klm login_password=msr123  name=sally password=msr123 state=absent


++++++++++2nd script++++++++++++
#creating a sql user
 - hosts: localhost
 
 -  mysql_user: host=abcde.us-west-2.rds.amazonaws.com login_user=klm login_password=msr123  name=sally password=msr123 state=absent







but i get the following error for both of it 
ERROR: Syntax Error while loading YAML script, sqluser.yml
Note: The error may actually appear before this position: line 4, column 2

 - hosts: localhost
 tasks:

James Tanner

unread,
Apr 11, 2014, 11:27:21 AM4/11/14
to ansibl...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-deve...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

"tasks:" should be indented and inline with "hosts"

http://docs.ansible.com/playbooks_intro.html#playbook-language-example

prateek gupta

unread,
Apr 14, 2014, 2:45:36 AM4/14/14
to ansibl...@googlegroups.com
Hey Thanks a lot thats working now But i have got a new error as of know 
Im able to get connected to rds using mysql command but when i try to run through ansible playbook i get the following error


PLAY [localhost] **************************************************************

GATHERING FACTS ***************************************************************
ok: [localhost]

TASK: [mysql_user host=abc5.us-west-2.rds.amazonaws.com login_port=3306 login_user=abc login_password=abc123 name=sally password=abc123 state=absent] ***
failed: [localhost] => {"failed": true}
msg: unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/root/sqluser.retry

localhost                  : ok=1    changed=0    unreachable=0    failed=1

Michael DeHaan

unread,
Apr 15, 2014, 5:45:45 PM4/15/14
to prateek gupta, ansibl...@googlegroups.com
Hi, 

Just a quick note that is a user question, not a development question, so in the future please post this to ansible...@googlegroups.com.  Thanks!


Reply all
Reply to author
Forward
0 new messages