Resources attached to the Road To DevOps tutorial https://blog.noobtoroot.xyz/road-to-devops/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

28 lines
684 B

- name: create a new database
become: yes
become_user: postgres
postgresql_db:
# login_unix_socket: /var/run/mysqld/mysqld.sock
name: '{{ DB_NAME }}'
state: present
- name: create a new user in database
become: yes
become_user: postgres
postgresql_user:
# login_unix_socket: /var/run/mysqld/mysqld.sock
db: '{{ DB_NAME }}'
name: '{{ DB_USER_NAME }}'
password: '{{ DB_USER_PASSWORD }}'
priv: ALL
expires: infinity
# - name: grant all privileges
# become: yes
# become_user: postgres
# postgresql_privs:
# db: "{{ 'DB_NAME' }}"
# privs: ALL
# type: database
# role: