Hi, you’ve got it the other way around?
I’ll try to summarize the state of affairs
'2.11':
ansible_os_family: RedHat # -> this is correct
'2.10':
ansible_os_family: Rocky # -> this is incorrect
'2.9':
ansible_os_family: Rocky # -> this is incorrect
ansible 2.9 is very old and at the time Rocky Linux was finished there was already a feature freeze in place, that’s why it will not be fixed. To mitigate the issue at least a little bit the ansible 2.9 in EPEL was patched, so that it shows ‘RedHat’.
That means, if you are using ansible 2.9 but not the version from EPEL you might want to change your conditions from
when: ansible_os_family == 'RedHat'
to
when: ansible_os_family in ['RedHat', 'Rocky']
P.S.: in my original post I got it wrong for ansible 2.10, 2.10 is also not fixed! I corrected this in the table above.