0

Need to find out how to bring in a variable file (yaml format) from the playbook into the requirements.yml file.

Something that could be used for this format:

    - src: git+https://www.gitrepo.com/path/to/gitrepo.git
      name: gitrepo_name
      version: {{ needed_version }}

Does ansible-galaxy support this? Documentation does not seem to show it. Thanks!

  • 1
    No, you can't. The requirements file is not parsed in a way that supports variables. – larsks Jan 11 '22 at 14:00
  • 1
    What you can do is to create a playbook which parses the file locally using `template` module and `delegate_to: localhost`, if desired, but as @larsks said: This is not possible using ansible-galaxy itself. – user1098490 Jan 11 '22 at 14:15
  • Thanks for the help! This is what I figured. I will work around the limitation using 'sed' or something similar in a pre-processing script of some sort. – MegaHurts2010 Jan 12 '22 at 12:06

0 Answers0