resource_ldap.pp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Define for setting IcingaWeb2 LDAP Resource
  2. define icingaweb2::config::resource_ldap (
  3. $resource_name = $title,
  4. $resource_host = undef,
  5. $resource_port = undef,
  6. $resource_root_dn = undef,
  7. $resource_bind_dn = undef,
  8. $resource_bind_pw = undef,
  9. ) {
  10. Ini_Setting {
  11. ensure => present,
  12. require => File["${::icingaweb2::config_dir}/resources.ini"],
  13. path => "${::icingaweb2::config_dir}/resources.ini",
  14. }
  15. ini_setting { "icingaweb2 resources ${title} type":
  16. section => $resource_name,
  17. setting => 'type',
  18. value => 'ldap',
  19. }
  20. ini_setting { "icingaweb2 resources ${title} hostname":
  21. section => $resource_name,
  22. setting => 'hostname',
  23. value => "\"${resource_hostname}\"",
  24. }
  25. ini_setting { "icingaweb2 resources ${title} port":
  26. section => $resource_name,
  27. setting => 'port',
  28. value => "\"${resource_port}\"",
  29. }
  30. ini_setting { "icingaweb2 resources ${title} root_dn":
  31. section => $resource_name,
  32. setting => 'root_dn',
  33. value => "\"${resource_root_dn}\"",
  34. }
  35. ini_setting { "icingaweb2 resources ${title} bind_dn":
  36. section => $resource_name,
  37. setting => 'bind_dn',
  38. value => "\"${resource_bind_dn}\"",
  39. }
  40. ini_setting { "icingaweb2 resources ${title} bind_pw":
  41. section => $resource_name,
  42. setting => 'bind_pw',
  43. value => "\"${resource_bind_pw}\"",
  44. }
  45. }