---
- name: Create Ansible User
  user:
    name={{ ansible_user }}
    password={{ ansible_password }}
    groups=sudo
    append=yes
    shell=/bin/bash
  sudo: True

- name: Add Ansible Authorized Key
  authorized_key:
    user={{ ansible_user }}
    key="{{ lookup('file', 'ansible_pub_key_path') }}"
    state=present
  sudo: True
- name: Adding Sudoers file with no password
  template:
    src=sudoer.j2
    dest=/etc/sudoers.d/{{ ansible_user }}
  sudo: True