mysql_user priv problem

51 views
Skip to first unread message

Marko Lisica

unread,
Apr 2, 2014, 7:09:32 AM4/2/14
to ansible...@googlegroups.com
Hello,

I have a task that reads user and db and grants permisions on specific db for specific user.

https://gist.github.com/markotitel/9931850

Problem is that only last DB from list is granted for specific user.

I have same task with same vars for folder creation and it works fine.

https://gist.github.com/markotitel/9931867

What am I doing wrong?

Marko Lisica

unread,
Apr 2, 2014, 7:22:15 AM4/2/14
to ansible...@googlegroups.com
UPDATE:

Here is debug msg from mysql task that looks fine, so I guess something about mysql_user module may be odd.

ok: [vagrant] => (item=({'webdir': ['woodpecker', 'aligator'], 'user': 'detlic'}, 'aligator')) => {
    "item": [
        {
            "user": "detlic",
            "webdir": [
                "woodpecker",
                "aligator"
            ]
        },
        "aligator"
    ],
    "msg": "name=detlic priv=aligator.*:ALL"
}
ok: [vagrant] => (item=({'webdir': ['woodpecker', 'aligator'], 'user': 'detlic'}, 'woodpecker')) => {
    "item": [
        {
            "user": "detlic",
            "webdir": [
                "woodpecker",
                "aligator"
            ]
        },
        "woodpecker"
    ],
    "msg": "name=detlic priv=woodpecker.*:ALL"

Marko Lisica

unread,
Apr 2, 2014, 8:41:36 AM4/2/14
to ansible...@googlegroups.com
I am sorry for spamming like this but just got into my mind to try something:

- name: grant privileges on databases
  raw: mysql -e "grant all privileges on {{ item.1 }}.* to {{ item.0.user}}@localhost"
  with_subelements:
      - users
      - db
this task works as expected, and I beleive this might be a bug in mysql_user module.



On Wednesday, April 2, 2014 1:09:32 PM UTC+2, Marko Lisica wrote:

Michael DeHaan

unread,
Apr 2, 2014, 11:47:27 AM4/2/14
to ansible...@googlegroups.com
Yep, probably is.

I think you filed a ticket on this earlier today, so we're good to go.

(If you'd like to attempt a fix or further debugging, that would be welcome too!)



--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e6fee44a-53e4-46e8-838a-88852aafd6c8%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Marko Lisica

unread,
Apr 2, 2014, 5:28:37 PM4/2/14
to ansible...@googlegroups.com
Hi,

I would gladly fix it but dont know programming much, I am ultimate noobster.


On Wednesday, April 2, 2014 1:09:32 PM UTC+2, Marko Lisica wrote:
Reply all
Reply to author
Forward
0 new messages