---
- hosts: all
  tasks:
  - name: Set new random root password
    sudo: yes
    user: name=root password="{{lookup('password', '/tmp/ansibleremoterootpwd length=30')}}"

- include: authorized_keys.yml

---
- hosts: all
  tasks:
  - name: Set new random root password
    become: true
    user: name=root password="{{ lookup('password', '/tmp/ansibleremoterootpwd length=30') }}"

- include: authorized_keys.yml

Use the `become` task attribute rather than the deprecated `sudo`
Use the `become` task attribute rather than the deprecated `sudo`
