ansible - 使用 Ansible 创建目录会导致 /usr/lib/python3.7 中的文件所有权更改
问题描述
使用 Ubuntu 19.04 和 Python 3.7
当我使用 Ansible 创建目录时,文件所有权在 /usr/lib/python3.7 中更改
显然这不应该发生,它会破坏整个 Ubuntu 的 Python,直到权限得到纠正。
该问题仅在使用 recurse=yes 时发生。
这是一个显示问题的视频: https ://youtu.be/d3hj255pW9w
这是代码/Ansible 剧本:
ubuntu@ubuntu-GB-BXi3-5010:~/ansible$ cat ~/ansible/renderworker/ffmpegconverter/ansible/test.yml
---
- hosts: renderworkerhosts
become: yes
tasks:
# for some reason, recurse=yes results in owner & permissions changing in /usr/lib/python3.7
# which breaks Python on Ubuntu
- name: Create directory
file:
path=/opt/ffmpegconverter
state=directory
owner=root
group=ffmpeguser
mode=u=rwx,g=rwx,o=
recurse=yes
ubuntu@ubuntu-GB-BXi3-5010:~/ansible$
解决方案
您应该使用冒号而不是等号作为键和值之间的分隔符:
path: /etc/foo.conf
推荐阅读
- matlab - 在数据集中查找一个月的最低温度
- python - 如何查找图像中的簇数?
- objective-c - OS X WebKit 可以接收连接速度吗?
- sql-server - SQL 查询的执行时间似乎过长
- powershell - 将哈希表导出为 CSV
- laravel - Laravel 5.6 - 类名必须是有效的对象或字符串
- winappdriver - WinAppDriver | 执行 .bat 文件
- reactjs - 使用 Redux 无法在 componentDidMount 中接收异步响应
- python - 使用 asyncio 和 timeit 计时异步 http 请求
- swift - 更新模型以将请求主体与 Swift 匹配的简明方法?