0

We have an automated process of deploying new RHEL VMs. However, there's still an annoying manual step to install a NetBackup agent on the machine. This requires coyping a large archive (~ 1 GB) to the machine, extract the archive and run an interactive installation script.

So I was thinking about building a custom RPM for this which contains the NetBackup agent installation files and runs a custom expect script to automate the interactive installer. We could then simply push this RPM to the server.

However, I'm new to building RPMs (read: never done this before) so I don't know how to "glue" the parts together. I already have the expect script and of course the agent installation files (tar.gz archive). Now how would I package this all together into one RPM?

Expect script:

#!/usr/bin/expect -d
set timeout -1
spawn ./install
expect "Do you wish to continue?"
send "y\n"
expect "Do you want to install the NetBackup client software for this client?"
send "y\n"
expect "Enter the name of the NetBackup master server"
send "myserver.example.com\n"
expect "name of the NetBackup client?"
send "n\n"
expect "Enter the name of this NetBackup client"
send "client.example.com\n"
expect eof

Archive: client-7.6.0.1.tar.gz

.
├── Doc
├── install (the interactive installer)
└── NBClients
EsTeGe
  • 261
  • 1
  • 5
  • 13

2 Answers2

0

Take a look at fpm is allows you to build arbitrary .rpm ( and other package types quite easily). There's plenty of documentation, amongst other things you'll probably find the --after-install FILE useful as it names A script to be run after package installation.

user9517
  • 114,104
  • 20
  • 206
  • 289
0

Try to create netbackup client configuration file and put it into RPM package. No need expect script which is for creating client configuration file.

  • The expect script does more than just creating the client config file. It invokes the installer which does lots of other stuff. – EsTeGe Jun 25 '15 at 11:04