Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-25580

Adoption: edpm_boostrap_command ignores failures except for the last command

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • None
    • edpm-ansible
    • None
    • RHOS Upgrades 2025 Sprint 21
    • 1
    • Moderate

      To Reproduce Steps to reproduce the behavior:

      • Provide `edpm_bootstrap_command` with multiple commands, where one of the commands fails but the last one succeeds.
      • The bootstrap as a whole is considered successful and the `edpm.bootstrap.hash` fact is written to prevent re-executing the same command.

      Expected behavior

      • If one command in the `edpm_bootstrap_command` fails, i'd expect the bootstrap as a whole to fail. If there are commands that can fail expectedly, they should be suffixed with `|| true`.
      • I believe we should unconditionally prepend `set -e` to edpm_bootstrap_command when we execute it, to ensure any failed command somewhere in the middle of the bootstrap snippet fails the whole bootstrap.
      • From discussion: we should keep the same behavior as `ansible.builtin.shell` but recommend using set -e in the documentation examples.
      • Our upstream bootstrap commands already have `set -euxo pipefail` but it's not included in the downstream snippets.

      Bug impact

      • This came to bite us at a customer. Will link the relevant conversation in a private comment.

      Known workaround

      • Include `set -e` at the beginning when setting the value for `edpm_bootstrap_command` variable.

       

      Relevant code: https://github.com/openstack-k8s-operators/edpm-ansible/blob/43c8ae13d85939e9a3f9cddbe838cbe4616199f7/roles/edpm_bootstrap/tasks/bootstrap_command.yml 

              jstransk@redhat.com Jiri Stransky
              jstransk@redhat.com Jiri Stransky
              rhos-dfg-upgrades
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: