Skip to content

Commit

Permalink
prefer cwd hiera.yaml if exists
Browse files Browse the repository at this point in the history
ghostbuster only works properly when run from the control repo with a
very specific find command. it only makes sense to use the control
repo's hiera.yaml file by default, and fallback to global.
  • Loading branch information
h0tw1r3 committed Feb 7, 2024
1 parent b6ef365 commit c06ab71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Environment variables

### HIERA_YAML_PATH

The location of the `hiera.yaml` file. Defaults to `/etc/puppetlabs/puppet/hiera.yaml`
The location of the `hiera.yaml` file. Defaults to `./hiera.yaml` or `/etc/puppetlabs/puppet/hiera.yaml` whichever is found first.

### PUPPETDB_URL

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def hiera
@hiera ||= if (hiera_file = ENV.fetch('HIERA_YAML_PATH', false))
YAML.load_file(hiera_file)
else
hiera = ['/etc/puppetlabs/puppet/hiera.yaml'].filter_map do |hf|
hiera = ['hiera.yaml', '/etc/puppetlabs/puppet/hiera.yaml'].filter_map do |hf|
YAML.load_file(hf) if hf && File.exist?(hf)
end
hiera[0]
Expand Down

0 comments on commit c06ab71

Please sign in to comment.