solar/examples/resources/simple/mariadb/users.yml

9 lines
301 B
YAML

- hosts: [service/mariadb]
sudo: yes
tasks:
# NOTE(eli): it will automatically create user if it does not exist
- command: docker exec -t {{name}} \
mysql -uroot -p{{root_password}} -e "GRANT ALL PRIVILEGES ON *.* TO '{{item.name}}'@'%' WITH GRANT OPTION"
with_items: users