lib/puppet/provider/mobileconfig.rb
# This used to be accomplished in the :activedirectory provider, but we are
# collapsing this functionality back into the parent class and abandoning the
# sub-classed provider.
#
# The Advanced Active Directory profile contains flag keys which inform
# the installation process which configuration keys should actually be
# activated.
#
# http://support.apple.com/kb/HT5981?viewlocale=en_US&locale=en_US
#
# For example, if we wanted to change the default shell for AD accounts, we
# would actually need to define two keys: a configuration key and a flag key.
#
# <key>ADDefaultUserShell</key>
# <string>/bin/zsh</string>
#
# <key>ADDefaultUserShellFlag</key>
# <true/>
#
# If you fail to specify this second key (the activation or "flag" key), the
# configuration key will be ignored when the mobileconfig is processed.
#
# To avoid having to activate and deactivate the configuration keys, we
# pre-process the content array by overriding the transform_content method
# and shoehorn these flag keys into place dynamically, as required.
#
This used to be accomplished in the :activedirectory provider, but we are
collapsing this functionality back into the parent class and abandoning the
sub-classed provider.

The Advanced Active Directory profile contains flag keys which inform
the installation process which configuration keys should actually be
activated.



For example, if we wanted to change the default shell for AD accounts, we
would actually need to define two keys: a configuration key and a flag key.





If you fail to specify this second key (the activation or "flag" key), the
configuration key will be ignored when the mobileconfig is processed.

To avoid having to activate and deactivate the configuration keys, we
pre-process the content array by overriding the transform_content method
and shoehorn these flag keys into place dynamically, as required.
This used to be accomplished in the : activedirectory provider but we are collapsing this functionality back into the parent class and abandoning the sub - classed provider . The Advanced Active Directory profile contains flag keys which inform the installation process which configuration keys should actually be activated . For example if we wanted to change the default shell for AD accounts we would actually need to define two keys : a configuration key and a flag key . If you fail to specify this second key ( the activation or " flag " key ) the configuration key will be ignored when the mobileconfig is processed . To avoid having to activate and deactivate the configuration keys we pre - process the content array by overriding the transform_content method and shoehorn these flag keys into place dynamically as required .
def add_activedirectory_keys(payload)
    needs_flag = ['ADAllowMultiDomainAuth',
                  'ADCreateMobileAccountAtLogin',
                  'ADDefaultUserShell',
                  'ADDomainAdminGroupList',
                  'ADForceHomeLocal',
                  'ADNamespace',
                  'ADPacketEncrypt',
                  'ADPacketSign',
                  'ADPreferredDCServer',
                  'ADRestrictDDNS',
                  'ADTrustChangePassIntervalDays',
                  'ADUseWindowsUNCPath',
                  'ADWarnUserBeforeCreatingMA',]
    needs_flag.each do |e|
      if payload.key?(e)
        flag_key = e + 'Flag'
        payload[flag_key] = true
      end
    end
    payload
  end
def add_activedirectory_keys ( payload ) needs_flag = [ 'ADAllowMultiDomainAuth' , 'ADCreateMobileAccountAtLogin' , 'ADDefaultUserShell' , 'ADDomainAdminGroupList' , 'ADForceHomeLocal' , 'ADNamespace' , 'ADPacketEncrypt' , 'ADPacketSign' , 'ADPreferredDCServer' , 'ADRestrictDDNS' , 'ADTrustChangePassIntervalDays' , 'ADUseWindowsUNCPath' , 'ADWarnUserBeforeCreatingMA' , ] needs_flag . each do | e | if payload . key? ( e ) flag_key = e + 'Flag' payload [ flag_key ] = true end end payload end
This used to be accomplished in the :activedirectory provider, but we are
collapsing this functionality back into the parent class and abandoning the
sub-classed provider.
This used to be accomplished in the : activedirectory provider but we are collapsing this functionality back into the parent class and abandoning the sub - classed provider .
payload