Ansible Create Users and Groups (with vault)

Here is the problem statement for the task:

On jump host itself there is a list of users in ~/playbooks/data/users.yml file and there are two groups — admins and developers —that have list of different users. Create a playbook ~/playbooks/add_users.yml on jump host to perform the following tasks on app server 3 in Stratos DC.

a. Add all users given in the users.yml file on app server 3.

b. Also add developers and admins groups on the same server.

c. As per the list given in the users.yml file, make each user member of the respective group they are listed under.

d. Make sure home directory for all of the users under developers group is /var/www (not the default i.e /var/www/{USER}). Users under admins group should use the default home directory (i.e /home/devid for user devid).

e. Set password ksH85UJjhb for all of the users under developers group and TmPcZjtRQx for of the users under admins group. Make sure to use the password given in the ~/playbooks/secrets/vault.txt file as Ansible vault password to encrypt the original password strings. You can use ~/playbooks/secrets/vault.txt file as a vault secret file while running the playbook (make necessary changes in ~/playbooks/ansible.cfg file).

f. All users under admins group must be added as sudo users. To do so, simply make them member of the wheel group as well.

Here is my issue and question:
For setting the password, it seems the task only passes if we set the following in the playbook under the ansible “user” module:
password: “{{ ‘ksH85UJjhb’ | password_hash(‘sha512’) }}”

My question is, what is the point of encrypting a password with a password stored in a vault if we are going to show the password in plain-text in the playbook?

Why doesn’t this work ?

- name: perform tasks on servers
  hosts: stapp03
  remote_user: root
  become: true
    passwd_developers: !vault |

    passwd_admins: !vault |

    - name: Ensure required groups exist
        name: "{{ item }}"
        state: present
        - admins
        - developers
    - name: add users belonging to group "admins" and add same users to "wheel" group
        name: "{{ item }}"
        groups: admins,wheel
        state: present
        append: yes
        password: "{{ '{{ passwd_admins }}' | password_hash('sha512') }}"
        - rob
        - david
        - joy
    - name: add users belonging to group "developers"
        name: "{{ item }}"
        groups: developers
        state: present
        append: yes
        home: /var/www/"{{ item }}"
        password: "{{ '{{ passwd_developers }}' | password_hash('sha512') }}"
        - tim
        - ray
        - jim
        - mark