我正在尝试在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被列为其中之一。
任何帮助/指示都将不胜感激!
发布于 2022-06-24 13:31:50
您可以像这样修改execute块:
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,这样它就可以执行命令而无需传递根密码。
https://stackoverflow.com/questions/71841994
复制相似问题