From 0195725563b0d703788b05acd7fa472aea95d595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Grill?= Date: Fri, 3 Nov 2017 08:11:14 +0100 Subject: [PATCH] Workaround ansible bug where access var via dict doesn't get real value (#1912) * Change deprecated vagrant ansible flag 'sudo' to 'become' * Workaround ansible bug where access var via dict doesn't get real value When accessing a variable via it's name "{{ foo }}" its value is retrieved. But when the variable value is retrieved via the vars-dict "{{ vars['foo'] }}" this doesn't resolve the expression of the variable any more due to a bug. So e.g. a expression foo="{{ 1 == 1 }}" isn't longer resolved but just returned as string "1 == 1". * Make file yamllint complient --- .../preinstall/tasks/verify-settings.yml | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/roles/kubernetes/preinstall/tasks/verify-settings.yml b/roles/kubernetes/preinstall/tasks/verify-settings.yml index cbb5357b3..9dbd7ab8c 100644 --- a/roles/kubernetes/preinstall/tasks/verify-settings.yml +++ b/roles/kubernetes/preinstall/tasks/verify-settings.yml @@ -28,20 +28,21 @@ when: cloud_provider is defined and cloud_provider == 'azure' ignore_errors: "{{ ignore_assert_errors }}" +# simplify this items-list when https://github.com/ansible/ansible/issues/15753 is resolved - name: "Stop if known booleans are set as strings (Use JSON format on CLI: -e \"{'key': true }\")" assert: - that: vars[item]|type_debug == 'bool' - msg: "{{vars[item]}} isn't a bool" + that: item.value|type_debug == 'bool' + msg: "{{item.value}} isn't a bool" run_once: yes with_items: - - kubeadm_enabled - - download_run_once - - deploy_netchecker - - download_always_pull - - efk_enabled - - helm_enabled - - openstack_lbaas_enabled - - rbac_enabled + - { name: kubeadm_enabled, value: "{{ kubeadm_enabled }}" } + - { name: download_run_once, value: "{{ download_run_once }}" } + - { name: deploy_netchecker, value: "{{ deploy_netchecker }}" } + - { name: download_always_pull, value: "{{ download_always_pull }}" } + - { name: efk_enabled, value: "{{ efk_enabled }}" } + - { name: helm_enabled, value: "{{ helm_enabled }}" } + - { name: openstack_lbaas_enabled, value: "{{ openstack_lbaas_enabled }}" } + - { name: rbac_enabled, value: "{{ rbac_enabled }}" } ignore_errors: "{{ ignore_assert_errors }}" - name: Stop if even number of etcd hosts