Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-150788

fix: when does not prevent template expansion in name with import_role

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • None
    • Low
    • rhel-system-roles
    • 0
    • Dev ack
    • False
    • False
    • Hide

      None

      Show
      None
    • Yes
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • Bug Fix
    • Hide
      Cause: The `when` condition in the `block` does not prevent Ansible from attempting to
      expand templates with undefined values used in the `name` of tasks within the block.

      Consequence: The role issues undefined variable errors when the role is used
      with `import_role` and modules with no path set.

      Fix: In the `name` for the tasks, use the `d` filter to provide a value
      to use if the variable is undefined. This will allow usage with `import_role`
      to work, and usage with `include_role` will get the extra information in
      the name.

      Result: The role does not error when used with `import_role` and modules
      with no `path`.

      Signed-off-by: Rich Megginson <rmeggins@redhat.com>

      ## Summary by Sourcery

      Bug Fixes:
      - Prevent undefined variable errors by providing default values for selinux module path variables used in task names.
      Show
      Cause: The `when` condition in the `block` does not prevent Ansible from attempting to expand templates with undefined values used in the `name` of tasks within the block. Consequence: The role issues undefined variable errors when the role is used with `import_role` and modules with no path set. Fix: In the `name` for the tasks, use the `d` filter to provide a value to use if the variable is undefined. This will allow usage with `import_role` to work, and usage with `include_role` will get the extra information in the name. Result: The role does not error when used with `import_role` and modules with no `path`. Signed-off-by: Rich Megginson < rmeggins@redhat.com > ## Summary by Sourcery Bug Fixes: - Prevent undefined variable errors by providing default values for selinux module path variables used in task names.
    • Proposed
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      Cause: The `when` condition in the `block` does not prevent Ansible from attempting to
      expand templates with undefined values used in the `name` of tasks within the block.

      Consequence: The role issues undefined variable errors when the role is used
      with `import_role` and modules with no path set.

      Fix: In the `name` for the tasks, use the `d` filter to provide a value
      to use if the variable is undefined. This will allow usage with `import_role`
      to work, and usage with `include_role` will get the extra information in
      the name.

      Result: The role does not error when used with `import_role` and modules
      with no `path`.

      Signed-off-by: Rich Megginson <rmeggins@redhat.com>

        1. Summary by Sourcery

      Bug Fixes:

      • Prevent undefined variable errors by providing default values for selinux module path variables used in task names.

              rmeggins@redhat.com Richard Megginson
              rmeggins@redhat.com Richard Megginson
              Richard Megginson Richard Megginson
              David Jez David Jez
              Mirek Jahoda Mirek Jahoda
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: