我需要合并两个文件,其中没有重复的条目。有什么方法可以通过 ansible 模块实现它吗?例如,我有两个文件 /etc/hosts1 和 /etc/hosts2。我需要一个 /etc/hosts 文件,其中包含 /etc/hosts1 和 /etc/hosts2 中存在的所有条目,并且没有重复的条目。我怎样才能做到这一点。举个例子将不胜感激
- name: Merge two files
assemble:
src: /etc/hosts1
dest: /etc/hosts2
Run Code Online (Sandbox Code Playgroud)
上述汇编模块失败