Problem:
Issue when we start the theforeman.foreman_scap_client Ansible Role on a new RHEL 8. This role run without issue on our RHEL 7 servers.
TASK [theforeman.foreman_scap_client : Set facts for rh certs] *****************
fatal: [XXXXXXXX]: FAILED! =>
msg: |-
the field 'args' has an invalid value ({u'rh_consumer_private_key_path': u"{{ (rh_certs.stdout | from_json).get('rh_consumer_private_key_path') }}", u'rh_consumer_cert_path': u"{{ (rh_certs.stdout | from_json).get('rh_consumer_cert_path') }}", u'rh_ca_cert_path': u"{{ (rh_certs.stdout | from_json).get('rh_ca_cert_path') }}"}), and could not be converted to an dict.The error was: No JSON object could be decoded
The error appears to be in '/usr/share/ansible/roles/theforeman.foreman_scap_client/tasks/main.yml': line 25, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: 'Set facts for rh certs'
^ here
Expected outcome:
Foreman and Proxy versions:
foreman-proxy-1.22.0.3-1.el7sat.noarch
Foreman and Proxy plugin versions:
Distribution and version:
Other relevant data:
After some troubleshooting regarding this role, I saw a another error and perhaps they’ve connected. When I run this script foreman_scap_client_facts.rb the following error appears (see below):
# ./foreman_scap_client_facts.rb
Fatal Python error: Py_Initialize: Unable to get the locale encoding
Traceback (most recent call last):
File "/usr/lib64/python3.6/encodings/__init__.py", line 33, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 674, in exec_module
File "<frozen importlib._bootstrap_external>", line 780, in get_code
File "<frozen importlib._bootstrap_external>", line 832, in get_data
PermissionError: [Errno 1] Operation not permitted: '/usr/lib64/python3.6/encodings/aliases.py'{}
#
Why is a Puppet error in a Ruby script? As someone an Idea what is the problem?
Best regards, H