'dict object' has no attribute

Hi

I would like to lock list of users on linux only if user exist, but have some problems:

lock-user1.yml

Try this

    - name: Get passwd
      getent:
        database: passwd

    - name: lock
      user:
        name: "{{ item }}"
        password_lock: yes
      loop: "{{ getent_passwd|intersect(my_users) }}"
      vars:
        my_users:
          - uporabnik1
          - uporabnik2
          - uporabnik3
          - uporabnik4
          - uporabnik5

thx Vladimir this works to, but I already made this: