Help needed to construct a cvs list of values from a dictionary

I have a dictionary like this

customers: abc: id: 1 status: active def: id: 2 status: inactive ghi: id: 3 status: active jkl: id: 4 status: active

What’s the easiest (Ansible) way to construct a string like below assigned to a variable of the active customers only?

abc,ghi,jkl