From ef7197f925ab3dcf714acc2c825e0e968c6c938e Mon Sep 17 00:00:00 2001
From: Max Gautier <mg@max.gautier.name>
Date: Fri, 9 Feb 2024 10:34:28 +0000
Subject: [PATCH] Use run_once for checking ansible version instead of
 localhost (#10908)

The `assert` module does not connect to the host anyway, and this avoids
skipping the assert when running with --limit.
---
 playbooks/ansible_version.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/playbooks/ansible_version.yml b/playbooks/ansible_version.yml
index 1fea52356..d5a83bd08 100644
--- a/playbooks/ansible_version.yml
+++ b/playbooks/ansible_version.yml
@@ -1,12 +1,12 @@
 ---
 - name: Check Ansible version
-  hosts: localhost
+  hosts: all
   gather_facts: false
   become: no
+  run_once: true
   vars:
     minimal_ansible_version: 2.15.5  # 2.15 versions before 2.15.5 are known to be buggy for kubespray
     maximal_ansible_version: 2.17.0
-    ansible_connection: local
   tags: always
   tasks:
     - name: "Check {{ minimal_ansible_version }} <= Ansible version < {{ maximal_ansible_version }}"
-- 
GitLab