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

fix: no longer use "item" as a loop variable

    • None
    • None
    • sst_system_roles
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • Bug Fix
    • None

      By using a different loop variable, we can avoid WARNING messages related to loop variables when calling the `selinux` role from another role.

      Fixes: https://github.com/linux-system-roles/selinux/issues/216 .

      Enhancement: Avoid the warning message:
      ```
      [WARNING]: TASK: fedora.linux_system_roles.selinux : Restore SELinux labels on filesystem tree: The loop variable 'item' is already in use.
      You should set the `loop_var` value in the `loop_control` option for the task to something else to avoid variable collisions and unexpected behavior.
      ```

      Reason: Although I am not aware of any errors when using the role `selinux` without this fix, the warning message (printed in bold and in a different than usual color - violet in my tests) adds lines to the output which can confuse users.

      Result: The warning message `[WARNING]: TASK: ... "The loop variable 'item' is already in use." is no longer displayed when calling the role from another role.

      Issue Tracker Tickets (Jira or BZ if any): N/A

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

              Created:
              Updated:
              Resolved: