Hi Folks,
I am stuck and need help with my ansible playbook. I created a playbook that will configure a vm image for me on AWS, QEMU, or VMware, and the playbook is triggered by vagrant or packer. When I run the playbook locally, it works fine to create/configure the images. I wanted to automate the system further by having github actions run packer and create my images on AWS. This is failing with the following:
FAILED! => {"msg": "Unable to encrypt nor hash%!(PACKER_COMMA) passlib must be installed. No module named 'passlib'. Unable to encrypt nor hash%!(PACKER_COMMA) passlib must be installed. No module named 'passlib'"}
I’ve tried various things to fix this with no luck. I added this to me github runner:
python3 -m pip show passlib
ansible-config dump | grep DEFAULT_MODULE_PATH
ansible --version
And this is what it returns:
Name: passlib
Version: 1.7.4
Summary: comprehensive password hashing framework supporting over 30 schemes
Home-page: https://passlib.readthedocs.io
Author: Eli Collins
Author-email: elic@assurancetechnologies.com
License: BSD
Location: /usr/lib/python3/dist-packages
Requires:
Required-by:
DEFAULT_MODULE_PATH(default) = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible [core 2.17.2]
config file = None
configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /opt/pipx/venvs/ansible-core/lib/python3.10/site-packages/ansible
ansible collection location = /home/runner/.ansible/collections:/usr/share/ansible/collections
executable location = /opt/pipx_bin/ansible
python version = 3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0] (/opt/pipx/venvs/ansible-core/bin/python)
jinja version = 3.1.4
libyaml = True
And finally, this is what I use to create the user/pass:
- name: create new user with password
user:
name: "{{ item }}"
password: "{{ user_pw | password_hash('sha512')}}"
groups: "adm"
expires: "{{ '%s' | strftime( (ansible_date_time.epoch | int) + (86400 * 356) ) }}"
password_expire_max: 356
password_expire_min: 356
shell: /bin/bash
Any help would be greatly appreciated.