jssimporter / JSSImporter

JSSImporter is deprecated. Please see the wiki for alternatives
Apache License 2.0
145 stars 38 forks source link

Add "do_update" option for smart groups #155

Closed grahampugh closed 5 years ago

grahampugh commented 5 years ago

The do_update parameter is an optional addition to the groups and exclusion_groups dictionaries within the arguments of a JSS recipe. This allows the recipe to specify a computer group to be added to the Targets and Exclusions of a policy, but not to update the smart groups if they already exist. The default behaviour is do_update == True, which is the same as the current behaviour. If <key>do_update</key><false/> is added to a group dictionary, an existing group of the specifying name will not be overwritten/updated.

The use case for this change is that an administrator can automatically provide smart groups via AutoPkg, which can then be altered - most likely, the criteria is changed. More broadly, the idea is that JSSImporter can be used to create a set of production policies for a software title, some of which will change with new software versions, but some will not, and need to have adjustable scope.

Example:

<key>groups</key>
<array>
    <dict>
        <key>do_update</key>
        <false/>
        <key>name</key>
        <string>%USERS_GROUP_NAME%</string>
        <key>smart</key>
        <true/>
        <key>template_path</key>
        <string>%USERS_GROUP_TEMPLATE%</string>
    </dict>
</array>
grahampugh commented 5 years ago

Created a new feature branch in which to merge the new do_update and skip_scope features prior to merging into master.