Add initial policy library

Change-Id: I2dbe3b06421f97785b63e10684c60396697d43f1
This commit is contained in:
Tim Hinrichs 2017-03-22 12:27:17 -07:00
parent 7c879e5354
commit 1c1f39d243

View File

@ -0,0 +1,16 @@
id: PauseBadFlavors
description: Pause any server using a flavor that is not permitted
rules:
- comment: "User should customize this. Permitted flavors."
rule: permitted_flavor('m1.tiny')
- comment: "User should customize this. Permitted flavors."
rule: permitted_flavor('m1.large')
- rule: >
server_with_bad_flavor(id) :- nova:servers(id=id,flavor_id=flavor_id), nova:flavors(id=flavor_id, name=flavor),
not permitted_flavor(flavor)
- comment: "Remediation: Pause any VM that shows up in the server_with_bad_flavor table"
rule: "execute[nova:servers.pause(id)] :- server_with_bad_flavor(id), nova:servers(id,status='ACTIVE')"