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.

相关文章:

  • 2021-09-04
  • 2021-10-16
  • 2021-08-31
  • 2021-10-06
  • 2022-12-23
  • 2021-04-04
  • 2022-12-23
  • 2023-01-15
猜你喜欢
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案