Oracle静默式安装在Chef中失败



我正试图在Chef中的RHEL虚拟机上安装Oracle。当我作为安装用户("oracle1"(直接登录到VM并运行静默安装命令时:

./runInstaller -ignorePrereq -waitforcompletion -silent -responseFile /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp

安装成功。

我想通过将其添加到我现有的厨师食谱中来自动安装,我目前正在尝试使用以下块:

execute 'install oracle' do
command './runInstaller -ignorePrereq -waitforcompletion -silent -responseFile /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp'
cwd '/u01/app/oracle/product/19.0.0/dbhome_1'
user 'oracle1'
group 'oinstall'
#not_if { ::File.exist?("/u01/app/oracle/product/completed.txt") }
end 

但是,此块失败并导致以下错误:

[FATAL] [INS-32042] The Installer has detected that the user (oracle1) is not a member of the central inventory group: oinstall
ACTION: Make sure that the user (oracle1) is member of the central inventory group (oinstall)

但是,在之前的配方中,我运行了块:

execute 'luseradd' do
command 'sudo luseradd -g oinstall -d /home/oracle1 -s /bin/bash oracle1'
not_if { Dir.exist?("/home/oracle1") }
end

据我所知,这与我收到的错误信息相矛盾。此外,当我检查oracle1所属的组时,oinstall会被列为其中之一。

任何帮助/建议都将不胜感激!

您可以这样修改执行块:

execute 'install oracle' do 
command 'sudo -Eu oracle1 ./runInstaller -ignorePrereq -waitforcompletion -silent -responseFile /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp'    
cwd '/u01/app/oracle/product/19.0.0/dbhome_1'
#not_if { ::File.exist?("/u01/app/oracle/product/completed.txt") }  
end

此外,您可能需要修改您的用户oracle1,以便它可以在不传递root密码的情况下执行命令。

最新更新