Ibm mq 在Ansible中,如何接受WebSphere MQ许可协议作为剧本的一部分?
我正在将手动服务器配置过程转换为Ansible playbook。该过程的一部分涉及安装WebSphere MQ客户端。一个步骤涉及手动运行脚本,Ibm mq 在Ansible中,如何接受WebSphere MQ许可协议作为剧本的一部分?,ibm-mq,ansible,Ibm Mq,Ansible,我正在将手动服务器配置过程转换为Ansible playbook。该过程的一部分涉及安装WebSphere MQ客户端。一个步骤涉及手动运行脚本,mqlicense.sh,并接受许可协议以响应提示。我如何在Ansible中完成此任务 如果我运行脚本,ansible进程将挂起。如果跳过该步骤,将出现以下错误: ERROR: Product cannot be installed until the license agreement has been accepted.
mqlicense.sh
,并接受许可协议以响应提示。我如何在Ansible中完成此任务
如果我运行脚本,ansible进程将挂起。如果跳过该步骤,将出现以下错误:
ERROR: Product cannot be installed until the license
agreement has been accepted.
Run the 'mqlicense' script, which is in the root
directory of the install media, or see the
Quick Beginnings book for more information.
更新
进一步的谷歌搜索让我想到了,它说:
如果要在不显示许可证的情况下接受许可证,可以运行
带有-accept选项的mqlicense.sh脚本
/mqlicense.sh-接受
然而,在我的情况下,这似乎不起作用。当我从命令行运行该命令时,仍然会出现交互式提示。问题在于mqlicense.sh脚本。显然,它使用了一些与bash不兼容的语法。因此,当我在Debian服务器上运行它时,脚本抱怨:
./mqlicense.sh: 99: ./mqlicense.sh: [[: not found
中提到的解决方案是安装korn shell(ksh
),并使用它接受许可证。我的剧本中包括以下任务:
包括ksh
和系统包:
- name: Install debian packages
apt: pkg=${item} state=installed
with_items:
- alien
- ksh
使用ksh
调用脚本:
# Need to run this with ksh; script syntax is not bash-compliant
- name: Accept MQ Client license
command: ksh mqlicense.sh -accept chdir=${vsphere_wd}
Ansible剧本可在此处找到: