且构网

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

Ansible:读取远程文件

更新时间:2023-01-15 17:52:44

请注意,在提出此问题时,以下解决方案是可以接受的.更高版本的 Ansible 可能会提供更好的解决方案来解决这个问题.

正如您所说,所有查找都在本地主机上.但是所有这些都可以通过使用 shellregister 在远程完成.你能说出你到底想做什么吗?只是一个例子.

As you said, all lookups are on localhost. But all of them can be done on remote by using shell and register. Can you tell what exactly you are trying to do? just an example.

  - shell: cat "{{remote_file}}"
    register: data

  - shell: ......
    with_xxxx: