Created
September 10, 2017 22:24
-
-
Save dalethestirling/f02410ddf2b1b3369954243d34ca4bd7 to your computer and use it in GitHub Desktop.
Create Postgres DB user using lookup()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - name: Create db users | |
| postgresql_user: | |
| login_host: "{{ hostname }}" | |
| login_user: "{{ db_user }}" | |
| login_password: "{{ db_passwd }}" | |
| db: "{{ db }}" | |
| priv: "{{ db_priv }}" | |
| name: "{{ item }}" | |
| password: "{{ lookup('password', playbook_dir + '/' + db + '-' + item.user + '.passwd') }}" | |
| no_password_changes: yes | |
| with_items: "{{ db_user_list }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment