Ansible troubleshooting — passwordless account

How to reproduce the `usermod: unlocking the user’s password would result in a passwordless account.` error and how to solve it!

Luca Berton
4 min readOct 5, 2021

--

Today we’re going to talk about Ansible troubleshooting and specifically about the “Fatal usermod: unlocking the user’s password would result in a passwordless account.” error.

I’m Luca Berton and welcome to today’s episode of Ansible Pilot.

demo

The best way of talking about Ansible troubleshooting is to jump in a live demo to show you practically the `usermod: unlocking the user’s password would result in a passwordless account.` error and how to solve it!

  • passwordless_error.yml
---
- name: user module demo
hosts: all
become: true
vars:
myuser: "example"
tasks:
- name: create a disabled user
ansible.builtin.user:
name: "{{ myuser }}"
state: present
password_lock: true
- name: enable user
ansible.builtin.user:
name: "{{ myuser }}"
state: present
password_lock: false

--

--

Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday