ansible - Ansible 创建两个文件
问题描述
我正在使用 Ansbile 2.9 和 python 3.6.9 。我创建了一个脚本来从 cisco nxos 捕获“show-tech”。
因此,在我的脚本中,我将 showtech 文件保存在 bootflash 上,而不是使用 net_get 模块将其复制到 ansible 控制器到特定文件夹中
一切似乎都工作正常,但我看到的问题是创建一个额外的输出文件,随机名称如“0d4cfa0ae57-439d-48ef-aac0-944a882ddcb”
该文件具有我从设备复制并存储在特定位置的相同数据。
所以我的问题是为什么 Ansible 会创建这个附加文件以及如何让它停止?
- name: "creating local folder cisco-nxos-showtech"
file:
path: cisco-nxos-showtech
state: directory
mode: '777'
- name: Copying file from nxos device to local cisco-nxos-showtech folder
net_get:
src: "showtech-{{ ansible_net_hostname }}
dest: "cisco-nxos-showtech"
解决方案
Ansible 在操作期间使用临时文件。检查您的 ansible.cfg 文件并根据需要指定 local_tmp 文件夹。在这里阅读更多:
https://github.com/ansible/ansible/blob/devel/examples/ansible.cfg
推荐阅读
- angular - 如何在 Angular 11 中观察日期?
- android - 任务“:app:checkDebugAarMetadata”执行失败(Android Studio)
- firebase - Firebase 模拟器套件管理员 SDK 和 FCM
- asp.net - SSRS ReportViewer Design 在第一页和最后一页中断,分页闪烁问题
- ruby-on-rails - 捆绑更新 Rails 解析为 6.0.1 候选版本
- python-3.x - ModuleNotFoundError:Jupyter 笔记本中没有名为“datefinder”的模块——但可以在终端中导入
- c# - C# DirectorySearcher.FindOne(); 获取 thores ArgumentOutOfRangeException
- reactjs - 如何使reducer设置状态?
- apt - dpkg-scanpackages -a amd64 。> 包 - 用 --arch arm64 写了 0 个条目
- c# - 如何使用 EntityFrameworkCore 按时创建事件