Duplicate dict key

Updating to 2.0 throws a new error (certainly not an unreasonable error) in a play I’ve used for a while:
found a duplicate dict key

I know I’m likely abusing behavior, but I’m hoping someone might offer an alternate approach :slight_smile:

At a high level, I’m looking to

  1. take output from a command
  2. run regex tests against it against a set of dictionary keys
  3. on match, execute a command with a dict value

But some of the dict keys duplicate others

More specifically, I’m running SuSE and want to restart services on a zypper update when they show up as being “stale” (zypper -ps)
The major issue here, service names vary from version to version, and do not match precisely with the status output (zypper -ps)

I could possibly reverse the key value pairings, but there’s still likely to be duplication.

I’d not be surprised if this wasn’t working correctly before 2.0, but just silently discarding the duplication.

Thanks

that is exactly what was happening before 2.0, only the last value for
the key was used, the rest were discarded.