--- - name: Adding user through different formats used in ansible hosts: nodes gather_facts: false tasks: - name: Addition through single-line format user: name=single groups=wheel comment='Single-Line Method' password={{ 'user@123' | password_hash('sha512') }} state=present - name: Addition through multi-line format user: name=multi groups=wheel comment='Multi-Line Method' password={{ 'user@123' | password_hash('sha512') }} state=present - name: Addition through dictionary format user: name: Tom groups: wheel comment: Addition through dictionary format password: "{{ 'billa@123' | password_hash('sha512') }}" state: present ...