| 1 |
--- |
| 2 |
upgrade: |
| 3 |
- | |
| 4 |
Beginning with Cinder version 12.0.0, as part of the Queens release |
| 5 |
"policies in code" community effort, Cinder has had the ability to run |
| 6 |
without a policy file because sensible default values are specified in |
| 7 |
the code. Customizing the policies in effect at your site, however, |
| 8 |
still requires a policy file. The default location of this file has been |
| 9 |
``/etc/cinder/policy.json`` (although the documentation has indicated |
| 10 |
otherwise). With this release, the default location of this file is |
| 11 |
changed to ``/etc/cinder/policy.yaml``. |
| 12 |
|
| 13 |
Some points to keep in mind: |
| 14 |
|
| 15 |
- The policy file to be used may be specified in the |
| 16 |
``/etc/cinder/cinder.conf`` file in the ``[oslo_policy]`` |
| 17 |
section as the value of the ``policy_file`` configuration option. |
| 18 |
That way there's no question what file is being used. |
| 19 |
|
| 20 |
- To find out what policies are available and what their default |
| 21 |
values are, you can generate a sample policy file. To do this, |
| 22 |
you must have a local copy of the Cinder source code repository. |
| 23 |
From the top level directory, run the command:: |
| 24 |
|
| 25 |
tox -e genpolicy |
| 26 |
|
| 27 |
This will generate a file named ``policy.yaml`` in the ``etc/cinder`` |
| 28 |
directory of your checked-out Cinder repository. |
| 29 |
|
| 30 |
- The sample file is YAML (because unlike JSON, YAML allows comments). |
| 31 |
If you prefer, you may use a JSON policy file. |
| 32 |
|
| 33 |
- Beginning with Cinder 12.0.0, you only need to specify policies in |
| 34 |
your policy file that you want to **differ** from the default values. |
| 35 |
Unspecified policies will use the default values *defined in the code*. |
| 36 |
Given that a default value *must* be specified *in the code* when a |
| 37 |
new policy is introduced, the ``default`` policy, which was formerly |
| 38 |
used as a catch-all for policy targets that were not defined elsewhere |
| 39 |
in the policy file, has no effect. We mention this because an old |
| 40 |
upgrade strategy was to use the policy file from the previous release |
| 41 |
with ``"default": "role:admin"`` (or ``"default": "!"``) so that newly |
| 42 |
introduced actions would be blocked from end users until the operator |
| 43 |
had time to assess the implications of exposing these actions. This |
| 44 |
strategy no longer works. Hopefully this isn't a problem because |
| 45 |
we're defining sensible defaults in the code. It would be a good |
| 46 |
idea, however, to generate the sample policy file with each release |
| 47 |
(see instructions above) to verify this for yourself. |
| 48 |
|