mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-13 21:34:40 +03:00
Currently, versions in README.md need to be manually updated, and we check it's done with a bash script. Add a small utility playbook to add versions in README.md from their actual default values, automatically. This is done in pre-commit, and replace the scripted check ; instead it will autofix the README.md, and fails in CI if needed. We switch markdownlint behind the local hooks to gave it the opportunity to catch a problem with the rendering.
23 lines
711 B
YAML
Executable File
23 lines
711 B
YAML
Executable File
#!/usr/bin/env ansible-playbook
|
|
---
|
|
- name: Update README.md versions
|
|
hosts: localhost
|
|
connection: local
|
|
gather_facts: false
|
|
vars:
|
|
fallback_ip: 'bypass tasks in kubespray-defaults'
|
|
roles:
|
|
- kubespray-defaults
|
|
tasks:
|
|
- name: Include versions not in kubespray-defaults
|
|
include_vars: "{{ item }}"
|
|
loop:
|
|
- ../roles/container-engine/docker/defaults/main.yml
|
|
- ../roles/kubernetes/node/defaults/main.yml
|
|
- ../roles/kubernetes-apps/argocd/defaults/main.yml
|
|
- name: Render versions in README.md
|
|
blockinfile:
|
|
marker: '[//]: # {mark} ANSIBLE MANAGED BLOCK'
|
|
block: "\n{{ lookup('ansible.builtin.template', 'readme_versions.md.j2') }}\n\n"
|
|
path: ../README.md
|