diff --git a/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml b/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml index 489a45a3f..e2ceff4e8 100644 --- a/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml +++ b/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml @@ -112,10 +112,3 @@ that: ansible_os_family not in ["Flatcar", "Flatcar Container Linux by Kinvolk"] msg: "download_run_once not supported for Flatcar Container Linux" when: download_run_once or download_force_cache - -- name: Verify that the packages list is sorted - vars: - pkgs_lists: "{{ pkgs.keys() | list }}" - assert: - that: "pkgs_lists | sort == pkgs_lists" - fail_msg: "pkgs is not sorted: {{ pkgs_lists | ansible.utils.fact_diff(pkgs_lists | sort) }}" diff --git a/scripts/assert-sorted-checksums.yml b/scripts/assert-sorted-checksums.yml index 36ee1efb2..a24851e64 100755 --- a/scripts/assert-sorted-checksums.yml +++ b/scripts/assert-sorted-checksums.yml @@ -1,6 +1,6 @@ #!/usr/bin/env ansible-playbook --- -- name: Check all checksums are sorted by version +- name: Verify correct structure of Kubespray variables hosts: localhost connection: local gather_facts: false @@ -36,3 +36,16 @@ - (item.1.value | dict2items)[0].value is string or (item.1.value | dict2items)[0].value is number # only do list, the others are checksums with a different structure + - name: Include the packages list variable + include_vars: ../roles/kubernetes/preinstall/vars/main.yml + + - name: Verify that the packages list is sorted + vars: + pkgs_lists: "{{ pkgs.keys() | list }}" + ansible_distribution: irrelevant + ansible_distribution_major_version: irrelevant + ansible_distribution_minor_version: irrelevant + ansible_os_family: irrelevant + assert: + that: "pkgs_lists | sort == pkgs_lists" + fail_msg: "pkgs is not sorted: {{ pkgs_lists | ansible.utils.fact_diff(pkgs_lists | sort) }}"