X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fensure_resource.rb;h=e4fa771f2d5d56f7e9a06ed29ec5c776c85cd617;hp=d28ed9db74aa55e3608d28348aa55d58520a6aba;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/ensure_resource.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/ensure_resource.rb index d28ed9db7..e4fa771f2 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/ensure_resource.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/ensure_resource.rb @@ -3,17 +3,23 @@ require 'puppet/parser/functions' Puppet::Parser::Functions.newfunction(:ensure_resource, :type => :statement, - :doc => <<-'DOC' + :doc => <<-DOC + @summary Takes a resource type, title, and a list of attributes that describe a resource. - user { 'dan': - ensure => present, - } + user { 'dan': + ensure => present, + } - This example only creates the resource if it does not already exist: + @return + created or recreated the passed resource with the passed type and attributes - ensure_resource('user', 'dan', {'ensure' => 'present' }) + @example Example usage + + Creates the resource if it does not already exist: + + ensure_resource('user', 'dan', {'ensure' => 'present' }) If the resource already exists but does not match the specified parameters, this function will attempt to recreate the resource leading to a duplicate @@ -22,7 +28,7 @@ Puppet::Parser::Functions.newfunction(:ensure_resource, An array of resources can also be passed in and each will be created with the type and parameters specified if it doesn't already exist. - ensure_resource('user', ['dan','alex'], {'ensure' => 'present'}) + ensure_resource('user', ['dan','alex'], {'ensure' => 'present'}) DOC ) do |vals|