Sun Update Connection - Enterprise 1.0 User's Guide

Chapter 9 Profiles

This chapter explains how to use the powerful profile tool to manage multiple systems consistently while automating many tedious administration jobs.

This chapter covers the following topics:

Terms

This chapter uses the following terms:

Component

Any logical unit that is, or can be, part of a machine; not only software and files, but also any logical construct of the component hierarchy.

Inventory

(1) List of components installed on a managed host. (2) List of components on the universal server.

Knowledge Base

Sub-system of the Sun Update Connection – Enterprise system dependency server, acts as a proxy server for the universal server, holding and updating deployment rules and certified components.

Profile

Definition of a component configuration for a type of machine; what is required and what is not allowed to be installed on this type of machine.

Predefined Profile

Profile provided with Sun Update Connection – Enterprise that performs a full-system check and fix.

Working With Profiles

Create profiles to record the requirements of your enterprise and deploy the profiles to automatically create servers and workstations. Creation and deployment of profiles takes minutes, handles dependencies, and ensures consistency.

For example, you create a profile called Web Servers which defines that your web servers are required to have the httpd client and server, and must not have anonFtp. You deploy the profile. Sun Update Connection – Enterprise installs the necessary components, uninstalls those you do not want, and automatically handles dependent components.

You can schedule a job to deploy the profile on a routine basis, such as once a month. It will make sure that everything that you want (httpd) is still installed and does not have dependency conflicts. It will make sure that anonFtp is not installed.

Sun Update Connection – Enterprise profiles focus on the component level. You select a component from the knowledge base inventory and then apply a setting to it. The component settings are described in the following table.

Table 9–1 Profile Component Settings

Setting 

Setting on Package 

Setting on Category/Package Group 

Required 

If package is not installed, DR finds solution to install it. 

If installed, nothing is done. 

If at least one package is installed, nothing is done. 

If no package in category/group is installed, the one that is most cost-effective is installed. 

Not Allowed 

If package is installed, DR finds solution to uninstall it. 

If not installed, nothing is done. 

All packages within category/group are uninstalled. 

Upgrade 

If there is a newer version for an installed package, the package is upgraded. 

If the package is not installed, nothing is done. 

If there is more than one newer version, the most cost-effective is chosen. 

All packages within category/group are upgraded if newer versions exist. 

A profile is used as a single job. Its settings (Required, Not Allowed, Upgrade) affect a managed host only during the actual deployment of the profile. After you deploy a profile, you could run another job that contradicts the settings of the profile.

If you build a profile that has multiple Required and Not Allowed components, the Dependency Resolver (DR) may find a solution for the Required components that demands that a Not Allowed component be installed. If this happens, the DR rejects the solution and looks for another, one that will conform to both the Required and the Not Allowed settings.

ProcedureTo Create a Profile

In this procedure, you will create and save a new profile, to be used later in a job. Users of all levels can perform this procedure in the console. Other users see your profiles as read-only. They can deploy or copy your profiles; they cannot delete or edit them. This restriction applies to users of all levels.

  1. Do one of the following:

    • From the tool bar, click the Profiles button.

    • From the Tools menu, choose Profiles.

      The Profiles window opens.

  2. Do one of the following:

    • From the tool bar on the Profiles window, click the New button.

    • Right-click a blank space in the Profiles window and choose New.

      The Profile Editor window opens.

      Figure showing the Profile Editor window.
  3. From the drop-down list on the tool bar, select a distribution-architecture.

    The Components list shows the components of the selected distribution.

  4. Type a name for the profile and an optional free-text description.

  5. In the Components list, select a component.

  6. Assign a profile action to the selected component.

    Do one of the following:

    • From the tool bar, click the Required, Not Allowed, or Upgrade button.

    • Right-click the selected component and choose Required, Not Allowed, or Upgrade.

      The component setting appears in the Actions list of the Profile Editor.

      To make the profile applicable to hosts of different distributions:

      • To select specific components from different distributions, change the selection of the drop-down list of distributions in the tool bar. Find the relevant components and add the action settings to the Actions list.

      • To let Sun Update Connection – Enterprise find components from other distributions that are comparable to the ones you have in the Actions list, click the Multi Distribution button. See To Align Component Settings for Multiple Distributions.

  7. Click OK.

    The Profile Editor window closes. The profile is created and appears in the Profiles window.


