Copy to Clipboard
--- - name: Create users become: yes user: name: "{{ item.name }}" password: "{{ item.password }}" state: present createhome: yes groups: "{{ item.group }}" with_items: "{{ users }}" when: inventory_hostname in item.hosts no_log: false - name: Change password for users to use yescrypt become: yes shell: cmd: "echo {{item.name}}:{{ item.new_password }} | sudo chpasswd" with_items: "{{ users }}" when: inventory_hostname in item.hosts no_log: false