如何使用 Ansible 附加文件 [英] How to append the file using Ansible
问题描述
我正在尝试将一个文件附加到现有文件中.当我点击特定的 url 时,我每次都会获得更新的数据.我的要求是将更新的内容附加到同一个文件,而不是每次都创建一个新文件.我正在使用 get_url 模块来获取文件.但文件没有被更新.如果我将目的地指定为新文件,则数据将被复制到新文件中.
I'm trying to append a file to the existing file. When I hit a specific url I get the updated data everytime. my requirement is to append the updated to the same file instead of creating a new file everytime. I'm using get_url module to get the file. but the file is not being updated. If I give the destination as new file then data is being copied to new file.
推荐答案
get_url 似乎不支持该操作.您可能需要检索文件并使用组装模块来连接(或合并)文件.
get_url doesn't appear to support that operation. You may need to retrieve the file and use the Assemble module to concatenate (or combine) the files.
这篇关于如何使用 Ansible 附加文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!