【问题标题】:Ansible Tower - How to copy files from Remote Linux Server1 going to Remote Linux Server2 [closed]Ansible Tower - 如何将文件从远程 Linux Server1 复制到远程 Linux Server2 [关闭]
【发布时间】:2021-10-06 13:51:47
【问题描述】:

嗨,我有一个 Ansible Tower。

我希望我的剧本在 Ansible Tower 中运行并执行以下操作: 将文件从远程 Linux 服务器 1 复制到远程 Linux 服务器 2。

我尝试了模块:Copy and Fetch,但似乎 playbook 在 Ansible Tower 中运行时的行为有所不同。

【问题讨论】:

标签: ansible ansible-tower


【解决方案1】:

关于

... playbook 在 Ansible Tower 中运行时的行为不同...

据我所知,Ansible Tower 只是 Ansible Engine 的 Web 前端,因此我还没有获得过这样的经验。

将文件从远程 Linux 服务器 1 复制到远程 Linux 服务器 2。

在这种情况下,synchronize_module 可能是解决方案。对于数据库复制设置,我使用类似的构造

- name: Synchronize file from primary to secondary
  synchronize:
    src: "/tmp/file.tar.gz"
    dest: "/tmp/file.tar.gz"
    mode: push
  delegate_to: "{{ PRIMARY_HOST }}"
  when: "{{ SECONDARY_HOST }}"
  tags: replication,rsync

将文件从主节点“复制”到辅助节点。 How to copy files between two nodes using Ansible下也有很多答案。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-09-09
    • 1970-01-01
    • 1970-01-01
    • 2017-05-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-09
    相关资源
    最近更新 更多