-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.0.5] Not possible to provide parameter values for scripts that are to be uploaded #130
Comments
I also cannot separate the script creation into a separate Processor. For some weird reason, the script is still added twice. Example:
PolicyTemplate.xml:
ScriptTemplate.xml:
This makes the |
There's a lot of implicit behavior that happens when you run a JSSImporter processor in an AutoPkg recipe. You have two JSSImporters back to back, but there's nothing clearing the AutoPkg env in-between, so both processors are going to use the same values from the Input section, minus the differences explicitly set in the processor items. Is it possible that something is happening here? That's probably why it's doing it twice? About the parameters, I don't recall what the rules are exactly, but you should be able to put whatever you want into the AutoPkg env with Input values, and then JSSImporter will make them available as replacements in the template. I.e. your recipe has an input for |
Revisiting this issue as it's still a problem. It doesn't appear to be possible to add a script AND have the Given this script template:
If you put this in the If you put the same XML in a You can add the following in the
If you add a ScriptTemplate.xml AND have the script stuff in the PolicyTemplate.xml, the script is uploaded, but it is added twice to the policy, once without the parameter4 and once with. So, how does one upload a script AND provide parameter values (not labels) in the same JSS run? |
@grahampugh and I discussed this on Slack today. The fundamental issue here is that the Currently, there are no AutoPkg variables handled specially by the code regarding parameters. It does copy the priority from the script object to the policy's reference to it. However, it does not add anything to the policy except the name and id (the python-jss method My proposal is to create two new keys that can be part of the JSSImporter's scripts/script dict: So the final process would look roughly like this:
This really leaves the script template as unnecessary, so if we can determine that removing it causes a minimum of grief, we could potentially remove script templates after a suitable deprecation period. |
@sheagcraig I’m going to work on this proposal shortly. One thing that occurs to me though - why are scripts and script-based EAs still treated differently? I understand the legacy reason that scripts were formerly uploaded as files, but now there is really no difference. It looks like it shouldn’t be difficult to unify the handling of both types of script, so that EA scripts could be separate from their template. It would need to still work for EA templates with an embedded script object as before, but there could be advantages for allowing that for script objects too, for instance so that text substitution in the body of the script could be carried out. I see that a script template could be unnecessary given your suggestion above, however, which would change the above idea. EAs will always need a template since that information is not part of a policy template. Thoughts? |
I have implemented this facility into my |
There appears to be no means of providing a parameter value for a script that is included in a policy.
The
<parameters></parameters>
section of a Script Template provides the opportunity to alter the display name of each parameter, but there's no means of inputting a value to the parameters.If a Policy Template is edited, so that the parameter value can be included, this adds another script entry to the policy in addition to the one added due to the presence of a Script Template. This would result in the script running twice, once without the parameter value and once with.
It should be possible to provide both parameter display names to scripts and parameter values to script entries of policies.
The text was updated successfully, but these errors were encountered: