library/roles/postgresql/tasks/manage_pg_db.yml: Ansible 2 compatibility

This commit is contained in:
Andrea Dell'Amico 2016-10-05 17:54:14 +02:00
parent 6c3822e2e8
commit 549e18af31
1 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@
become: True become: True
become_user: postgres become_user: postgres
postgresql_user: user={{ item.user }} password={{ item.pwd }} role_attr_flags={{ item.roles }} port={{ psql_db_port }} state={{ item.userstate | default('present') }} postgresql_user: user={{ item.user }} password={{ item.pwd }} role_attr_flags={{ item.roles }} port={{ psql_db_port }} state={{ item.userstate | default('present') }}
with_items: '{{ psql_db_data }}' with_items: '{{ psql_db_data | default(omit) }}'
when: item.roles is defined when: item.roles is defined
tags: [ 'postgresql', 'postgres', 'pg_db' ] tags: [ 'postgresql', 'postgres', 'pg_db' ]
@ -11,7 +11,7 @@
become: True become: True
become_user: postgres become_user: postgres
postgresql_db: db={{ item.name }} port={{ psql_db_port }} encoding={{ item.encoding }} owner={{ item.user }} template=template0 state={{ item.state | default('present') }} postgresql_db: db={{ item.name }} port={{ psql_db_port }} encoding={{ item.encoding }} owner={{ item.user }} template=template0 state={{ item.state | default('present') }}
with_items: '{{ psql_db_data }}' with_items: '{{ psql_db_data | default(omit) }}'
when: item.managedb when: item.managedb
tags: [ 'postgresql', 'postgres', 'pg_db' ] tags: [ 'postgresql', 'postgres', 'pg_db' ]
@ -19,7 +19,7 @@
become: True become: True
become_user: postgres become_user: postgres
postgresql_user: user={{ item.user }} password={{ item.pwd }} port={{ psql_db_port }} postgresql_user: user={{ item.user }} password={{ item.pwd }} port={{ psql_db_port }}
with_items: '{{ psql_db_data }}' with_items: '{{ psql_db_data | default(omit) }}'
when: when:
- item.pwd is defined - item.pwd is defined
- item.roles is not defined - item.roles is not defined