lib/puppet/provider/mobileconfig.rb
# Formats and fortifies the PayloadContent array
# - ensures required keys to each Hash
Formats and fortifies the PayloadContent array
ensures required keys to each Hash
Formats and fortifies the PayloadContent array ensures required keys to each Hash
def transform_content(content)
    return [] if content.empty?
    content.collect! do |payload|
      payload.delete('PayloadUUID')
      embedded_payload_uuid = ::ManagedMacCommon::content_to_uuid payload.sort
      embedded_payload_id   = payload['PayloadIdentifier'] || [@resource[:name],
                                      embedded_payload_uuid].join('.')
      payload.merge!({
        'PayloadIdentifier' => embedded_payload_id,
        'PayloadUUID'       => embedded_payload_uuid,
        'PayloadEnabled'    => true,
        'PayloadVersion'    => 1,
      })
      case payload['PayloadType']
      when 'com.apple.DirectoryService.managed'
        add_activedirectory_keys(payload)
      when 'com.apple.security.pkcs1'
        process_certificate_payload(payload)
      else
        payload
      end
    end
  end
def transform_content ( content ) return [ ] if content . empty? content . collect! do | payload | payload . delete ( 'PayloadUUID' ) embedded_payload_uuid = :: ManagedMacCommon :: content_to_uuid payload . sort embedded_payload_id = payload [ 'PayloadIdentifier' ] || [ @resource [ :name ] , embedded_payload_uuid ] . join ( '.' ) payload . merge! ( { 'PayloadIdentifier' => embedded_payload_id , 'PayloadUUID' => embedded_payload_uuid , 'PayloadEnabled' => true , 'PayloadVersion' => 1 , } ) case payload [ 'PayloadType' ] when 'com.apple.DirectoryService.managed' add_activedirectory_keys ( payload ) when 'com.apple.security.pkcs1' process_certificate_payload ( payload ) else payload end end end
Formats and fortifies the PayloadContent array
 ensures required keys to each Hash
Formats and fortifies the PayloadContent array ensures required keys to each Hash
# PayloadUUID for each Payload is modified MD5 sum of Payload itself, # minus any of the other ephemeral keys. We can use this to check whether # or not the content has been modified. Even when the Payload attributes # cannot be compared (ie. Password keys).
content