set object property using set_fact

Hi,

I am new to Ansible an trying to achieve this below. Is this possible to set a dictionary property using key in Ansible.

vars: mydict: keyA: path: ‘path of device A’ error_files: [] keyB: path: ‘path of device B’ error_files: []

`

  • name: collect errors of device A
    set_fact:
    mydict[‘keyA’].error_files: “mydict[‘keyA’].error_files + item ”
    loop: “{{error_files_ofdeviceA }}”
    `

Thanks

On the same not, can I use something like below -

`

  • name: setting up item property
    set_fact:
    item.founderror: true
    loop: “{{ device_list }}”
    `

here device_list is a list of object where I would like to add/update a property founderror.

Thanks