Score:0

Ansible SSL certificate failed- urlopen error

cn flag

I try to run ansible-playbook from OSX that run this task and I'm getting the error bellow I tried to run 'Install Certificates.command' from Python folder but it didn't solve my problem.

fatal: [XXX]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "elapsed": 0, "msg": "Status code was -1 and not [200]: Request failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:897)>", "redirected": false, "status": -1, "url": "https://XXX.XXX.com/rest/api/2/cluster/zdu/state"}
tasks:
   - name: get Cluster state
     uri:
      url: https://{{ base_url }}.xxx.com/rest/api/2/cluster/zdu/state
      headers:
       Content-Type: application/json
      force_basic_auth: true

please assist.

Score:1
cn flag

As show in the official documentation page of URI module, you have to use the validate_certs: no parameter in order to disable SSL check.

In addition, your task says force_basic_auth: true which means you want to give authentication credentials throught HTTP Header, thing you don't actually do ;)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.