Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create repos via hiera. #50

Open
madelaney opened this issue May 6, 2017 · 1 comment
Open

Create repos via hiera. #50

madelaney opened this issue May 6, 2017 · 1 comment

Comments

@madelaney
Copy link

I'd like to have all of my aptly configuration be done by hiera, as such, I'd like to be able to create repos/mirrors via hiera hashes.

@ansgarwiechers
Copy link

ansgarwiechers commented May 3, 2018

You can always do something like this:

$repos = lookup('my::repos', Hash, 'deep', {})
unless empty($repos) {
  ensure_resources('aptly::repo', $repos)
}

which you may have to do anyway, because Puppet ignores the hiera merge behavior definition and always uses the strategy "first".

Even if you defined something like this (assuming the module had a parameter repos):

class { '::aptly':
  repos => lookup('aptly::repos', Hash, 'deep', {}),
}

Puppet would implicitly do a lookup('aptly::repos', Hash, 'first', {}) and ignore everything else. You'd have to do a lookup on a differntly named key to get around this (not configurable) behavior:

class { '::aptly':
  repos => lookup('my::repos', Hash, 'deep', {}),
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants