且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 stdout_lines 数组中查找字符串

更新时间:2023-02-19 12:36:16

错误信息很奇怪,我无法在 Ansible 2 中重现它.但是您的条件仍然不起作用,列表没有 find 方法.在 Ansible 中,您可以使用 in 搜索列表:

The error message is strange and I can not reproduce it in Ansible 2. But your condition still will not work, a list does not have a find method. In Ansible you can search a list with in:

roles:
  - all_servers
  - {role: production_server, when: '"P" in prod_fact'}