X

News, tips, partners, and perspectives for the Oracle Solaris operating system

AI Manifest Editor CLI in Solaris 11.3

Guest Author

Introducing the AI Manifest Editor CLI in Solaris 11.3

Does anyone like editing XML files?

In Solaris 11.3, we have added an interactive editing
capability to installadm(1M) that allows you to create and edit a customized
XML manifest for an AI install service, without having to view or understand an
XML document.

The interactive interface presents the AI manifest content
as a set of objects and properties that can be manipulated using subcommands entered at the interactive
interface prompt. The interface can be accessed from the create-manifest or
update-manifest subcommands.

Creating a Manifest

To give you an idea of how it works, let's walk through a
sample session. Assume you want to create a new manifest for install service
sol_11_3 and change the publisher to point to a local repository.

# installadm
create-manifest -n sol_11_3 -m mymanifest
(
no need to provide -f
option)

Type help to see list of
subcommands.

installadm:mymanifest> help

The following subcommands are supported:
Operations: set     add delete  move
Navigation: select  cancel  end
Additional: help    info    walk
 commit exit    validate
shell

For more information, type:
help <subcommand>

installadm:mymanifest> help info

Usage:
info [-v|--verbose]
Display information about object and property settings starting at the
current level. For objects more than one level down, a summary line is
displayed, followed by '...'. When multiples of a given object exist,
the order is designated by <object>[<position#>], e.g., disk[3]. Use
'-v' option for verbose output.

installadm:mymanifest> info (a reasonable set of defaults is pre-set
for you)

http-proxy: <not specified>
auto-reboot: false
  create-swap: true
  create-dump: true
  software:
     type: IPS
     name: <not specified>
     facet[1]: facet.locale.*=false ...
     ...
     publisher: name=solaris ...
     pkg-list: action=install ...
  disk: Section not specified
  pool:
     action: create
     name: rpool
     is-root: true
     is-boot: false
     mount point: <not specified>
     pool-option: Section not specified
     dataset-option: Section not specified
     be: name=solaris ...
        be-option: Section not specified
     vdev: Section not specified
     filesystem[1]: name=export ...
        option: Section not specified
     filesystem[2]: name=export/home ...
        option: Section not specified
     volume: Section not specified
  boot-mods: Section not specified
  configuration: Section not specified

installadm:mymanifest> select software (the publisher object is located under software)

installadm:mymanifest:software> select
publisher
(
the prompt changes to reflect the selected level)

installadm:mymanifest:software:publisher>
info

name: solaris
  key: <not specified>
  cert: <not specified>
  ca-cert: <not specified>
origin: http://pkg.oracle.com/solaris/release  (you want to set this - get help for 'set')
mirror: <not specified>
cmd-options: <not specified>

installadm:mymanifest:software:publisher>
help set

Usage:
set <property>=<value>
Valid properties to set are:
origin, cmd-options, name, ca-cert, cert, key, mirror

installadm:mymanifest:software:publisher>
set origin=http://myrepo.example.com/solaris

installadm:mymanifest:software:publisher>
info

name: solaris
  key: <not specified>
  cert: <not specified>
  ca-cert: <not specified>
  origin: http://myrepo.example.com/solaris  (reflects newly set origin)
mirror: <not specified>
cmd-options: <not specified>

installadm:mymanifest:software:publisher>
end (
goes up one level)

installadm:mymanifest:software> end

installadm:mymanifest> exit

1. Save manifest and exit
2. Exit without saving uncommitted changes
3. Continue editing
Please select choice: 1

(choose to save the manifest)

Created Manifest: 'mymanifest'   (and
the manifest is created - it's that simple!)

For those doubters among us, if you now export the manifest,
you will see the XML snippet:

     <publisher name="solaris">
         <origin name="http://myrepo.example.com/solaris"/>
     </publisher>

.....which reflects the change that was just made.


Updating a manifest

Similarly, you can use the interactive interface to edit a
manifest using update-manifest. Let's add a new publisher to the manifest we
just created above, but place it first in the search order:

# installadm
update-manifest -n sol_11_3 -m mymanifest

Type help to see list of subcommands.

installadm:mymanifest> select software

installadm:mymanifest:software> add
publisher
(
add new publisher object)

  name: <not specified>
  key: <not specified>
  cert: <not specified>
  ca-cert: <not specified>
  origin: <not specified>
  mirror: <not specified>
  cmd-options: <not specified>

installadm:mymanifest:software:publisher>
set name=publisher2

installadm:mymanifest:software:publisher>
set origin=http://pub2origin.com/repo

installadm:mymanifest:software:publisher>
end

installadm:mymanifest:software> info

type: IPS
  name: <not specified>
  facet[1]:
     name: facet.locale.*
     value: false
  ...
  publisher[1]:
     name: solaris
     key: <not specified>
     cert: <not specified>
     ca-cert: <not specified>
     origin: http://myrepo.example.com/solaris
     mirror: <not specified>
     cmd-options: <not specified>
  publisher[2]:
     name: publisher2
     key: <not specified>
     cert: <not specified>
     ca-cert: <not specified>
     origin: http://pub2origin.com/repo
     mirror: <not specified>
     cmd-options: <not specified>
  pkg-list:
     action: install
     name: pkg:/entire@0.5.11-0.175.3
     name: pkg:/group/system/solaris-large-server
     reject: <not specified>

installadm:mymanifest:software>
move publisher 2 1 (moves new publisher to position 1)

installadm:mymanifest:software>
info

  type: IPS
  name: <not
specified>
  facet[1]:
     name: facet.locale.*
     value: false
  ...
  publisher[1]:
     name: publisher2
     key: <not specified>
     cert: <not specified>
     ca-cert: <not specified>
     origin: http://pub2origin.com/repo
     mirror: <not specified>
     cmd-options: <not specified>
  publisher[2]:
     name: solaris
     key: <not specified>
     cert: <not specified>
     ca-cert: <not specified>
     origin: http://myrepo.example.com/solaris
     mirror: <not specified>
     cmd-options: <not specified>
  pkg-list:
     action: install
     name: pkg:/entire@0.5.11-0.175.3
     name: pkg:/group/system/solaris-large-server
     reject: <not specified>

installadm:mymanifest:software> exit

1. Save manifest and exit
2. Exit without saving uncommitted changes
3. Continue editing
Please select choice: 1
Changed Manifest: 'mymanifest'

Updating Derived Manifest Scripts

While it isn't possible to edit derived manifest scripts
with the interactive interface, we've made it easier for you to modify them by
invoking an editor from update-manifest.

Let's say you want to update the manifest,
"orig_default", of the sol_11_3 service.

# installadm list -m -n
sol_11_3

Service Name Manifest Name Type    Status   Criteria
------------ ------------- ----    ------   --------
sol_11_3  orig_default  derived default  none

# installadm
update-manifest -n sol_11_3 -m orig_default

  < Places you into an editor specified by the environment
variable, VISUAL. 
 If VISUAL is not defined, EDITOR is used
instead. If neither are defined, 
then the default editor vi(1) is used. Make
changes, save, and exit. >

Changed Manifest: 'orig_default'

This one step process replaces what was previously 4 steps
(running "installadm export" to copy the orig_default manifest to a
file, editing the file, running "installadm update-manifest -f" to
update orig_default, and then removing the edited file).

Creating and/or Updating a Manifest from a File and Editing the Contents

If you want to create or update a manifest from a file, but
want to edit the manifest contents before the manifest is saved to the install
service, you can use the -e option.

Here we create a manifest based on the default_archive.xml
file located under:

 <imagepath>/auto_install/manifest/default_archive.xml

# installadm
create-manifest -n sol_11_3 -f /export/auto_install/sol_11_3/auto_install/manifest/default_archive.xml
-m myarchive -e

Type help to see list of subcommands.

installadm:myarchive>
info

  http-proxy: <not specified>
  auto-reboot: false
  create-swap: true
  create-dump: true
  software:
     type: ARCHIVE
     name: <not specified>
     uri: file:///.cdrom/archive.uar
     key: <not specified>
     cert: <not specified>
     ca-cert: <not specified>
     http-auth-token: <not specified>
     archive-name: *
  disk: Section not specified
  pool:
     ...
  boot-mods: Section not specified
  configuration: Section not specified

installadm:myarchive> select software

installadm:myarchive:software> set uri=http://someserver/dir/myarchive.uar

installadm:myarchive:software> info

type: ARCHIVE
  name: <not specified>
  uri: http://someserver/dir/myarchive.uar
  key: <not specified>
  cert: <not specified>
  ca-cert: <not specified>
  http-auth-token: <not specified>
  archive-name: *

installadm:myarchive:software> end

installadm:myarchive> commit

installadm:myarchive> validate

installadm:myarchive> exit

1. Save manifest and exit
2. Exit without saving uncommitted changes
3. Continue editing
Please select choice: 1
Created Manifest: 'myarchive'

You can do the same thing if -f points to a derived manifest
script, but you will be placed into an editor such as vi(1) as described
earlier. Let's say you want to create a manifest based on the script,
myscript.ksh, but you want to make a couple of changes (without modifying
myscript.ksh).

# installadm
create-manifest -n sol_11_3 -m myderived -f ./myscript.ksh -e

<Make changes, save, and exit.>

Created Manifest: 'myderived'
 

You can similarly use the -f and -e options for update-manifest.

Creating a Manifest from an Existing Manifest

Another handy addition to create-manifest added in Solaris
11.3 is the ability to create a manifest based on the contents of an existing
manifest (-M).

You can optionally append the -e option if you want to edit the
manifest with the interactive interface (for an XML manifest) or editor (for a
derived manifest script) before it is saved to the install service.

For instance, the following command copies the content of
the myarchive manifest and allows you to modify it before creating the
newarchive manifest (the myarchive manifest is unchanged).

# installadm
create-manifest -n sol_11_3 -M myarchive -m newarchive -e

Type help to see list of subcommands.

installadm:newarchive> info

  http-proxy: <not specified>
  auto-reboot: false
  create-swap: true
  create-dump: true
  software:
     type: ARCHIVE
     name: <not specified>
     Uri: http://someserver/dir/myarchive.uar
     key: <not specified>
     cert: <not specified>
     ca-cert: <not specified>
     http-auth-token: <not specified>
     archive-name: *
  disk: Section not specified
  ...

installadm:newarchive> select software

installadm:newarchive:software> set uri=http://newserver/newdir/newarchive.uar

installadm:newarchive:software> info

  type: ARCHIVE
  name: <not specified>
  uri: http://newserver/newdir/newarchive.uar
  key: <not specified>
  cert: <not specified>
  ca-cert: <not specified>
  http-auth-token: <not specified>
  archive-name: *

installadm:newarchive:software> exit

...

Please select choice: 1
Created Manifest: 'newarchive'

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.