SHARE
TWEET

Untitled

a guest Mar 5th, 2018 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. =======================
  2. old way (in module):
  3. =======================
  4. paramp.pp:
  5. class myclass::params {
  6.   $myparam = 'hello'
  7. }
  8.  
  9. init.pp:
  10. class myclass (
  11.   $myparam = hiera('myclass::myparam', myclass::params::myparam),
  12. ) inherits myclass::params {
  13. *snip*
  14. }
  15.  
  16. =======================
  17. new way (in module):
  18. =======================
  19. hiera.yaml:
  20. version: 5
  21. data_dir: data
  22. data_hash: yaml_data
  23. hierarchy:
  24.   - name: 'common'
  25.     path: 'common.yaml'
  26.  
  27. data/common.yaml:
  28. myclass::myparam: 'hello'
  29.  
  30. init.pp:
  31. class myclass (
  32.   String $myparam = lookup('myclass::myparam')
  33. ) {
  34. *snip*
  35. }
  36.  
  37. myparam will always cause failure or be undef here, even if i pass default_value to lookup since i cannot grab
  38. the data from hiera module data again?
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top