Changed modules from 'action' to 'postgresql_db' and 'postgresql_user', introduced into Ansible as of version 0.6. Also changed parameter 'user' to 'name' as specified in the current documentation.

This commit is contained in:
Steve Tjoa 2013-11-02 21:44:16 -07:00
parent ca03ba6331
commit d48255feca

View file

@ -28,14 +28,14 @@
vars: vars:
dbname: myapp dbname: myapp
dbuser: django dbuser: django
dbpassword: mysupersecreetpassword dbpassword: mysupersecretpassword
tasks: tasks:
- name: ensure database is created - name: ensure database is created
action: postgresql_db db={{dbname}} postgresql_db: name={{dbname}}
- name: ensure user has access to database - name: ensure user has access to database
action: postgresql_user db={{dbname}} user={{dbuser}} password={{dbpassword}} priv=ALL postgresql_user: db={{dbname}} name={{dbuser}} password={{dbpassword}} priv=ALL
- name: ensure user does not have unnecessary privilege - name: ensure user does not have unnecessary privilege
action: postgresql_user user={{dbuser}} role_attr_flags=NOSUPERUSER,NOCREATEDB postgresql_user: name={{dbuser}} role_attr_flags=NOSUPERUSER,NOCREATEDB