【发布时间】:2022-07-23 05:10:19
【问题描述】:
我有一个在loacalhost 上运行多个任务的剧本,如下所示,除了我需要将结果存储在文件中到远程服务器并在下一个任务中使用它作为基于文件内容的条件.
最好的方法是什么?我们如何为这个服务器定义凭据?
- hosts: localhost
tasks:
- name: run task1
debug: msg="running task on localhost"
- name: run task 2
debug: msg="running all others also localhost"
register: output
- name: store output in remote storage server
debug: msg="Copy the content of register output to a file in remote server"
delegate_to: "remote.storageserver.com"
【问题讨论】: