routes.pp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Manages the routes configuration file on the master. See README.md for more
  2. # details.
  3. class puppetdb::master::routes (
  4. $puppet_confdir = $puppetdb::params::puppet_confdir,
  5. $masterless = $puppetdb::params::masterless,
  6. $routes = {
  7. 'master' => {
  8. 'facts' => {
  9. 'terminus' => 'puppetdb',
  10. 'cache' => 'yaml',
  11. }
  12. }
  13. }
  14. ) inherits puppetdb::params {
  15. if $masterless {
  16. $routes_real = {
  17. 'apply' => {
  18. 'catalog' => {
  19. 'terminus' => 'compiler',
  20. 'cache' => 'puppetdb',
  21. },
  22. 'facts' => {
  23. 'terminus' => 'facter',
  24. 'cache' => 'puppetdb_apply',
  25. }
  26. }
  27. }
  28. } else {
  29. $routes_real = $routes
  30. }
  31. # TODO: this will overwrite any existing routes.yaml;
  32. # to handle this properly we should just be ensuring
  33. # that the proper settings exist, but to do that we'd need
  34. # to parse the yaml file and rewrite it, dealing with indentation issues etc
  35. # I don't think there is currently a puppet module or an augeas lens for
  36. # this.
  37. file { "${puppet_confdir}/routes.yaml":
  38. ensure => file,
  39. content => template('puppetdb/routes.yaml.erb'),
  40. }
  41. }