Schedule a job with "Prompt on launch" values

If I create a template with one or more “Prompt on launch” values, is there any way to schedule it and supply those values? For example, I would like to create a template that prompts for a “–limit” flag, and create several scheduled jobs based on that same template which each hit a different segment of my infrastructure.

Alternatively I could create separate templates for each segment of the infrastructure, but it seems cleaner to create multiple schedules on a single template.

This is a new feature, and I just merged the API side of it within the last few days. Please, go ahead and try it out and let us know how it goes!

So let me cover some basic steps to get you running without the UI part of that implemented yet.

(in the UI)

  • Go to your job template, make sure that limit is set to Prompt on launch for limit
  • Create a schedule for your job template, set the frequency and everything you want
  • while on the schedule, note the integer number in the URL bar

(in the API)

  • navigate to http://yourserver.invalid/api/v2/schedules/N/, where N is the integer you got from previous step
  • in the text box at the bottom of that page, remove everything except for
    {“limit”: “myserver”}
  • click the button to PATCH

That should get your schedule to spawn jobs that target the specific host pattern “myserver”.