Skip to content

Commit

Permalink
Merge pull request #1 from ssmirr/master
Browse files Browse the repository at this point in the history
specifying list of users to be created
  • Loading branch information
ssmirr authored Apr 4, 2018
2 parents 1820942 + 6b9cfbf commit cc964d3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
users:
- "{{project_name}}"
17 changes: 10 additions & 7 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@
- mariadb-devel
- name: start mariadb
service: name=mysql enabled=yes state=started
- name: add maria database users
mysql_user:
name: "{{project_name}}"
password: "{{project_name}}"
host: localhost
priv: "*.*:ALL"
state: present

- name: create project_name database
mysql_db:
name: "{{item}}"
state: present
with_items: "{{databases}}"

- name: add maria database users
mysql_user:
name: "{{item}}"
password: "{{item}}"
host: localhost
priv: "*.*:ALL"
state: present
with_items: "{{users}}"

0 comments on commit cc964d3

Please sign in to comment.