diff --git a/tasks/extensions/contrib.yml b/tasks/extensions/contrib.yml index ccb8b739..d6742d16 100644 --- a/tasks/extensions/contrib.yml +++ b/tasks/extensions/contrib.yml @@ -4,6 +4,8 @@ apt: name: "postgresql-contrib-{{postgresql_version}}" state: present + update_cache: yes + cache_valid_time: "{{apt_cache_valid_time | default (3600)}}" notify: - restart postgresql diff --git a/tasks/extensions/dev_headers.yml b/tasks/extensions/dev_headers.yml index d307bb14..4cd86c8c 100644 --- a/tasks/extensions/dev_headers.yml +++ b/tasks/extensions/dev_headers.yml @@ -4,5 +4,7 @@ apt: name: libpq-dev state: present + update_cache: yes + cache_valid_time: "{{apt_cache_valid_time | default (3600)}}" notify: - restart postgresql diff --git a/tasks/extensions/postgis.yml b/tasks/extensions/postgis.yml index 38a369c2..d285ba04 100644 --- a/tasks/extensions/postgis.yml +++ b/tasks/extensions/postgis.yml @@ -4,6 +4,8 @@ apt: name: "{{item}}" state: present + update_cache: yes + cache_valid_time: "{{apt_cache_valid_time | default (3600)}}" with_items: - libgeos-c1 - "postgresql-{{postgresql_version}}-postgis-{{postgresql_ext_postgis_version}}" diff --git a/tasks/install.yml b/tasks/install.yml index fc520aae..861d83fd 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,11 +1,5 @@ # file: postgresql/tasks/install.yml -- name: PostgreSQL | Make sure the dependencies are installed - apt: - pkg: "{{item}}" - state: present - with_items: ["python-psycopg2", "python-pycurl"] - - name: PostgreSQL | Add PostgreSQL repository apt-key apt_key: id: "{{ postgresql_apt_key_id }}" @@ -17,10 +11,20 @@ repo: "{{ postgresql_apt_repository }}" state: present +- name: PostgreSQL | Make sure the dependencies are installed + apt: + pkg: "{{item}}" + state: present + update_cache: yes + cache_valid_time: "{{apt_cache_valid_time | default (3600)}}" + with_items: ["python-psycopg2", "python-pycurl"] + - name: PostgreSQL | Install PostgreSQL apt: name: "{{item}}" state: present + update_cache: yes + cache_valid_time: "{{apt_cache_valid_time | default (3600)}}" environment: postgresql_env with_items: - "postgresql-{{postgresql_version}}"