Example 9–1 Creating a Profile with the CLI

The CLI command to create a profile allows for only one component and its setting. See Add Profile Attribute (-apa) Command.


#! /bin/bash 

echo -n “Enter your user name:” 
read user 
echo -n “Enter your password:” 
read password 
echo -n “Enter a string to search for exact component name:” 
read comp2find 
uce_cli -fc -T $comp2find -u $user -p $password 
echo -n “Copy the exact component name that you want to add to a profile:” 
read comp2use 
echo -n “Enter the name of a profile or create a new one:” 
read profileName 
echo “What do you want to do with the component?” 
echo “Make it Required, Not Allowed,” 
echo “or Upgraded when possible?” 
echo -n “Enter the setting (-R | -N | -U) (case-sensitive):” 
read setting 
uce_cli -apa -P “$profileName” -T “$comp2use” $setting -u “$user” -p “$password”

ProcedureTo Edit a Profile

In this procedure you will edit an existing profile that you created. Users of all levels can perform this procedure in the console.

You cannot edit a profile in the following circumstances:

  1. Do one of the following:

    • From the tool bar, click the Profiles button.

    • From the Tools menu, choose Profiles.

      The Profiles window opens.

  2. Select a profile from the list.

  3. Do one of the following:

    • From the tool bar of the Profiles window, click the Edit button.

    • Right-click the selected profile and choose Edit.

      The Profile Editor window opens.

  4. From the drop-down list on the tool bar of the Profile Editor, select a distribution-architecture.

    The Components list changes to display components of the selected distribution.

  5. Change as many component settings as you want.

    See Table 9–1.

    To add a component setting, select the component and do one of the following:

    • From the tool bar of the Profile Editor, click the Required, Not Allowed, or Upgrade button.

    • Right-click the selected component and choose Required, Not Allowed, or Upgrade.

    To delete a component setting, select an action in the Actions list and do one of the following:

    • From the tool bar of the Profile Editor, click the Delete button.

    • Right-click the selected action and choose Delete.

    To change a component setting, delete the action from the Actions list and then add a new action for the component setting you want.

  6. Add as many component settings as you want.

    To make the profile applicable to hosts of different distributions:

    • To select specific components from different distributions, change the selection of the drop-down list of distributions in the Profile Editor tool bar. Find the relevant components and add the action settings to the Actions list.

    • To let Sun Update Connection – Enterprise find components from other distributions that are comparable to the ones you have in the Actions list, click the Multi Distribution button. See To Align Component Settings for Multiple Distributions.

  7. Click OK.

    The Profile Editor window closes. The profile is edited.


Example 9–2 Editing a Profile with the CLI

The CLI command to edit a profile is the same as to create a profile. See To Create a Profile.


ProcedureTo Edit a Scheduled Profile

You can edit a profile that you created, even if you deleted it from the profiles list, so that future deployments or simulations of the profile will be different from the original profile. Use this procedure to change scheduled jobs.

You can edit scheduled profiles only when the following are all true:

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

  2. Select a job name in the Jobs list and then select one of the tasks that appear in the Tasks list.

  3. Do one of the following:

    • From the tool bar, click the Edit Scheduled Profile button.

    • Right-click the selected task and choose Edit Profile.

    • From the Jobs menu, choose Tasks -> Edit Scheduled Profile.

      The Profile Editor window opens.

  4. Edit the profile as needed.

  5. Click OK.

    The Profile Editor window closes. The profile is edited for the next run of the job.

ProcedureTo Copy a Profile

