---
  - name: Generate AzuraCast Password
    command: pwgen 8 -sn 1
    register: prod_azuracast_user_password

  - name: Create Groups
    group: name="{{ item }}" state=present
    with_items:
     - www-data
     - admin

  - name: Create AzuraCast User
    user:
      name: azuracast
      home: "{{ app_base }}"
      comment: "AzuraCast"
      shell: /bin/bash
      groups: 'sudo,admin,www-data'
      password: "{{ prod_azuracast_user_password.stdout|password_hash('sha512') }}"
    notify: send user notification

  - name: Modify www-data User
    user: name=www-data groups="azuracast" append=yes