Browse Source
Move check 'sorted pkgs list to pre-commit'
This is a lint check, which should not live in the playbook itself.
pull/12185/head
Max Gautier
5 months ago
Failed to extract signature
2 changed files with
14 additions and
8 deletions
-
roles/kubernetes/preinstall/tasks/0040-verify-settings.yml
-
scripts/assert-sorted-checksums.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) }}" |
|
|
@ -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) }}" |