0

I am fairly new in Puppet world. I have this project that a profile requires to read input from a yaml file. However, this yaml files should not be taken from Hiera or any other directory in puppet control repo git. It has to be located in separate git repositories outside of puppet control repo git for some audit matter. I am thinking to use parseyaml for this, however, I've tried to find it everywhere on how to do it in the internet but still come to a dead end.

Looking forward for advise on this. What is going to be added in Puppetfile and how do I call it in profile_name.pp using parseyaml

  • 1
    Possible duplicate of [Fetch variable from yaml in puppet manifest](https://stackoverflow.com/questions/55113213/fetch-variable-from-yaml-in-puppet-manifest) – Alex Harvey Mar 14 '19 at 14:40
  • It is almost the same. However. The yaml that I'm going to parse resides in different git repo. not within the same repo. Any idea? – Norazfizal Mar 14 '19 at 14:53
  • I guess you’ll need to firstly copy the file from the Git repo to a temp location perhaps and read it from there? – Alex Harvey Mar 14 '19 at 14:56
  • This is definitely answered by https://stackoverflow.com/questions/55113213/fetch-variable-from-yaml-in-puppet-manifest. The yaml can go in a repo containing a Puppet module. Pull the module in using Puppetfile and load the yaml using file and parseyaml. – Jon Mar 15 '19 at 14:30
  • Puppetfile is used specifically for loading Puppet modules and I assume this file does not live in a Puppet module. Of course the vcsrepo module could be used instead to fetch the git repo. – Alex Harvey Mar 16 '19 at 02:29

0 Answers0