且构网

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

在stdout_lines数组中查找字符串

更新时间:2023-02-19 12:44:37

错误消息很奇怪,我无法在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'}