keeleysam / munki-exported

Automatically exported from code.google.com/p/munki
Other
0 stars 0 forks source link

Add ConsoleUser as a Conditional Item #269

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
ManagedInstallReport.plist already contains ConsoleUser and it would be useful 
if it was available as a conditional item as well. I realize that I can write a 
small script to add this as an admin provided conditional, but it  would 
simplify things if this was built-in. Thanks for your consideration.

Original issue reported on code.google.com by jtra...@gmail.com on 2 Dec 2013 at 2:28

GoogleCodeExporter commented 9 years ago
What's your use case for this? Since you install or uninstall software from a 
machine and not a user, it seems like ConsoleUser isn't of much use; there is 
no ConsoleUser when no-one is logged in and the machine is at the loginwindow...

Original comment by gregnea...@mac.com on 2 Dec 2013 at 2:35

GoogleCodeExporter commented 9 years ago
Our organization uses an internal software catalog where we 'sell' software 
packages to a user. The username, package name and package version are 
collected and stored in a database, but not the system name.

It is my goal to automatically generate a manifest of optional installs based 
on this information (see brief example below.) I hope to break it out so that 
each user that has purchased software has a conditional entry that lists the 
appropriate optional installs. I anticipate that this manifest will be several 
thousand lines long, and I am not sure what the performance impact will be.

I considered using AD groups, but enumerating the groups on the client can be 
slow and AD is not available to clients that are off-site.

--- snip ---
        <key>conditional_items</key>
        <array>
          <dict>
            <key>condition</key>
            <string>ConsoleUser == 'user1'</string>
            <key>optional_installs</key>
            <array>
              <string>AcrobatProX</string>
            </array>
          </dict>
          <dict>
            <key>condition</key>
            <string>ConsoleUser == 'user7'</string>
            <key>optional_installs</key>
            <array>
              <string>AcrobatProX</string>
              <string>EndNote</string>
            </array>
          </dict>
--- snip ---

Original comment by jtra...@gmail.com on 2 Dec 2013 at 12:21

GoogleCodeExporter commented 9 years ago
You can achieve this functionality by using Puppet, or even a LaunchAgent to 
change the name of the manifest in /Library/Preferences/ManagedInstalls.plist 

Say you have a manifest named fooUser, when fooUser logs in, the LaunchAgent 
rewrites the Preference file to read that particular manifest. 

Original comment by vranc...@gmail.com on 16 Apr 2014 at 2:18

GoogleCodeExporter commented 9 years ago
Since ConsoleUser changes all the time depending on if any user (or which user) 
is logged, I think what the original poster really wants is "primary user" or 
"assigned user" and not "current GUI user" which is what ConsoleUser would be. 
This is going to be organizational-specific logic and as such is a good fit for 
an admin-provided condition script: 
https://code.google.com/p/munki/wiki/ConditionalItems#Admin_Provided_Conditions

Original comment by gregnea...@mac.com on 16 Apr 2014 at 3:26