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