Skip to content

Commit

Permalink
Sparate users's tasks in functional units
Browse files Browse the repository at this point in the history
  • Loading branch information
Copperfield committed Jul 8, 2014
1 parent 87118e4 commit c201464
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
- include: configure.yml
- include: users.yml
- include: databases.yml
- include: users_priv.yml
- include: monit.yml
when: monit_protection is defined and monit_protection == true
10 changes: 0 additions & 10 deletions tasks/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,3 @@
login_host: "{{item.host | default('localhost')}}"
with_items: postgresql_users
when: postgresql_users|length > 0

- name: PostgreSQL | Update the user privileges
postgresql_user:
name: "{{item.name}}"
db: "{{item.db}}"
priv: "{{item.priv | default('ALL')}}"
state: present
login_host: "{{item.host | default('localhost')}}"
with_items: postgresql_user_privileges
when: postgresql_users|length > 0
11 changes: 11 additions & 0 deletions tasks/users_priv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# file: postgresql/tasks/users_priv.yml

- name: PostgreSQL | Update the user privileges
postgresql_user:
name: "{{item.name}}"
db: "{{item.db}}"
priv: "{{item.priv | default('ALL')}}"
state: present
login_host: "{{item.host | default('localhost')}}"
with_items: postgresql_user_privileges
when: postgresql_users|length > 0

0 comments on commit c201464

Please sign in to comment.