Repository URL to install this package:
|
Version:
1.0.0b1 ▾
|
# file: postgresql/tasks/install_apt.yml
# The standard ca-certs are needed because without them apt_key will fail to
# validate www.postgresql.org (or probably any other source).
- name: PostgreSQL | Make sure the CA certificates are available | apt
apt:
pkg: ca-certificates
state: present
- name: PostgreSQL | Add PostgreSQL repository apt-key | apt
apt_key:
id: "{{ postgresql_apt_key_id }}"
url: "{{ postgresql_apt_key_url }}"
state: present
when: postgresql_apt_key_url and postgresql_apt_key_id and postgresql_install_repository
- name: PostgreSQL | Add PostgreSQL repository | apt
apt_repository:
repo: "{{ postgresql_apt_repository }}"
state: present
when: postgresql_apt_repository | default('') != '' and postgresql_install_repository
- name: PostgreSQL | Add PostgreSQL repository preferences | apt
template:
src: etc_apt_preferences.d_apt_postgresql_org_pub_repos_apt.pref.j2
dest: /etc/apt/preferences.d/apt_postgresql_org_pub_repos_apt.pref
when: postgresql_apt_pin_priority and postgresql_install_repository
- name: PostgreSQL | Make sure the dependencies are installed | apt
apt:
pkg: "{{ postgresql_apt_dependencies }}"
state: present
update_cache: yes
cache_valid_time: "{{apt_cache_valid_time | default (3600)}}"
- name: PostgreSQL | Install PostgreSQL | apt
apt:
name:
- "postgresql-{{postgresql_version}}"
- "postgresql-client-{{postgresql_version}}"
- "postgresql-contrib-{{postgresql_version}}"
state: present
update_cache: yes
default_release: "{{postgresql_default_release | default(ansible_distribution_release + '-pgdg')}}"
cache_valid_time: "{{apt_cache_valid_time | default (3600)}}"
environment: "{{postgresql_env}}"
- name: PostgreSQL | PGTune | apt
apt:
name: pgtune
state: present
update_cache: yes
cache_valid_time: "{{apt_cache_valid_time | default (3600)}}"
environment: "{{postgresql_env}}"
when: postgresql_pgtune