Skip to content

Commit

Permalink
Merge pull request ANXS#64 from ti-mo/master
Browse files Browse the repository at this point in the history
Added apt cache update/valid-time
  • Loading branch information
pjan committed Feb 6, 2015
2 parents 47774ac + 7d772d5 commit 55e9dca
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions tasks/extensions/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 2 additions & 0 deletions tasks/extensions/dev_headers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions tasks/extensions/postgis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"
Expand Down
16 changes: 10 additions & 6 deletions tasks/install.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
Expand All @@ -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}}"
Expand Down

0 comments on commit 55e9dca

Please sign in to comment.