Newer
Older
become: false
hosts: localhost
gather_facts: false
vars:
ps_policy_name: 'NginxDefaultPolicy'
ps_policy_id: 'd0f0375e-8ec9-41b6-8bc0-3853b5844c3b'
ps_nginx_provider_id: '59da581b-6a7e-42e6-84e1-76e445bb8d58'
ps_xc_provider_id: '63e098db-8b04-4ace-b598-3eddb602501f'
ps_workspace: '4d6470f0-4e85-47f0-b947-40975613f0ea'
ps_api_key: 'c9a74286-2aa0-401e-bfc7-498aad260a24'
xc_namespace: 'aatt-solutions'
xc_load_balancer: 'dstokes-test'
tasks:
ansible.builtin.uri:
url: 'https://policysupervisor.io/api/v1/commands/ingest'
method: POST
body_format: json
headers:
'X-Workspace-Key': "{{ ps_workspace }}"
'X-API-Key': "{{ ps_api_key }}"
body:
providerId: "{{ ps_nginx_provider_id }}"
elementIds:
- policyId: "{{ ps_policy_name }}"
notes: "Ingest {{ ps_policy_name }} from {{ ps_nginx_provider_id }}"
- name: Wait for command to complete
register: _result
until: _result["json"]["status"] == "JOB_SUCCESS"
retries: 10
ansible.builtin.uri:
url: 'https://policysupervisor.io/api/v1/commands/{{ ingest_response["json"]["groupId"] }}'
method: GET
headers:
'X-Workspace-Key': "{{ ps_workspace }}"
'X-API-Key': "{{ ps_api_key }}"