From 10a17542855dd727ad5ebf965b23eca5e82988f0 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 18 Jul 2021 18:36:58 -0400 Subject: [PATCH] Adjust package lists per Debian version --- roles/pvc/tasks/patroni/main.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/roles/pvc/tasks/patroni/main.yml b/roles/pvc/tasks/patroni/main.yml index fc5ba3d..d8eeef0 100644 --- a/roles/pvc/tasks/patroni/main.yml +++ b/roles/pvc/tasks/patroni/main.yml @@ -1,13 +1,25 @@ --- -- name: install patroni packages via apt - apt: - name: +- set_fact: + package_list: - python3-psycopg2 - - python-psycopg2 - python3-kazoo + - python-psycopg2 - python-kazoo - patroni - postgresql-11 + when: debian_version|int <= 10 + +- set_fact: + package_list: + - python3-psycopg2 + - python3-kazoo + - patroni + - postgresql-11 + when: debian_version|int >= 11 + +- name: install patroni packages via apt + apt: + name: "{{ package_list }}" state: latest update-cache: yes