Skip to content

Instantly share code, notes, and snippets.

@antaflos
Last active December 26, 2015 03:19
Show Gist options
  • Save antaflos/7085586 to your computer and use it in GitHub Desktop.
Save antaflos/7085586 to your computer and use it in GitHub Desktop.
hiera hashes with no key-value pairs for feeding into create_resources
# How does one define a hash with a name but no keys/values?
---
site_repos_ppa:
'ppa:git-core/ppa':
'ppa:mercurial-ppa/releases':
# calls to apt::ppa usually look like this:
apt::ppa { 'ppa:git-core/ppa': }
apt::ppa { 'ppa:mercurial-ppa/releases': }
# how to use with create_resources?
$ppas = hiera_hash('site_repos_ppa', {})
create_resources('@apt::ppa', $ppas)
# This results in:
Error: Could not retrieve catalog from remote server:
Error 400 on SERVER: can't convert nil into Hash at
/etc/puppet/environments/production/modules/repos/manifests/virtual.pp:9
on node kvmhost01.example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment