title: Using Ansible to remove multiple Unix accounts
body: <p>I have written the below <code>ansible</code> code for removal of <code>Unix</code> user accounts. </p>
  
  <pre><code>  - hosts: dev
      vars:
      username: 'testuser'
      become: true
      tasks:
      - name: Remove User
        user:
         name: '{{ username }}'
         state: absent
         remove: yes
  </code></pre>
  
  <p>This works fine for a single user. However if I want to remove multiple users at the same time , do I need to create separate variable for each of the user to be deleted and a separate <code>user</code> resource to remove this user. In that case if there are mulitple users the code will become too long. ANy suggestions ? </p>