vitabaks / postgresql_cluster

PostgreSQL High-Availability Cluster (based on Patroni). Automating with Ansible.
https://postgresql-cluster.org
MIT License
1.69k stars 411 forks source link

Fix: Disable privilege escalation for temp file deletion tasks #421

Closed vitabaks closed 1 year ago

vitabaks commented 1 year ago

Issue: https://github.com/vitabaks/postgresql_cluster/issues/414

Previously, tasks involving the deletion of temporary files, where delegation to localhost was employed, were unnecessarily requiring sudo privileges. This was causing issues during execution, as the tasks were prompting for a sudo password and failing if not provided.

To address this, we've added become: false to these tasks. This disables privilege escalation for these specific tasks, allowing them to execute without needing sudo permissions. It's important to note that this change doesn't affect the security or functionality of our playbook. Instead, it streamlines execution by eliminating unnecessary privilege requests.

This fix has been applied to all tasks involving the deletion of temporary files where delegate_to: localhost is used.

With this update, we expect smoother and more efficient playbook runs, improving our automation capabilities.