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

Missing vars_files in update_pgcluster.yml #477

Closed roks531 closed 1 year ago

roks531 commented 1 year ago

Description of the problem:

I am just testing the newest additions of the update playbook and I found out that there is a missing vars_files in the update_pgcluster.yml for task name: "(1/4) PRE-UPDATE: Perform Pre-Checks". The update_pgcluster.yml playbook therefore fails.

Result of running ansible-playbook update_pgcluster.yml:

PLAY [(1/4) PRE-UPDATE: Perform Pre-Checks] ********************************************************************************************************************************

TASK [Running Pre-Checks] **************************************************************************************************************************************************

TASK [update : [Pre-Check] (ALL) Test PostgreSQL DB Access] ****************************************************************************************************************
fatal: [192.168.1.101]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'postgresql_port' is undefined. 'postgresql_port' is undefined\n\nThe error appears to be in '/home/user/postgresql_cluster/roles/update/tasks/pre_checks.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: '[Pre-Check] (ALL) Test PostgreSQL DB Access'\n  ^ here\n"}

Resolution: Add the missing

  vars_files:
    - vars/main.yml

to the task name: "(1/4) PRE-UPDATE: Perform Pre-Checks"

vitabaks commented 1 year ago

Thank you @roks531 for notifying! I'll fix it.

This commit added the variable postgresql_port

Definitely I should add a update_pgcluster.yml playbook to the tests.

vitabaks commented 1 year ago

Fixed here https://github.com/vitabaks/postgresql_cluster/pull/478