---
- hosts: vm
  vars:
    detectives:
     - detective01
     - detective02
     - detective03
     - detective04
     - detective05
     - detective06
     - detective07
     - detective08
     - detective09
     - detective10
     - detective11
     - detective12
     - detective13
     - detective14
     - detective15
     - detective16
     - detective17
     - detective18
     - detective19
     - detective20
     - detective21
     - detective22
     - detective23
     - detective24
     - detective25
     - detective26
     - detective27
     - detective28
     - detective29
     - detective30

  tasks:
   - name: Install Packages
     apt: pkg={{ item }} state=latest update_cache=yes
     sudo: yes
     with_items:
     - htop
     - vim
     - screen
     - git 
     - shellinabox

   - name: Create users
     user: 
       name: "{{ item }}"
       shell: /bin/bash 
       password: "$6$rounds=656000$F2ZuIpgvYSRmfvtT$8XO8imx38Y7VQSDegkeziljicR7CB0uuVvan9nFZYd0liZpF7K1GMsXQxd1Bv3jB4JeQfKPEn84u32GY1JBCS0"
     sudo: yes
     with_items: detectives

   - name: git checkout climystery
     git: repo=https://github.com/veltman/clmystery.git dest=~/climystery
     become: yes
     become_user: "{{item}}"
     with_items: detectives
