且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 Ansible 中使用脚本模块

更新时间:2023-12-05 21:10:34

首先,您不使用 script 模块运行可执行文件,而是使用 commandshell 模块.

Firstly, you don't run an executable using script module, but using a command or shell module.

其次,您应该利用 Ansible 事实.架构(uname -m 的结果)存储在 ansible_facts.architecture 事实中:

Secondly, you should utilise Ansible facts for that. The architecture (the result of uname -m) is stored in the ansible_facts.architecture fact:

command: setarch {{ ansible_facts.architecture }} --uname-2.6 /opt/files/IBM/ITM/install.sh -q -h /opt/files/IBM/ITM/Install -p /opt/files/silent_install.txt