I am working on setting up a project with Molecule and saw in the documentation that we can put configurations into {PROJECT_DIR}/.config/molecule/config.yml
or into ~/.config/molecule/config.yml
So I was doing a few tests to learn more.
I am having an issue where if I put settings into {PROJECT_DIR}/.config/molecule/config.yml
they are not read but they are read if I move that directory to my user home directory.
Version Information:
>molecule --version
molecule 6.0.3 using python 3.11
ansible:2.16.2
azure:23.5.0 from molecule_plugins
containers:23.5.0 from molecule_plugins requiring collections: ansible.posix>=1.3.0 community.docker>=1.9.1 containers.podman>=1.8.1
default:6.0.3 from molecule
docker:23.5.0 from molecule_plugins requiring collections: community.docker>=3.0.2 ansible.posix>=1.4.0
ec2:23.5.0 from molecule_plugins
gce:23.5.0 from molecule_plugins requiring collections: google.cloud>=1.0.2 community.crypto>=1.8.0
podman:23.5.0 from molecule_plugins requiring collections: containers.podman>=1.7.0 ansible.posix>=1.3.0
vagrant:23.5.0 from molecule_plugins
My example directory structure:
$ tree -a my_project/
my_project/
βββ .config
β βββ molecule
β βββ config.yml
βββ roles
βββ somerole
βββ molecule
βββ default
βββ converge.yml
βββ create.yml
βββ destroy.yml
βββ molecule.yml
Here are the contents of config.yml
:
---
driver:
name: docker
Hereβs what I see if I configure using ~/.config/molecule/config.yml
- it finds the file and the settings are used:
$ molecule converge
INFO Found config file /home/my_user/.config/molecule/config.yml
But when I remove that config in the home dir and leave it in my project root dir it does not read these settings. I tried moving the .config directory to all different levels within the project dir with no luck.
Am I doing something wrong or is this an issue in Molecule or the documentation?
Thanks for any assistance with this!
-Eric