ansible - 两个ansible sesu成为任务生成错误
问题描述
我创建了一个剧本,我需要使用 sesu become 方法执行任务,但是得到一个错误,ansible 声称当他到达我使用 sesu 的第二个任务时 sesu escalate previleges 不存在。
任务:添加自定义属性结束并完成,没有任何错误。
任务添加共享库生成错误,错误是'sesu'升级权限没有重新调整:
- name: Add custom properties
become_user: was_user
become: true
become_method: sesu
become_flags: '-'
shell: "addCustomProperties.py {{item.path}}"
with_items: "{{ customProperties_find.files |sort(attribute='path') }}"
loop_control:
label: '{{ item.path }}'
- name: Find addSharedLibrary config files
find:
paths: "addSharedLibrary"
patterns: "*.properties"
register: addSharedLibrary_find
- name: Add shared libraries
become_user: was_user
become: true
become_method: sesu
become_flags: '-'
shell: "addSharedLibrary.py {{item.path}}"
#with_items: "{{ addSharedLibrary_find.files }}"
with_items: "{{ addSharedLibrary_find.files |sort(attribute='path') }}"
loop_control:
label: '{{ item.path }}'
有什么想法吗?
解决方案
推荐阅读
- visual-studio-code - pylance,linting 在 vscode python venv 中不起作用
- python - 如果列内容 b != 0 则打印列内容 a
- spring-boot - Spring Boot 建议端点优化
- audio - 以最少的重新编码静音音量
- github - 如何使用(不同的)GitHub 存储库上的降价文件作为静态 Next JS 站点的源?
- swift - NSKeyedUnarchiver 创建由其他人引用的同一对象的多个实例
- python - 如何找到标签的兄弟元素
- r - 使用 stat_compare_means() 和分组列获取括号
- haskell - 这个函数的正确签名是什么?
- laravel - Laravel 中的队列通知延迟