ansible-collections/community.postgresql

Restore - task continues even after the restoration is complete

Open

#917 opened on Apr 17, 2026

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Python (116 forks)auto 404
help wanted

Repository metrics

Stars
 (142 stars)
PR merge metrics
 (PR metrics pending)

Description

SUMMARY

When we launch a DUMP restoration, in few cases, the ansible tasks continues even after the restoration is complete

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.postgresql.postgresql_db

ANSIBLE VERSION
ansible [core 2.16.13]
  config file = None
  configured module search path = ['/home/tbrusson/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/tbrusson/.local/lib/python3.12/site-packages/ansible
  ansible collection location = /home/tbrusson/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/tbrusson/.local/bin/ansible
  python version = 3.12.9 (main, Aug 14 2025, 00:00:00) [GCC 14.2.1 20250110 (Red Hat 14.2.1-7)] (/usr/bin/python3)
  jinja version = 3.1.6
  libyaml = True
COLLECTION VERSION
Collection        Version
----------------- -------
community.general 8.6.1
CONFIGURATION
CONFIG_FILE() = None
OS / ENVIRONMENT

Red Hat Enterprise Linux release 8.10

STEPS TO REPRODUCE

Create a playbook to restore a big dump file:

    - name: Restore database from previous backup
      community.postgresql.postgresql_db:
        name: "{{ application_name }}"
        state: restore
        target: "{{ dump_dest }}{{ dump_name }}"
        target_opts: "-d {{ application_name }}"
EXPECTED RESULTS

No error: the DUMP file is imported and the task stopped jsut after the end of the psql command

ACTUAL RESULTS

The DUMP file is correctly imported but the ansible task continues and are stopped only by jenkins timeout

11:23:12  TASK [database : Restore database from previous backup] ************************
Cancelling nested steps due to timeout
13:19:17  Sending interrupt signal to process
13:19:26  ERROR! A worker was found in a dead state
13:19:26  /var/lib/jenkins/workspace/XXX/application/XXX/durable-ec0775f9/script.sh.copy: line 2:   246 Terminated              ansible-playbook dump.yml $VERBOSE_ANSIBLE --inventory=./inventories/$ENV -e app_env=$ENV -e action_dump=$ACTION -e dump_name=$NOM_DUMP -e is_ssh_key=$IS_SSH -e nni=$LOGIN -e password=$PASSWORD -e password_dl=$PASSWORD_SESAME -e ansible_sudo_pass=$PASSWORD -e database_password=\'${DATABASE_PASSWORD}\'
13:19:26  script returned exit code 143

Contributor guide