it wasn t a high level question, but perhaps it could help someone .
we fund a way so :
with you api key from MAAS : oauth_consumer_key : oauth_token : oauth_signature
ansible task :
uri:
url: “http://xxx.xxx.xxx.xxx:5240/MAAS/api/2.0/machines/”
method: GET
headers:
Authorization: OAuth oauth_consumer_key=“xxxxxxx”,oauth_token=“xxxxx”,oauth_signature_method=“PLAINTEXT”,oauth_timestamp=“1952448470”,oauth_nonce=“pouic”,oauth_version=“1.0”,oauth_signature="%26xxxxxxxx"
Content-Type: “application/json”
Accept: “application/json”
use_proxy: no
oauth_timestamp >>> need to be diferent at each call , unix format
oauth_nonce >>> put what you want
oauth_signature >>> %26 is need cause of the method : plaintext