Skip to content

UBI8 Ansible remediation tests fail #15157

Description

@macko1

Description of problem:

UBI8 Ansible remediation tests fail before remediation or scanning begins. The target container installs its system python3, which is Python 3.6. The Ansible controller's fact-gathering module imports annotations from __future__; Python 3.6 cannot parse that import.

SCAP Security Guide Version:

0.1.82

Operating System Version:

UBI8 (registry.access.redhat.com/ubi8).

Steps to Reproduce:

  1. Build the RHEL 8 data stream:

    # Build the data stream consumed by the container test.
    ./build_product rhel8 --datastream
  2. Build the UBI8 test target from the upstream UBI8 image, authorizing the existing local Ed25519 SSH key:

    # Pass the key that Automatus will use for SSH to the target image.
    podman build \
        --build-arg "CLIENT_PUBLIC_KEY=$(<"<public_key_file>")" \
        --tag ssg_test_suite_ubi8 \
        --file Dockerfiles/test_suite-ubi8 \
        Dockerfiles
  3. Define both rules and confirm that Bash remediation passes:

    # Test both user-initialization-file rules.
    RULES=(
        file_permission_user_init_files
        file_permission_user_init_files_root
    )
    
    # Run Bash remediation against the UBI8 target.
    python3 tests/automatus.py rule \
        --product rhel8 \
        --datastream build/ssg-rhel8-ds.xml \
        --duplicate-templates \
        --remove-platforms \
        --remove-ocp4-only \
        --remove-fips-certified \
        --dontclean \
        --logdir logs_ubi8_bash \
        --remediate-using bash \
        --container ssg_test_suite_ubi8 \
        -- "${RULES[@]}"
  4. Run the same tests with Ansible remediation:

    # Run Ansible remediation against the same UBI8 target.
    python3 tests/automatus.py rule \
        --product rhel8 \
        --datastream build/ssg-rhel8-ds.xml \
        --duplicate-templates \
        --remove-platforms \
        --remove-ocp4-only \
        --remove-fips-certified \
        --dontclean \
        --logdir logs_ubi8_ansible \
        --remediate-using ansible \
        --container ssg_test_suite_ubi8 \
        -- "${RULES[@]}"
  5. Inspect logs_ubi8_ansible/test_suite.log and the remediation verbose logs.

Actual Results:

The Ansible Gathering Facts task fails with:

SyntaxError: future feature annotations is not defined

Bash remediation tests pass for both rules. Ansible remediation fails for both rules when its setup module runs on the target Python 3.6 interpreter.

Expected Results:

The Ansible remediation test runs with an Ansible version and target Python interpreter that are mutually supported.

Additional Information/Debugging Steps:

  • Dockerfiles/test_suite-ubi8 installs python3 without selecting a newer interpreter.
  • The target interpreter compatibility needs an explicit solution: use an Ansible version supported by Python 3.6, or configure a supported newer target interpreter.
  • Do not install an arbitrary Python version without defining the supported UBI8 test matrix.

Activity

  1. added theissue type on Sep 30, 2026
  2. macko1 commented on Sep 30, 2026

    @macko1
    CollaboratorAuthor

    Important:
    Tests will need to be updated, not the UBI8 container.

  3. added
    RHELRed Hat Enterprise Linux product related.
    RHEL8Red Hat Enterprise Linux 8 product related.
    on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    RHELRed Hat Enterprise Linux product related.RHEL8Red Hat Enterprise Linux 8 product related.triaged

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions