瀏覽代碼

Add inline checkplugin file distribution method

Tom De Vylder 9 年之前
父節點
當前提交
5d6fc45ed4
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      manifests/checkplugin.pp

+ 10 - 0
manifests/checkplugin.pp

@@ -13,6 +13,7 @@ define icinga2::checkplugin (
   $checkplugin_template_module          = 'icinga2',
   $checkplugin_template                 = undef,
   $checkplugin_source_file              = undef,
+  $checkplugin_source_inline            = undef,
 ) {
 
   #Do some validation of the class' parameters:
@@ -41,6 +42,15 @@ define icinga2::checkplugin (
       require => Package[$icinga2::params::icinga2_client_packages],
     }
   }
+  elsif $checkplugin_file_distribution_method == 'inline' {
+    file { "${checkplugin_libdir}/${checkplugin_name}":
+      owner   => $checkplugin_target_file_owner,
+      group   => $checkplugin_target_file_group,
+      mode    => $checkplugin_target_file_mode,
+      content => $checkplugin_source_inline,
+      require => Package[$icinga2::params::icinga2_client_packages],
+    }
+  }
   else {
     notify {'Missing/Incorrect File Distribution Method':
       message => 'The parameter checkplugin_file_distribution_method is missing or incorrect. Please set content or source',