So just did a lot of experimenting and found

Works:

when: inventory_hostname in groups['group']

Fails:
when: inventory_hostname in {{ groups['group'] }}

So it is the extra set of {{ }} that causes the problem. Although I don't know why it works for static but not for dynamic.

 

参考:https://github.com/ansible/ansible/issues/11371

相关文章:

  • 2022-02-21
  • 2021-11-02
  • 2022-12-23
  • 2021-12-20
  • 2021-08-31
  • 2022-12-23
  • 2021-08-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
  • 2021-12-16
  • 2021-09-11
  • 2021-11-27
  • 2021-11-10
相关资源
相似解决方案