Hello,
We have been using Ansible Tower to purge website objects in Akamai cache (Akamai is a CDN) for several years, using an Akamai API
Akamai no longer provide the API version 2, and have forced customers to use a new API version 3.
There seems to be some compatibility issues with the Ansible yaml or the network module and Akamai new API.
This is some information from Akamai.= and I have followed all the details.
https://developer.akamai.com/api/getting-started
From the Red Hat OS , I can run commands that will connect to Akamai API and purge objects from their cache.
But I cannot get it to work from within Ansible Tower
We use Ansible Tower with survey Survey options so that users can type in the website URL that needs to be purged from Akamai cached.
The yml came from the github,.
I have amended the yml so as to accept all the required Akamai tokens, but I get this error.
“detail”: “Authorization header missing”,
When running the Tower task in verbose logging, I can see it calling httplib2, as seen below.
“invocation”: {
“module_args”: {
“virtualenv”: null,
“virtualenv_site_packages”: false,
“virtualenv_command”: “virtualenv”,
“chdir”: null,
“requirements”: null,
“name”: [
“httplib2”
],
“virtualenv_python”: null,
“editable”: false,
“umask”: null,
“executable”: null,
“use_mirrors”: true,
“extra_args”: null,
“state”: “present”,
“version”: null
The program is yaml code, called main.yml.
This is another file that sets the variables, this is called akamai.yml.
But the main.yml loads an Ansible module called uri, you can see this on line 18 of main.yml.
This module called uri is a built in Ansible module, details here https://docs.ansible.com/ansible/latest/modules/uri_module.html#uri-module
So the process is a user with access to Ansible Tower launches a job (see screen shot), the job takes interactive variables, such as the URL to purge and which network, Production or Staging.
The akamai.yml captures the variables and then calls the main.yml. It is the main.yml that then users the variables and purges the object.
akamai.yml: