Adding a new user or database in postgres - project-sunbird/sunbird-devops GitHub Wiki

  • Open file ansible/group_vars/postgresql-master
  • Add a new the entry in postgresql_databases similar to
  - name: "{{kong_postgres_database}}"
  • Add a new the entry in postgresql_databases similar to
  - name: "{{kong_postgres_user}}"
    password: "{{kong_postgres_password}}"
    db: "{{kong_postgres_database}}"
    priv: "ALL"
  • Make sure all the variables are defines in ansible/group_vars/<environment-name>

  • Ensure there is a entry in postgresql_hba_entries to allow traffic for this user or all from the ip subnet desired. Example below

  - { type: host, database: all, user: all, address: '{{ swarm_address_space }}', auth_method: md5 }
  • Push the above code and run the job Postgresql_Master