0

I use the ansible role installed PostgreSQL. Its default version is 10.6. How to set another version to install? Such as 12.4.

$ psql --version
psql (PostgreSQL) 10.6
Miantian
  • 177
  • 1
  • 3
  • 9

1 Answers1

2

I think you can use the variables postgresql_version and postgresql_packages since this role installs by default the Postgres versions that come on your OS(Check at the end of role variable section ) but you may need to change your package manager source list to point to the Postgres version that you want to install

- hosts: database
  become: yes
  roles:
    - geerlingguy.postgresql
      vars:
        postgresql_version: '12'
        postgresql_packages:
         - postgresql-12
         - postgresql-contrib
         - libpq-dev
Javier Galarza
  • 81
  • 1
  • 1
  • 7