在linux中使用ansible运行.bin可执行文件

时间:2016-03-17 15:08:18

标签: ansible

我对ansible很新。我能够创建安装rpm和deb软件包的ansible脚本。但是,我没有找到任何运行和安装.bin文件的示例 我们的想法是触发安装.bin文件,该文件位于本地下载文件夹中。

这可能吗? 我试过这样的

- file: path=$HOME/Downloads/Xplorer-6.0.1-linux-installer.bin state=touch mode="u=rwx,g=rx,o=rx"

- expect:
    command: $HOME/Downloads/Xplorer-6.0.1-linux-installer.bin
    responses: 
      Question: Do you accept this license? [y/n]
        - response: y

1 个答案:

答案 0 :(得分:1)

我认为您可以使用' script'模块。它的工作方式如下:

- script: /some/local/bin_file.bin --some-arguments 1234 creates=/the/created/file.txt

creates参数是可选的,仅在需要保证 idempotence 时使用。