diff options
author | Eric Wolinetz <ewolinet@redhat.com> | 2017-08-23 09:56:34 -0500 |
---|---|---|
committer | Eric Wolinetz <ewolinet@redhat.com> | 2017-09-20 16:43:27 -0500 |
commit | b2fdc1cb5e38e39250af702d1e19ed691e4df7d5 (patch) | |
tree | b5e8368514f9ae29f6fefef1d5e7ae7d8c1ee95c /roles/openshift_sanitize_inventory/tasks/deprecations.yml | |
parent | 457e0f80784820b9ff0fb6a7407c271731f5b1d9 (diff) | |
download | openshift-b2fdc1cb5e38e39250af702d1e19ed691e4df7d5.tar.gz openshift-b2fdc1cb5e38e39250af702d1e19ed691e4df7d5.tar.bz2 openshift-b2fdc1cb5e38e39250af702d1e19ed691e4df7d5.tar.xz openshift-b2fdc1cb5e38e39250af702d1e19ed691e4df7d5.zip |
Creating structure to warn for use of deprecated variables and set them in a single location before they are no longer honored
Diffstat (limited to 'roles/openshift_sanitize_inventory/tasks/deprecations.yml')
-rw-r--r-- | roles/openshift_sanitize_inventory/tasks/deprecations.yml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/roles/openshift_sanitize_inventory/tasks/deprecations.yml b/roles/openshift_sanitize_inventory/tasks/deprecations.yml new file mode 100644 index 000000000..94d3acffc --- /dev/null +++ b/roles/openshift_sanitize_inventory/tasks/deprecations.yml @@ -0,0 +1,21 @@ +--- + +- name: Check for usage of deprecated variables + set_fact: + __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.']" + when: + - hostvars[inventory_hostname][item] is defined + with_items: "{{ __warn_deprecated_vars }}" + +- block: + - debug: msg="{{__deprecation_message}}" + - pause: + seconds: "{{ 10 }}" + when: + - __deprecation_message | default ('') | length > 0 + +# for with_fileglob Ansible resolves the path relative to the roles/<rolename>/files directory +- name: Assign deprecated variables to correct counterparts + include: "{{ item }}" + with_fileglob: + - "../tasks/__deprecations_*.yml" |