Incompatibility between SUSE Manager and Ansible versions equal to or lower than 2.9 due to python2-salt2

This document (000019845) is provided subject to the disclaimer at the end of this document.


SUSE Manager Server 4.1


python2-salt2 is installed under /usr/lib/python2.7/site-packages/salt.
These files set the value of yaml.safeloader=CSafeLoader, which takes effect globally and sets the YAML parser, on any app that imports this python.

Apparently, the C YAML parser is not 100% compatible with the default Python YAML parser, and enforcing this globally will break other code that imports this python salt plugin.

Ansible has a salt plugin which sources these python2-salt files and this therefore breaks ansible, eg:
"The salt python lib does yaml.SafeLoader = yaml.CSafeLoader which means it infects all uses of yaml.SafeLoader"
Ansible has worked around this salt bug in recent releases, however current Ansible 2.9 on RHEL does not contain this fix. This results in errors in all ansible code which uses the nice_yaml output plugin.

This will lead to no longer being able to register any server as a salt client.


The recommended fix is to update Ansible to a version higher to 2.9, whenever available, that bypasses this problem.
However, as a workaround, a patch was provided for being able to keep on using version 2.9 and lower. The patch can be found in the next code sample in a box below. It should be saved to a file, the name:


is suggested, but any other name should be fine. Here is the code sample:
From 7c6690e3b81a39f94dc9b565908a12b05c193365 Mon Sep 17 00:00:00 2001
From: Jochen Breuer <>
Date: Wed, 9 Dec 2020 14:30:01 +0100
Subject: [PATCH] Yaml C lib is no longer gets used

 salt/utils/ | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/salt/utils/ b/salt/utils/
index 0516647d1f..8828abbf3c 100644
--- a/salt/utils/
+++ b/salt/utils/
@@ -10,13 +10,6 @@ import warnings
 import yaml  # pylint: disable=blacklisted-import
 from yaml.nodes import MappingNode, SequenceNode
 from yaml.constructor import ConstructorError
-    yaml.Loader = yaml.CLoader
-    yaml.Dumper = yaml.CDumper
-    yaml.SafeLoader = yaml.CSafeLoader
-    yaml.SafeDumper = yaml.CSafeDumper
-except Exception:  # pylint: disable=broad-except
-    pass

 import salt.utils.stringutils

In order to apply the patch, the following commands need to be run on the SUSE Manager:

cd /usr/lib/python<python-version>/site-packages/salt
patch < /path/to/0001-Yaml-C-lib-is-no-longer-gets-used.patch

The "patch" command will prompt user which file to patch, the file is:


Afterwards, a restart in salt-master will be needed:

systemctl restart salt-master.service



C yaml parser is not 100% compatible with the default Python YAML parser in Ansible 2.9 or lower.


Reported to Engineering

Additional Information

Customers should keep in mind that this patch is simply a workaround and is not maintained. New patches in SUSE Manager might override this patch, which would need then to be reapplied. The final solution is to upgrade Ansible to a version not showing such incompatibilities with the YAML parser.


This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000019845
  • Creation Date: 25-Jan-2021
  • Modified Date:26-Jan-2021
    • SUSE Manager Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center