deprecations.yml 792 B

123456789101112131415161718192021
  1. ---
  2. - name: Check for usage of deprecated variables
  3. set_fact:
  4. __deprecation_message: "{{ __deprecation_message | default([]) }} + ['{{ __deprecation_header }} {{ item }} is a deprecated variable and will be no longer be used in the next minor release. Please update your inventory accordingly.']"
  5. when:
  6. - hostvars[inventory_hostname][item] is defined
  7. with_items: "{{ __warn_deprecated_vars }}"
  8. - block:
  9. - debug: msg="{{__deprecation_message}}"
  10. - pause:
  11. seconds: "{{ 10 }}"
  12. when:
  13. - __deprecation_message | default ('') | length > 0
  14. # for with_fileglob Ansible resolves the path relative to the roles/<rolename>/files directory
  15. - name: Assign deprecated variables to correct counterparts
  16. include: "{{ item }}"
  17. with_fileglob:
  18. - "../tasks/__deprecations_*.yml"