Sun Update Connection - Enterprise 1.0 User's Guide

Creating Complex Jobs

In the following procedures, you will select the objects and options of a job and then run the job on selected hosts.

Before you begin a job on a Solaris machine, make sure the PKG deployment preferences are appropriate for your local needs. See Host Preferences – PKGs on Host Preferences – PKGs.

This procedure is broken up into the following parts:

ProcedureTo Set Up the Objects of a Job

  1. Make sure the Jobs panel is available in the main window by choosing Jobs from the View menu.

  2. Do one of the following:

    • From the tool bar, click the New Job button.

    • Right-click in the Jobs list and choose New Job.

    • From the Jobs menu, choose New.

      The New Job window opens.

  3. Give the job a name and a free-text description.

  4. Select a mode for the job:

    • Deploy – Perform the tasks on the selected hosts

    • Simulate – Test the job to estimate time and full action list

      A user may be restricted to executing jobs only in Simulate mode.

  5. Do the following:

    1. Create tasks for the job.

      See To Create the Tasks of a Job.

    2. Set job options or leave the default settings.

      See To Set Job Options.

    3. Set a schedule or leave the default Now schedule.

      See To Set Job Schedules.

ProcedureTo Create the Tasks of a Job

  1. In the Tasks tab of the New Job window, click Add Task.

    The Task Editor opens.

  2. Type a name for a task.

  3. Select a profile from the drop-down list, or click the profile editor button to open the Profile Editor and create a new profile.

    If you select a user-defined profile and then click the button, you can edit an existing profile.

  4. Select a policy from the drop-down list, or click the policy editor button to open the Policy Editor, to create or edit a policy as you would a profile.

  5. Click the Hosts button to the right of the Hosts field.

    The Select Hosts window opens.

  6. Select hosts and groups and then click the Add button.

    The hosts or groups are added to the Selected Hosts list.

  7. When the Selected Hosts list contains the hosts or groups that you want to receive this job, click OK.

    The Hosts window closes. The selected hosts and groups appear in the Hosts field of the Tasks tab.

  8. Click OK.

    The task is added to the Tasks list of the job. Add as many tasks as you want.

    The order of the tasks in the list is the order that they will be executed. To change this order, select a task name and click the Up or Down buttons.

    To edit a task, select the task and click the Edit button.

    To remove a task from the job, select the task and click the Delete button.

  9. Decide how to continue:

    • If you want to run the job with default settings, click OK now.

    • If you want to set a deployment schedule, go to To Set Job Schedules.

    • If you want to view and edit the job options, go to To Set Job Options.

    • If you want to save the tasks as a job template, click Save Template.

ProcedureTo Set Job Schedules

  1. Open the Schedule tab.

    This screen capture shows the Schedule tab of the New Job window.
  2. Select a schedule type:

    • Single – have the job run at a future date and time.

    • Recurring – have the job run on a recurring basis.

ProcedureTo Set a Single Schedule

  1. Select Single.

  2. In the Time text box, select the hour and the minutes.

    Type in the desired time, or use the arrows to change the selection.The time settings are by 24 hours: 13:00 = 1pm, 14:00 = 2pm, ... 00:00 = midnight.

  3. Click the button to the right of the Date box.

    The Calendar opens.

  4. Select a date and then click OK.

    The Calendar closes. The selected date appears in the Date field.

  5. In the New Job window, click OK or set job options.

    See To Set Job Options.

    The job will begin on the selected time and date.

ProcedureTo Set a Recurring Schedule

  1. Select Recurring.

  2. In the Month drop-down list, select either Every Month (all year schedule) or a specific month (monthly schedule).

  3. Select days of the month:

    • Every day – Job runs every day of the month, or year (if Every Month was selected).

    • Day in week – Select the days of the week on which the job will be run.

    • Day in month – Select dates in the month on which the job will be run.

  4. Select time of the day:

    • Earliest – Set a time (hour:minutes) for the first run of the job.

    • Interval – Set a minute interval, to have the job run multiple times during a day.

    • Latest – Set a time for the latest run of the job, if an interval for multiple runs was selected.

ProcedureTo Set Job Options

  1. Open the Options tab.

    This screen capture shows the Options tab of the New Job window.
  2. Select Use Secure Components only if you want to give priority to secure versions. Deselect it to give priority to cost-effective versions, which makes the job run faster.

  3. If you set a recurring schedule for the job, decide how the job should be handled if selected profiles and policies are changed between now and the next run of the job.

    Option 

    Selected Function 

    Deselected Function 

    Notify of changes 

    If the owner of the profiles or policies changes them, you will get an email notification. Select if using profiles/policies that other users created. 

    You are not notified of changes. Deselect if you own the selected profiles or policies and do not want the reminder emails. 

    Accept changes before next run 

    Use updated profiles or policies. Select for consistency and automation. 

    Use the profiles or policies as they were when you created the job. Deselect for predictability. 

  4. Specify how you want the task to run in relation to other tasks and how to handle failures.

    Option 

    Selected Function 

    Deselected Function 

    Parallel 

    Run the job simultaneously with other jobs. Do not run jobs that depend on the results of other jobs in parallel. Run such jobs in sequential mode only.

    Run the job after the previous job completed. By default, a job is run sequentially. 

    Sequential 

    Run the job after other jobs have completed. 

    Run the job in parallel mode. 

    Continue on failure 

    Continue to run a job even if one of the steps or tasks experienced a failure. This option is only available for jobs that run in sequential mode. 

    Terminate a job if a step or task experiences a failure. 

    Priority 

    Select or change a priority for ajob. Values are Low, Medium, and High. 

    By default, the priority is set to Medium. 

Running a Job with the CLI

The CLI command to submit a job runs one task on a single selected host or group. See Submit Job (-sj) Command.


#! /bin/bash 

echo -n “Enter your user name:” 
read user 
echo -n “Enter your password:” 
read password 

echo -n “Type a name for this job:” 
read jobname 
echo -n “Do you want to run this job on a host or a group? (h|g):” 
read hostgroup 
if [ $hostgroup = “h” ];then 
  echo “Hosts are:” 
  uce_cli -lah -u “$user” -p “$password” 
else 
  echo “Groups are:” 
  uce_cli -lg -u “$user” -p “$password” 
fi 
echo -n “Copy host or group name to receive job:” 
read selected 

echo “Profiles are:” 
uce_cli -lp -u “$user” -p “$password” 
echo -n “Copy profile to use:” 
read profile 
echo “Policies are:” 
uce_cli -lc -u “$user” -p “$password” 
echo -n “Copy policy to use:” 
read policy 

echo “Simulating $jobname” 
uce_cli -sj -j “$jobname” -P “$profile” -C “$policy” -$hostgroup “$selected” 
   -us -sm -u “$user” -p “$password” 
echo -n “Do you want to deploy $jobname? (y|n)” 
read yes 
if [ $yes = “y” ]; then 
  uce_cli -sj -j “$jobname Deployed” -P “$profile” -C “$policy” -$hostgroup 
  “$selected” -us -dp -u “$user” -p “$password” 
fi