Как пользователь, я хочу скопировать файл с узла 1 на узел 2. Возможно ли это с модулем копирования + Delegate_to
Вот то, что я пытался сделать. Playbook работает с узла 3.
Playbook Sample
---
- name: Gather Facts for all hosts
hosts: all
gather_facts: true
any_errors_fatal: true
become: true
- name: Test
hosts: all
gather_facts: false
any_errors_fatal: true
become: true
roles:
- role: test
Role Sample
---
- block:
- include_tasks: test.yml
any_errors_fatal: true
run_once: true
Task Sample
---
- name: Test
block:
- name: Transfer files from node1 to node2
copy:
src: /tmp/a
dest: /tmp/
delegate_to: node2
delegate_to: node1