From d37f6c0e3fd7ccddd1b4f7a889714f862a9d40e5 Mon Sep 17 00:00:00 2001 From: Alexis Ben Miloud--Josselin Date: Thu, 30 Mar 2023 13:19:13 +0200 Subject: [PATCH] PgBouncer: add handler (restart) --- CHANGELOG.md | 1 + pgbouncer/handlers/main.yml | 5 +++++ pgbouncer/tasks/main.yml | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 pgbouncer/handlers/main.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 65fc4ab1..51ce155e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The **patch** part changes is incremented if multiple releases happen the same m * apt: with Debian 12, backports are installed but disabled by default * openvpn: updated the README file +* pgbouncer: add handler to restart the service ### Fixed diff --git a/pgbouncer/handlers/main.yml b/pgbouncer/handlers/main.yml new file mode 100644 index 00000000..f539a226 --- /dev/null +++ b/pgbouncer/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: Restart PgBouncer + ansible.builtin.systemd: + name: pgbouncer.service + state: restarted diff --git a/pgbouncer/tasks/main.yml b/pgbouncer/tasks/main.yml index fefef4e1..1d76931f 100644 --- a/pgbouncer/tasks/main.yml +++ b/pgbouncer/tasks/main.yml @@ -7,11 +7,14 @@ ansible.builtin.lineinfile: path: /etc/default/pgbouncer line: ulimit -n 65536 + notify: Restart PgBouncer - name: Add config file for PgBouncer ansible.builtin.template: src: pgbouncer.ini.j2 dest: /etc/pgbouncer/pgbouncer.ini + notify: Restart PgBouncer - name: Populate userlist.txt ansible.builtin.template: src: userlist.txt.j2 dest: /etc/pgbouncer/userlist.txt + notify: Restart PgBouncer