ansible-conda-env icon indicating copy to clipboard operation
ansible-conda-env copied to clipboard

Role is broken when conda_env_environment is a path to file

Open akamensky opened this issue 6 years ago • 3 comments

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.

akamensky avatar Feb 13 '19 05:02 akamensky

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.

akamensky avatar Feb 13 '19 05:02 akamensky

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.

andrewrothstein avatar Feb 18 '19 01:02 andrewrothstein

I'm also open to a PR to enhance the role to better support your use case.

andrewrothstein avatar Feb 18 '19 01:02 andrewrothstein