1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_collection_pretix.git synced 2024-10-28 22:01:03 +01:00
ansible_collection_pretix/roles/postgres/tasks/packages.yml

57 lines
1.4 KiB
YAML
Raw Normal View History

---
- name: Update apt repo-cache on debian/ubuntu hosts
become: true
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
- name: Install Required packages
become: true
ansible.builtin.package:
2024-10-08 00:03:23 +02:00
name: "{{ item }}"
state: 'present'
2024-10-08 00:03:23 +02:00
with_items:
- 'apt-transport-https'
- 'python3-psycopg2'
- name: Create directory for PostgreSQL repository key
become: true
ansible.builtin.file:
path: "{{ item }}"
state: 'directory'
mode: '0755'
owner: 'root'
group: 'root'
with_items:
- '/usr/share/postgresql-common'
- '/usr/share/postgresql-common/pgdg'
- name: Download the PostgreSQL signing key
2024-10-08 00:03:23 +02:00
become: true
ansible.builtin.get_url:
url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
dest: '/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc'
2024-10-08 00:03:23 +02:00
checksum: 'sha256:0144068502a1eddd2a0280ede10ef607d1ec592ce819940991203941564e8e76'
owner: 'root'
group: 'root'
mode: '0644'
- name: Create Apt Repository
become: true
ansible.builtin.template:
src: 'templates/pgdg.list.j2'
dest: '/etc/apt/sources.list.d/pgdg.list'
owner: 'root'
group: 'root'
mode: '0644'
2024-10-08 00:03:23 +02:00
- name: Install PostgreSQL
become: true
ansible.builtin.apt:
2024-10-09 02:16:11 +02:00
name: "{{ item }}"
2024-10-08 00:03:23 +02:00
state: 'present'
update_cache: true
cache_valid_time: 0
install_recommends: true
2024-10-09 02:16:11 +02:00
with_items: "{{ postgres__packages }}"