In this procedure you will copy an existing profile. Use this procedure when another user has created a profile that is useful to your own deployment and management jobs, but you want to be able to edit it. You could also use this procedure on your own profiles, to create a new profile based on a prior one. You cannot copy a Predefined System Test Profile (see Chapter 7, System Management Profiles). Users of all levels can perform this procedure in the console.

  1. Do one of the following:

    • From the tool bar, click the Profiles button.

    • From the Tools menu, choose Profiles.

      The Profiles window opens.

  2. Select a profile from the list.

  3. Do one of the following:

    • From the tool bar of the Profiles window, click the Copy button.

    • Right-click the selected profile and choose Copy.

      The Profile Editor window opens.

  4. Edit the profile as needed, or simply change the name.

  5. Click OK.

    The Profile Editor window closes. A copy of the profile with the new name appears in the Profiles window.


Example 9–3 Copying a Profile with the CLI

The copy profile command in the CLI allows you only to save a profile under a new name, without making changes to the settings. See Copy Profile (-cp) Command.


#! /bin/bash

echo -n “Enter your user name:” 
read user 
echo -n “Enter your password:” 
read password 
echo -n “Enter a string to search for exact component name:” 
read comp2find 
uce_cli -fc -T $comp2find -u $user -p $password 
echo -n “Copy the exact component name that you want to add to a profile:” 
read comp2use 
echo -n “Enter the name of a profile or create a new one:” 
read profileName 
echo “What do you want to do with the component?” 
echo “Make it Required, Not Allowed,” 
echo “or Upgraded when possible?” 
echo -n “Enter the setting (-R | -N | -U) (case-sensitive):” 
read setting 
uce_cli -apa -P “$profileName” -T “$comp2use” $setting -u “$user” -p “$password”

ProcedureTo Copy an Active Profile

You can copy any profile (except a Predefined System Test Profile), even if the owner deleted it from the profiles list or it is in a currently active job. Use this procedure to create new profiles from those used in jobs.

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

  2. Select a job name in the Jobs list and then select one of the tasks that appears in the Tasks list.

  3. Do one of the following:

    • From the tool bar, click the Copy Profile button.

    • Right-click the selected task and choose Copy Profile.

    • From the Jobs menu, choose Tasks -> Copy Profile.

      The Profile Editor window opens.

  4. Edit the profile as needed, or simply change the name.

  5. Click OK.

    The Profile Editor window closes. The profile with the new name is added to the Profiles window.

ProcedureTo Delete a Profile

In this procedure, you delete a profile that you created. Users of all levels can perform this procedure in the console.

You cannot delete profiles in the following circumstances:

  1. Do one of the following:

    • From the tool bar, click the Profiles button.

    • From the Tools menu, choose Profiles.

      The Profiles window opens.

  2. Select a profile from the list.

  3. Do one of the following:

    • From the tool bar of the Profiles window, click the Delete button.

    • Right-click the selected profile and choose Delete.

  4. In the confirmation dialog box, click Delete again.


Example 9–4 To Create a Postfix Mail Server Profile – Example

The previous procedures explained how to create, edit, copy, and delete profiles, in general. This procedure is a specific example of a profile for a mail server.

  1. To open the Sun Update Connection – Enterprise Console, type uce_console in a terminal shell and log in with a valid user name and password.

  2. From the Tools menu, choose Profiles.

    The Profiles window opens.

  3. Right-click in the Profiles window and choose New.

    The Profile Editor window opens.

  4. From the drop-down list in the tool bar of the Profile Editor, select a distribution.

  5. Give the profile a name.

    For example, you might name the profile PostfixMailServer.

  6. Type a description of the profile.

  7. In the components list, find postfix, right-click it and choose Required.

    See To Find Components for details on searching the Components list.

    Required postfix appears in the Actions list.

  8. Find sendmail, right-click it and choose Not Allowed.

    Not Allowed sendmail appears in the Actions list.

  9. Right-click in the Actions list and choose Multi-Distribution.

    The Multi Distributions window opens. Your locally active distributions are listed. Those that are listed in green have a component match.

  10. Click OK.

    The Multi Distributions window closes. The Actions list in the Profile Editor now includes more actions for the additional distributions.

  11. In the Profile Editor, click OK.

    The Profile Editor closes. PostfixMailServer appears in the Profiles list.

    To deploy the Mail Server Profile, see Chapter 11, Complex Jobs.