ansible-conda-env
ansible-conda-env copied to clipboard
Role is broken when conda_env_environment is a path to file
Relevant task uses conda_env_environment as-is and therefore it is a PATH and not just filename.
In our project we have multiple env yaml files and we put them in subdir, referencing them in playbook as conda_env_environment: "./env/name-conda_env.yml".
This breaks because of this code where conda_env_fq_dest_environment derived from conda_env_environment as if it was FILE NAME and NOT a FILEPATH.
Quote from Ansible docs template module (emphasis mine):
src- required | Path of a Jinja2 formatted template on the Ansible controller. This can be a relative or absolute path.
the role has been working splendidly for me for the past few years. can you put together an example instantiation that exhibits the problem you're having? conda_env_fq_dest_environment is the yml file on the target host that specifies the conda environment. see test.yml for the example instantiation that I use to test the role with TravisCI.
I'm also open to a PR to enhance the role to better support your use case.