From ab768f593da43fb1473eb6ca646338133b171db8 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sat, 14 Jun 2025 17:08:33 +0200 Subject: [PATCH] fix: Avoid setting ansible_managed variable Cause: The test used a temporary variable `ansible_managed`, but that is a "magic" string constant. Ansible 2.19 does not permit assigning to it any more. Consequence: Tests failed with Ansible 2.19. Fix: Rename the variable. --- tests/tasks/check_not_present_header.yml | 4 ++-- tests/tasks/check_present_header.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/tasks/check_not_present_header.yml b/tests/tasks/check_not_present_header.yml index 3362e18..fe1379e 100644 --- a/tests/tasks/check_not_present_header.yml +++ b/tests/tasks/check_not_present_header.yml @@ -9,8 +9,8 @@ - name: Check for presence of ansible managed header, fingerprint assert: that: - - ansible_managed not in content + - __ansible_managed not in content - __fingerprint not in content vars: content: "{{ (__file_content | d(__content)).content | b64decode }}" - ansible_managed: "{{ lookup('template', 'get_ansible_managed.j2') }}" + __ansible_managed: "{{ lookup('template', 'get_ansible_managed.j2') }}" diff --git a/tests/tasks/check_present_header.yml b/tests/tasks/check_present_header.yml index 607320f..efcac83 100644 --- a/tests/tasks/check_present_header.yml +++ b/tests/tasks/check_present_header.yml @@ -9,8 +9,8 @@ - name: Check for presence of ansible managed header, fingerprint assert: that: - - ansible_managed in content + - __ansible_managed in content - __fingerprint in content vars: content: "{{ (__file_content | d(__content)).content | b64decode }}" - ansible_managed: "{{ lookup('template', 'get_ansible_managed.j2') }}" + __ansible_managed: "{{ lookup('template', 'get_ansible_managed.j2') }}"