Ansible This module requires the passlib Python library

grub2_hash requires the passlib python module to generate password hashes
install passlib python module mac
ansible no module named passlib

I have tried to use ansible core module htpasswd on ubuntu and I get error

This module requires the passlib Python library


In order task htpasswd module to work. server needs to have python-passlib package installed. This can be done via:

- name: Make sure we can use htpasswd module
  apt: "pkg=python-passlib state=installed"

htpasswd return 'This module requires the passlib Python library , ISSUE TYPE Bug Report COMPONENT NAME htpasswd ANSIBLE VERSION ansible 2.3.2.0 config file = /home/vvp/.ansible.cfg configured  passlib must be installed on the target machine, not the local ansible controller. Ansible will run python code on the target host when trying to manage htpassword, and passlib must be available to the python interpreter running on the target host.


To install the latest version of passlib use pip

- name: Install latest passlib with pip
  pip: name=passlib

More on this you can read here

Metrics installation fails on Atomic host as passlib module is , We are using Atomic hosts for everything and as such python-passlib is ansible 2.3.0.0 config file = /etc/ansible/ansible.cfg configured module search for this result"} ▽ MSG: This module requires the passlib Python library. > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to ansible-proje@googlegroups.com. > To post to this group, send email to ansible@googlegroups.com. > To view this discussion on the web visit


Make sure that you're using the version of passlib that matches the version of python you're using.

I had to install python3-passlib instead of python-passlib.

"This module requires the passlib Python library"}, You received this message because you are subscribed to the Google Groups > "​Ansible Project" group. > To unsubscribe from this group and  Track tasks and feature requests. Join 40 million developers who use GitHub issues to help identify, assign, and keep track of the features and bug fixes your projects need.


Ansible htpasswd – this module requires the passlib python library , Ansible htpasswd – this module requires the passlib python library. December You just need to check that python-passlib is installed like so:  Manage Python library dependencies. To use this module, one of the following keys is required: name or requirements. The below requirements are needed on the host that executes this module. The explicit executable or pathname for the pip executable, if different from the Ansible Python interpreter. For example pip3.3, if there are both Python 2


lib/ansible/modules/web_infrastructure/htpasswd.py, "On RHEL or CentOS: Enable EPEL, then install I(python-passlib). module requires the passlib Python library") # Check file for blank lines in  Appendix: Module Utilities ¶ Ansible provides a number of module utilities that provide helper functions that you can use when developing your own modules. The basic.py module utility provides the main entry point for accessing the Ansible library, and all Ansible modules must, at minimum, import from basic.py:


#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Nimbis Services , requires: [ passlib>=1.6 ] author: "Ansible Core Team" """ EXAMPLES = """ # Add a module.fail_json(msg="This module requires the passlib Python library")  Recently I was working on a playbook to set up Apache basic HTTP authentication with the Ansible htpasswd module, and because the Python passlib module wasn't installed on the server I was getting an Ansible error: "msg": "This module requires the passlib Python library" Solution