With ansible 2.10 I use the ldap_attrs module to enable the openldap memberof module:
- name: Enable memberof module ldap_attrs: dn: cn=module{0},cn=config