Configure enforcement points
After you have set up your Ansible Automation Platform instance to communicate with the OPA server, you can set up enforcement points where you want the policy to be applied.
Procedure Copy linkLink copied!
- Organization
- Jobs launched from a template owned by an organization will fail if the policy is violated. This configuration provides broad control over automation within organizational boundaries.
- Inventory
- Jobs that use an inventory associated with a policy fail if the policy is violated. This configuration allows you to control access to specific infrastructure resources.
- Job template
-
Jobs launched from a template associated with a policy fail if the job violates the associated policy. This configuration provides granular control over specific automation tasks.
Note If you do not associate a policy with a resource, policy evaluation will not occur when you run the related job.
Associate a policy with an organization Copy linkLink copied!
Learn how to associate a policy with an organization.
Procedure Copy linkLink copied!
- From the navigation panel, select .
- On the Organizations page:
- To edit an existing organization, find the organization you want to edit and click the pencil icon
to go to the editing screen. - To create a new organization, click .
- To edit an existing organization, find the organization you want to edit and click the pencil icon
- In the field labeled Policy enforcement, enter the query path associated with the policy you want to implement. You must format the query path as
package/rule. - Click and then to save your settings.
Associate a policy with an inventory Copy linkLink copied!
Learn how to associate a policy with an inventory.
Procedure Copy linkLink copied!
- From the navigation panel, select .
- On the Inventories page:
- To edit an existing inventory, find the inventory you want to edit and click the pencil icon
to go to the editing screen. - To create a new inventory, click .
- To edit an existing inventory, find the inventory you want to edit and click the pencil icon
- In the field titled Policy enforcement., enter the query path associated with the policy you want to implement. You must format the query path as
package/rule. - Click if you are editing an existing inventory, or click if you are creating a new inventory.
Associate a policy with a job template Copy linkLink copied!
Learn how to associate a policy with a job template.
Procedure Copy linkLink copied!
- From the navigation panel, select .
- On the Automation Templates page:
- To edit an existing job template, find the job template you want to edit and click the pencil icon
to go to the editing screen. - To create a new job template, click .
- To edit an existing job template, find the job template you want to edit and click the pencil icon
- In the field titled Policy enforcement, enter the query path associated with the policy you want to implement. You must format the query path as
package/rule. - Click if you are editing an existing job template, or click if you are creating a new job template.