Comments (11)
I think your theory on this issue sounds pretty sound. I think the design of JSSImporter is to extend AutoPkg by allowing you to upload the pkg you just built to a Casper system. Therefore, it expects there to be a package. Using JSSImporter to create policies with no packages was something I never really thought about.
It would be fairly easy to modify JSSImporter to allow and handle NOT having a package, although at the moment it is a required input variable. (pkg_path
).
Another option would be to duplicate JSSImporter.py and change it to something applicable throughout the code (JSSPolicyCreator?) and just strip out the package handling. That may be pretty involved, though, since there are a lot of interrelated elements, like package category, minimum version, and to a certain extent, the code that uploads scripts. It really takes the Pkg in AutoPkg seriously!
It sounds like you have jumped through all of the hoops to make this work up-to the pkg issue, so it sounds like I could just remove the requirement for a package to be present. If everything tests out okay after that change, I'll put it into the next release.
How do you send notifications through the self service policy? I didn't know about that!
from python-jss.
I am going to move this over to JSSImporter though... See jssimporter/JSSImporter#22
from python-jss.
Modifying it was my original idea, and I had traced the required changes to revolving around pkg_path, but ultimately we decided not to do that because I figured since JSSImporter is just another processor, it has a specific function, so we decided not to mess with it. We were also concerned that if we did and it got revved, our changes would revert since its updating is tied into updates through AutoPkgr when you release new version of JSS Importer.
Ultimately we ended up doing exactly what you said, taking JSSImporter, duplicating and renaming it, and stripping out all functionality related to packages. We then just altered the JSS recipe to call up two different policy templates, one for the self service install policy for the patch testers, and the other for the notification policy, and each called up its own respective version of the importer processor.
Regarding sending notifications through a self service policy, our original idea was to use the new functionality built into Casper 9 that can have the JSS send a command to the Management Action.app that is part of the JAMF Framework to trigger alerts to be displayed in OS X's Notification Center. The problem is the default settings are for banner, and we wanted alert so it would have an OK button, not disappear on its own, and force the patch testers to acknowledge they have a new patch available in self service to test. We did figure out how to manipulate the SQLite DB associated with Notification Center, but its user specific, and not part of the template (it actually gets created at first login by the Notification Center Core Services App). I created a shell script that would check all users with a UUID over 500 for the DB, and if it wasnt present copy in a pre-staged one we created with the right settings, or if it did, check the values and make sure they matched what we wanted and if not change them), as well as check the user template and if the DB wasnt there add it, but the OS just ignores the one we create an creates it own. To bypass this, we figured we could utilize the JAMF Helper.app to send alerts customized to meet our needs. Normally you'd send these pre/post policy, but we dont want to actually run the policy for install, must notify the patch testers that they have one available, so the JAMF Helper string needs to be called via a second policy, but scoped to the same smart group as the install policy, hence my original request. We are actually using a similar process for alerting our production users with Casper 8 that they will be patched later in a given day so they can prepare appropriately that their machine will be rebooted. For those users, once we go to Casper 9 though, we will still use the above mechanism to alert patch testers, but for patch recipients that are normal users, we plan to switch to other new functionality that was added in Casper 9 to allow users to defer a policy. With that, we could patch during the day instead of just at night since when the policy would execute, the user would receive an alert that they were receiving patches, but be able to use JAMF's new policy deferral actions to push the execution to later in the day (that is to whatever deadline we set).
[email protected] At: Jan 15 2015 14:24:20" data-digest="From: [email protected] At: Jan 15 2015 14:24:20" style="">
From: [email protected] At: Jan 15 2015 14:24:20
To: [email protected]
Cc: JORDAN BENDER (BLOOMBERG/ 731 LEX)
Subject: Re: [python-jss] Way to create two policies? (#24)
I think your theory on this issue sounds pretty sound. I think the design of JSSImporter is to extend AutoPkg by allowing you to upload the pkg you just built to a Casper system. Therefore, it expects there to be a package. Using JSSImporter to create policies with no packages was something I never really thought about.
It would be fairly easy to modify JSSImporter to allow and handle NOT having a package, although at the moment it is a required input variable. (pkg_path).
Another option would be to duplicate JSSImporter.py and change it to something applicable throughout the code (JSSPolicyCreator?) and just strip out the package handling. That may be pretty involved, though, since there are a lot of interrelated elements, like package category, minimum version, and to a certain extent, the code that uploads scripts. It really takes the Pkg in AutoPkg seriously!
It sounds like you have jumped through all of the hoops to make this work up-to the pkg issue, so it sounds like I could just remove the requirement for a package to be present. If everything tests out okay after that change, I'll put it into the next release.
How do you send notifications through the self service policy? I didn't know about that!
—
Reply to this email directly or view it on GitHub.
from python-jss.
Would it be possible to use cocoaDialog?
cocoaDialog bubble --title "Update" --text "You have an update for 'Kim Kardashian: Hollywood' available" --no-timeout
Actually, just tried it. It works, but it doesn't use Notification Center like I thought. Bummer.
from python-jss.
I see you can trigger the notifications with Applescript and now Javascript for automation, but there's no option for timeout/buttons.
I've done this in Swift. Might be kind of overboard to learn ObjectiveC or Swift just to make a notification, but it may be worth it.
from python-jss.
You certainly can, but it adds another operational layer that needs to be maintained versus using something thats a part of already existing infrastructure. It also doesnt use notification center like you said.
However, neither does JAMF Helper which is the the route we chose, but it fall somewhere in the middle because it gives us a sufficient level of customization the way cocoa dialog does for our current needs, but utilizes something built into the JAMF Binary so we arent adding another layer.
[email protected] At: Jan 16 2015 11:50:55" data-digest="From: [email protected] At: Jan 16 2015 11:50:55" style="">
From: [email protected] At: Jan 16 2015 11:50:55
To: [email protected]
Cc: JORDAN BENDER (BLOOMBERG/ 731 LEX)
Subject: Re: [python-jss] Way to create two policies? (#24)
Would it be possible to use cocoaDialog?
cocoaDialog bubble --title "Update" --text "You have an update for 'Kim Kardashian: Hollywood' available" --no-timeout
Actually, just tried it. It works, but it doesn't use Notification Center like I thought. Bummer.
—
Reply to this email directly or view it on GitHub.
from python-jss.
Agreed. We ended up doing some further research with the JAMF Helper and did confirm that there is no native way to get any type of re-reminder like letting the client defer the reminder, but we can do buttons, and we can put focus on certain ones, and we can specify a timeout for the window to disappear if we wanted it to so it should meet our needs. It also does include some handy features which although not necessary for the current stuff, could be useful down the road such as the ability to make the window displayed full screen like a HUD and lock any and all actions except remote login while a policy completed, very similar to the lock screen mechanism in ARD.
----- Original Message -----
From: [email protected]
To: [email protected]
Cc: JORDAN BENDER (BLOOMBERG/ 731 LEX)
At: Jan 16 2015 12:07:59
I see you can trigger the notifications with Applescript and now Javascript for automation, but there's no option for timeout/buttons.
I've done this in Swift. Might be kind of overboard to learn ObjectiveC or Swift just to make a notification, but it may be worth it.
Reply to this email directly or view it on GitHub:
#24 (comment)
from python-jss.
@jmb03012 Came across this browsing Google's macops repo today: https://github.com/google/macops/tree/master/deprecation_notifier/DeprecationNotifier
Could be useful for your notification needs. It isn't a notification, but I think it points in the right direction.
from python-jss.
@sheacraig
Thanks, I think the policy with the JAMF Helper calls I mentioned a few posts back will suit our current needs, but this definitely looks like it could prove useful for other types of tasks.
Thanks for the share!
----- Original Message -----
From: [email protected]
To: [email protected]
Cc: JORDAN BENDER (BLOOMBERG/ 731 LEX)
At: Jan 23 2015 11:39:32
@jmb03012 Came across this browsing Google's macops repo today: https://github.com/google/macops/tree/master/deprecation_notifier/DeprecationNotifier
Could be useful for your notification needs. It isn't a notification, but I think it points in the right direction.
Reply to this email directly or view it on GitHub:
#24 (comment)
from python-jss.
@jmb03012 Take a look over my new notification thingy at yo. Still beta, but it gets the job done.
from python-jss.
This looks awesome! For production right now we will continue to utilize Casper since it provides a similar capability via the JAMF helper. Granted its not to notification center but our larger requirement was that you had to click to dismiss and we dont have to add something additional to the machine.
That said, this could definitely come in handy too. - Jordan
[email protected] At: Feb 25 2015 22:22:12" data-digest="From: [email protected] At: Feb 25 2015 22:22:12" style="">
From: [email protected] At: Feb 25 2015 22:22:12
To: [email protected]
Cc: JORDAN BENDER (BLOOMBERG/ 731 LEX)
Subject: Re: [python-jss] Way to create two policies? (#24)
@jmb03012 Take a look over my new notification thingy at yo. Still beta, but it gets the job done.
—
Reply to this email directly or view it on GitHub.
from python-jss.
Related Issues (20)
- importing __version__ from jss prevents pip install from working with pre-installing requirements
- Replace all `raw_input` with `input` from `six` in python3 HOT 3
- Incorrectly showing DP name as "<NO NAME CONFIGURED>"
- **kwargs computer match search not working
- Don't read upload file before passing to requests HOT 2
- Error Mounting SMB Shares on Big Sur
- ImportError: No module named cryptography HOT 3
- kNAUIOptionNoUI Error on High Sierra macOS HOT 3
- Use `/scripts` endpoint instead of `/dbfileupload` HOT 1
- Remove v8 -> v9 "migrated" stuff and assume everybody is now migrated. HOT 1
- Use `/jssuser` endpoint to determine JSS version HOT 1
- Calling j.Computer() with a subset always returns the 'general' subset HOT 1
- Search for a computer using MAC address HOT 5
- Install via pip requires 'cryptography' HOT 2
- Using own preferences file doesn't work if the file doesn't exist HOT 1
- sslv3 alert handshake failure with JAMF Pro 10.6 HOT 5
- Error when installing using pip HOT 2
- Python3 compatibility HOT 5
- "errorMessage": "__str__ returned non-string (type bytes)" when printing ComputerGroup object
- Please update README with current best practices for installing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-jss.