我们有一个部署新的RHEL VM的自动化过程。但是,在机器上安装NetBackup代理仍然有一个恼人的手工步骤。这需要在机器上输入一个大型归档文件(~ 1GB),解压缩归档文件并运行交互式安装脚本。
因此,我考虑为此构建一个自定义RPM,它包含NetBackup代理安装文件,并运行一个自定义expect脚本来自动化交互式安装程序。然后,我们可以简单地将这个RPM推送到服务器。
然而,我对构建RPM(阅读:从来没有这样做过)很陌生,所以我不知道如何将这些部件“粘合”在一起。我已经有了expect脚本,当然还有代理安装文件(tar.gz归档)。现在,我如何将所有这些打包到一个RPM中呢?
#!/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存档:client-7.6.0.1.tar.gz
.
├── Doc
├── install (the interactive installer)
└── NBClientshttps://serverfault.com/questions/666188
复制相似问题