name: the file
raw: cat "{{item}}"
with_items: "{{groups['firewall']}}"
when: inventory_hostname == item
register: output3
debug: var=output3.results
name: Copy File to Local Machine
local_action: lineinfile dest=/Users/{{inventory_hostname}} line="{{item}}"
with_dict: "{{ output3 }}"
如何将output3.stdout_lines作为订单项?我现在的方法是复制我不想要的所有东西。
答案 0 :(得分:0)
试试这个:
- name: Copy File to Local Machine
local_action: lineinfile dest=/Users/{{inventory_hostname}} line="{{item.1}}"
with_subelements:
- "{{output3.results}}"
- stdout_lines
- flags:
skip_missing: yes
我想这是一些没有Python支持的硬件盒? 否则,有更优雅的方式来获取文件。