ansible/molecule

molecule is not able to load the module utilities

gyuvaraj10 opened this issue · 2 comments

Discussed in #3561

Originally posted by gyuvaraj10 May 31, 2022
I have module utilities in my root project folder under "library" and the module_utils property is configured in ansible.cfg under root directory. Now when I run command, the molecule is not able to understand the module utilities directory and throwing the following error.

Root Project folder:
image

ansible.cfg:
image

molecule.yml:

dependency:
name: galaxy
driver:
name: delegated
options:
managed: False
ansible_connection_option:
ansible_connection: local
platforms:

  • name: instance
    provisioner:
    name: ansible
    log: True
    config_options:
    defaults:
    module_utils: ../../../library
    env:
    ANSIBLE_CONFIG: ../../../ansible.cfg
    ANSIBLE_ROLES_PATH: $ANSIBLE_ROLES_PATH:../../../../roles
    ANSIBLE_LIBRARY: $ANSIBLE_LIBRARY:../../../../library
    options:
    vvv: True
    inventory:
    links:
    group_vars: ../../../../group_vars/
    hosts: ../../../../inventories/single-machine/hosts
    host_vars: ../../../../inventories/single-machine/host_vars/
    verifier:
    name: ansible
    lint:
    name: ansible-lint

molecule test: output:
fatal: [localhost]: FAILED! => {"msg": "Could not find imported module support code for ansible.modules.start_on_demand_backup. Looked for (['ansible.module_utils.aws_deployment_util.AWSDeploymentUtility', 'ansible.module_utils.aws_deployment_util'])"}

Note: none of the configuration added to ansible.cfg is available to molecule.

Hi @gyuvaraj10

I am glad to help you on this issue.

Could you please provide a Minimal, Reproducible Example?

Closing due to lack of clear details and also because he have a major new release. Please do not issue tracker for support, use discussions, IM or other mediums.