<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>56562</bug_id>
          
          <creation_ts>2025-10-22 18:03:22 +0300</creation_ts>
          <short_desc>ansible-core: ошибка при вызове модуля to_nice_yaml</short_desc>
          <delta_ts>2025-10-23 09:39:21 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>ansible-core</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Новиков Арсений">novikovas</reporter>
          <assigned_to name="Andrey Cherepanov">cas</assigned_to>
          <cc>amakeenk</cc>
    
    <cc>cas</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>275288</commentid>
    <comment_count>0</comment_count>
    <who name="Новиков Арсений">novikovas</who>
    <bug_when>2025-10-22 18:03:22 +0300</bug_when>
    <thetext>Стенды обновленные до Sisyphus:
ALT Workstation-11.1-x86-64
ALT KWorkstation-11.1.1-x86-64
ALT Education-11.0-kde-x86-64
ALT Education-11.0-xfce-x86-64D
ALT Server-11.0-minimal-x86-64

Версия пакета:
ansible-core-2.19.3-alt1

Шаги воспроизведения:
1. $ cat &gt; playbook.yml &lt;&lt;&apos;EOF&apos;
- name: Test to_nice_yaml serialization
  hosts: localhost
  connection: local
  gather_facts: no

  tasks:
    - name: Make dummy result
      ansible.builtin.set_fact:
        join_result:
          rc: 0
          stdout: &quot;joined ok&quot;
          stderr: &quot;&quot;
          other: test
          omit_field: &quot;{{ omit }}&quot;

    - name: Output raw join_result
      ansible.builtin.debug:
        var: join_result

    - name: Output join_result with to_nice_yaml
      ansible.builtin.debug:
        msg: &quot;{{ (join_result | combine({&apos;stdout&apos;: omit, &apos;stderr&apos;: omit}) | to_nice_yaml).split(&apos;\n&apos;) }}&quot;
EOF

2. $ echo localhost &gt; hosts

3. $ ansible-playbook playbook.yml -i hosts

Фактический результат:
[ERROR]: Task failed: Finalization of task args for &apos;ansible.builtin.debug&apos; failed: Error while resolving value for &apos;msg&apos;: The filter plugin &apos;ansible.builtin.to_nice_yaml&apos; failed: (&apos;cannot represent an object&apos;, &lt;&lt;Omit&gt;&gt;)

Task failed.
Origin: /home/test/test_toniceyaml.yml:20:7

18         var: join_result
19
20     - name: Output join_result with to_nice_yaml
         ^ column 7

&lt;&lt;&lt; caused by &gt;&gt;&gt;

Finalization of task args for &apos;ansible.builtin.debug&apos; failed.
Origin: /home/test/test_toniceyaml.yml:21:7

19
20     - name: Output join_result with to_nice_yaml
21       ansible.builtin.debug:
         ^ column 7

&lt;&lt;&lt; caused by &gt;&gt;&gt;

Error while resolving value for &apos;msg&apos;: The filter plugin &apos;ansible.builtin.to_nice_yaml&apos; failed: (&apos;cannot represent an object&apos;, &lt;&lt;Omit&gt;&gt;)
Origin: /home/test/test_toniceyaml.yml:22:14

20     - name: Output join_result with to_nice_yaml
21       ansible.builtin.debug:
22         msg: &quot;{{ (join_result | combine({&apos;stdout&apos;: omit, &apos;stderr&apos;: omit}) | to_nice_yaml).split(&apos;\n&apos;) }}&quot;
                ^ column 14

fatal: [localhost]: FAILED! =&gt; {&quot;msg&quot;: &quot;Task failed: Finalization of task args for &apos;ansible.builtin.debug&apos; failed: Error while resolving value for &apos;msg&apos;: The filter plugin &apos;ansible.builtin.to_nice_yaml&apos; failed: (&apos;cannot represent an object&apos;, &lt;&lt;Omit&gt;&gt;)&quot;}

На версии ansible-core-2.18.7-alt1 из p11 не воспроизводится.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>275358</commentid>
    <comment_count>1</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2025-10-23 09:39:21 +0300</bug_when>
    <thetext>https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_12.html#breaking-changes

--- test_toniceyaml.yml.orig    2025-10-23 09:34:49.179140169 +0300
+++ test_toniceyaml.yml 2025-10-23 09:34:43.585147803 +0300
@@ -19,4 +19,4 @@

     - name: Output join_result with to_nice_yaml
       ansible.builtin.debug:
-        msg: &quot;{{ (join_result | combine({&apos;stdout&apos;: omit, &apos;stderr&apos;: omit}) | to_nice_yaml).split(&apos;\n&apos;) }}&quot; 
+        msg: &quot;{{ ({&apos;rc&apos;: join_result.rc, &apos;other&apos;: join_result.other} | to_nice_yaml).split(&apos;\n&apos;) }}&quot;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>