title: How to add user and group without a password using Ansible?
body: <p>I need to add group and user without password (nologin user) using Ansible script.</p>
  
  <p>I execute the following command:</p>
  
  <pre><code>$ansible-playbook deploy_nagios_client.yml -i hosts -e hosts=qa1-jetty -v
  </code></pre>
  
  <p>Below is <code>main.yml</code></p>
  
  <pre><code>---
  
  # Create Nagios User and Group 
    - name: Add group "nagios"
      group: name=nagios
      become: true
  
    - name: Add user "nagios"  
      user: name=nagios groups=nagios password="" shell=/bin/bash append=yes comment="Nagios nologin User" state=present
      become: true
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/pcT54.jpg" rel="noreferrer">Result</a></p>