Ansible: Extracting multiple attributes from a list of dicts

I've been writing a bunch of ansible playbooks, and in one case I had to transform a list of dicts to extract two attributes from each dict and create a new list of dicts. i.e., given a list like this: entities: - id: 123 label: Label 1 type: foo status: enabled - id: 234 label: Label 2 type: foo status: enabled - id: 345 label: Label 3 type: bar status: enabled I need to transform it into this:…