Cannot write to ansible_managed - it is a special variable Signed-off-by: Rich Megginson <rmeggins@redhat.com>
17 lines
460 B
YAML
17 lines
460 B
YAML
# SPDX-License-Identifier: MIT
|
|
---
|
|
- name: Get file
|
|
slurp:
|
|
path: "{{ __file }}"
|
|
register: __content
|
|
when: not __file_content is defined
|
|
|
|
- name: Check for presence of ansible managed header, fingerprint
|
|
assert:
|
|
that:
|
|
- __ansible_managed in content
|
|
- __fingerprint in content
|
|
vars:
|
|
content: "{{ (__file_content | d(__content)).content | b64decode }}"
|
|
__ansible_managed: "{{ lookup('template', 'get_ansible_managed.j2') }}"
|