Bonjour,
Problème avec la récupération des facts pour les certificats sur un client RHEL 8.
J'utilise un playbook par défaut qui ressemble à cela:
Ansible code
Message d'erreur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 - name: 'Set facts for rh certs' set_fact: rh_ca_cert_path: "{{ (rh_certs.stdout | from_json).get('rh_ca_cert_path') }}" rh_consumer_cert_path: "{{ (rh_certs.stdout | from_json).get('rh_consumer_cert_path') }}" rh_consumer_private_key_path: "{{ (rh_certs.stdout | from_json).get('rh_consumer_private_key_path') }}"
Le problème est apparemment qu'il n'arrive pas a transformer l'objet JSON en dictionnaire. J'ai essayé de faire la même chose avec un simple fichier json et l'erreur est la même.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 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
Quelqu'un a-t-il une idée comment dépanner un tel problème? Ou peut-être me mettre sur une piste?
Merci d'avance
Partager