Files
kubespray/scripts/render_readme_version.yml
Max Gautier a142f40e25 Update versions in README.md with pre-commit
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.
2025-01-21 12:10:21 +01:00

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