-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df4bc62
commit 11b5746
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
roles/setup_pgbouncer/tasks/rm_pgbouncer_install_config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
- name: Gather service facts | ||
ansible.builtin.service_facts: | ||
|
||
- name: Stop PgBouncer service | ||
ansible.builtin.systemd: | ||
name: "{{ pgbouncer_service_name }}" | ||
state: stopped | ||
enabled: false | ||
when: | ||
- ansible_facts.services[pgbouncer_service_name + '.service'] is defined | ||
- ansible_facts.services[pgbouncer_service_name + '.service'].state == 'running' | ||
become: true | ||
|
||
- name: Remove PgBouncer system user {{ pgbouncer_user }} | ||
ansible.builtin.user: | ||
name: "{{ pgbouncer_user }}" | ||
group: "{{ pgbouncer_group }}" | ||
state: absent | ||
remove: true | ||
force: true | ||
become: true | ||
|
||
- name: Remove PgBouncer system group {{ pgbouncer_group }} | ||
ansible.builtin.group: | ||
name: "{{ pgbouncer_group }}" | ||
state: absent | ||
become: true | ||
|
||
- name: Remove PgBouncer files and directory | ||
ansible.builtin.file: | ||
path: "{{ item }}" | ||
state: absent | ||
loop: | ||
- "{{ pgbouncer_config_file | dirname }}" | ||
- "{{ pgbouncer_systemd_unit_file | dirname }}" | ||
- "{{ pgbouncer_pid_file | dirname }}" | ||
- "{{ pgbouncer_log_file | dirname }}" | ||
become: true | ||
|
||
- name: Remove PgBouncer package | ||
ansible.builtin.package: | ||
name: "{{ pgbouncer_package_name }}" | ||
state: absent | ||
become: true | ||
|
||
- name: Remove openssl package | ||
ansible.builtin.package: | ||
name: "openssl" | ||
state: absent | ||
when: | ||
- pgbouncer_ssl | ||
become: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters