[stable-9] Make ready for data tagging (#9991)

Make ready for data tagging (#9833)

* Fix dependent lookup.

* Fix ansible_type plugin utils and adjust documentation of reveal_ansible_type filter and ansible_type test.

* Fix diy callback plugin.

* Adjust to Data Tagging.

* Vendor and use internal code from ansible-core to fix YAML callback.

Ref: https://github.com/ansible/ansible/issues/84781
(cherry picked from commit 04cfce78ea)
This commit is contained in:
Felix Fontein 2025-04-14 21:23:04 +02:00 committed by GitHub
commit f12f69d2a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 372 additions and 165 deletions

View file

@ -3,15 +3,19 @@
# SPDX-License-Identifier: GPL-3.0-or-later
- set_fact:
attr2_d:
attr2_depr_dict:
msg: Attribute attr2 is deprecated
version: 9.9.9
collection_name: community.general
attr2_d_29:
# With Data Tagging, the deprecation dict looks a bit different:
attr2_depr_dict_dt:
msg: Attribute attr2 is deprecated
version: 9.9.9
- set_fact:
attr2_depr_dict: "{{ ((ansible_version.major, ansible_version.minor) < (2, 10))|ternary(attr2_d_29, attr2_d) }}"
plugin:
requested_name: msimpleda
resolved_name: msimpleda
type: module
collection_name: null # should be "community.general"; this will hopefully change back because this seriously sucks
- name: test msimpleda 1
msimpleda:
@ -23,17 +27,21 @@
that:
- simple1.a == 1
- simple1.attr1 == "abc"
- ("deprecations" not in simple1) or attr2_depr_dict not in simple1.deprecations
- ("deprecations" not in simple1) or (attr2_depr_dict not in simple1.deprecations and attr2_depr_dict_dt not in simple1.deprecations)
- name: test msimpleda 2
msimpleda:
a: 2
register: simple2
- name: Show results
debug:
var: simple2
- name: assert simple2
assert:
that:
- simple2.a == 2
- simple2.attr2 == "def"
- '"deprecations" in simple2'
- attr2_depr_dict in simple2.deprecations
- attr2_depr_dict in simple2.deprecations or attr2_depr_dict_dt in simple2.deprecations