Hey everyone - I’m trying to use Ansible to build a pipeline for deploying our policy files and I’m having some issues when trying to use API endpoint for updating/loading policies.
I continue to get 422 errors and I can’t seem to figure out how to format the body of my request. Has anyone done encountered this before? Anyone have any examples?
Hi Mitch,
422 is usually a mis-formatted YML. I think you just have to make sure that there is no data formatting applied to the body of the request for it to be fine. You can take a look at our Python API code here if you need some inspiration from code and here are some super-simple example policies.
I defaulted to powershell to figure out more since I’m not as familiar with Ansible and it seems as though powershell’s file input cmdlet (Get-Content) loads a file line by line as a collection and not a single item. After adding the -raw switch everything went perfect!
I’m hoping that Ansible will be a similar issue. Thanks!