mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-13 21:34:40 +03:00
Move check 'sorted pkgs list to pre-commit'
This is a lint check, which should not live in the playbook itself.
This commit is contained in:
@@ -112,10 +112,3 @@
|
|||||||
that: ansible_os_family not in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
|
that: ansible_os_family not in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
|
||||||
msg: "download_run_once not supported for Flatcar Container Linux"
|
msg: "download_run_once not supported for Flatcar Container Linux"
|
||||||
when: download_run_once or download_force_cache
|
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
|
#!/usr/bin/env ansible-playbook
|
||||||
---
|
---
|
||||||
- name: Check all checksums are sorted by version
|
- name: Verify correct structure of Kubespray variables
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
connection: local
|
connection: local
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
@@ -36,3 +36,16 @@
|
|||||||
- (item.1.value | dict2items)[0].value is string or
|
- (item.1.value | dict2items)[0].value is string or
|
||||||
(item.1.value | dict2items)[0].value is number
|
(item.1.value | dict2items)[0].value is number
|
||||||
# only do list, the others are checksums with a different structure
|
# 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) }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user