Handle creation of root password prompt with ansible

133 views Asked by At

How do I handle Ubuntu's request to change the root user's password when initializing a new server?

Currently, I'm just logging in to change the password, and then running the Ansible script, but obviously that defeats the purpose of automation.

1

There are 1 answers

1
Antonis Christofides On
- name: Set root user's password
  user: name=root password={{ encrypted_root_password }} update_password=always

See also How do I generate crypted passwords for the user module.