Deprecation of tags= in include

碰到這個訊息:

[DEPRECATION WARNING]: You should not specify tags in the include parameters. All tags should be specified using the task-level option. This feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

這是因為這樣寫:

- include: setup.yml tags=myrole,setup
- include: myrole.yml tags=myrole

論壇有人問,開發團隊回答說,建議的作法是把 tags 拿下來,不要放在 include: xxx 的後面,也就是:

- include: setup.yml
  tags=myrole,setup
- include: myrole.yml
  tags=myrole