{"id":1684,"date":"2023-05-15T22:29:18","date_gmt":"2023-05-15T21:29:18","guid":{"rendered":"http:\/\/192.168.1.213:8088\/?p=1684"},"modified":"2024-08-18T17:18:11","modified_gmt":"2024-08-18T15:18:11","slug":"cisco-dna-center-ansible-issue-dna-center-python-sdk-not-installed","status":"publish","type":"post","link":"http:\/\/192.168.1.213:8088\/cisco-dna-center-ansible-issue-dna-center-python-sdk-not-installed\/","title":{"rendered":"Cisco DNA Center Ansible – Issue: DNA Center Python SDK not installed"},"content":{"rendered":"\t\t
I’m currently preparing for the Cisco Live lab, an event set to take place in Las Vegas in the upcoming weeks. As with any complex task, it’s been a journey of discovery, which, on this occasion, included a rather significant pitfall on my part.<\/p>
My error lay in the construction of the Dockerfiles, in conjunction with a less than robust config file. As if to add a cherry on top of this problematic sundae, recent updates to certain Python modules further complicated the situation. This confluence of factors resulted in a baffling issue: my Ansible playbooks steadfastly refused to execute.<\/p>
Despite every indication to the contrary, I was repeatedly confronted with an error message stating that the DNA Center SDK was not installed. I can assure you, this was certainly not the case. It felt like being accused of a crime I didn’t commit.<\/p>
In this article, I’ll take you through my missteps, the process of resolving this issue, and, most importantly, the lessons I’ve learned along the way. After all, acknowledging our mistakes and learning from them is a cornerstone of professional growth.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
At the core of this issue was my Dockerfile. This very same and simple Dockerfile had been a reliable ally during the Cisco Live session held in Amsterdam this past February, performing throughout the event.\u00a0<\/p>
As part of our standard practice, my team undertook the task of verifying the lab. The task at hand was straightforward: executing a simple Ansible playbook aimed at adding a site into the DNA Center. A routine procedure, we thought, but alas, it was not to be.<\/p>
To our surprise, we were consistently met with an error message:<\/p>
MSG:<\/strong><\/p> ‘DNA Center Python SDK is not installed. Execute ‘pip install dnacentersdk”<\/strong><\/p> It was as if we were being told to fill up a car that already had a full tank of gas. We knew the DNA Center Python SDK was installed, yet the error message insisted otherwise. This set the stage for a deep dive into the problem, a journey of troubleshooting and discovery that would ultimately lead to valuable insights.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t Despite the persistent error message, a simple However, it was not until we opened Python and attempted to import the As highlighted in line 32 something was wrong with the requests module. The cause is that the latest version of\u00a0Dockerfile<\/h6>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
Ansible Playbook<\/h6>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
The surprising issue <\/h5>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
pip list<\/code> command confirmed our initial belief – the Python module for the DNA Center SDK was indeed installed. Further investigation, using a highly verbose Ansible playbook execution (
-vvvv<\/code>), confirmed that the correct paths and Python versions were being utilized.<\/p>
ciscodnasdk<\/code> module that the real issue began to emerge. It appeared that Ansible had been somewhat of a misleading informant, not quite revealing the full extent of the problem.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
requests<\/code>\u00a0does not support urllib3 2.0.0which has been used by the dnacentersdk.\u00a0<\/p>