Applying copy_update to all policy.json files
Adding support for dynamically updating the policy files for nova, glance, neutron, cinder and heat. Uses the copy_update plugin to detect any updates and applies the changes to the default policy.json Implements: blueprint dynamically-manage-policy.json Change-Id: I573229d6f18a5fe32460b2373ab8b2c36ac722b4
This commit is contained in:
parent
64948ada0b
commit
8a4521399c
@ -156,6 +156,13 @@ cinder_client_socket_timeout: 900
|
||||
# - ip: "127.0.0.1"
|
||||
# share: "/vol/cinder"
|
||||
|
||||
## Policy vars
|
||||
# Provide a list of access controls to update the default policy.json with. These changes will be merged
|
||||
# with the access controls in the default policy.json. E.g.
|
||||
#cinder_policy_overrides:
|
||||
# "volume:create": ""
|
||||
# "volume:delete": ""
|
||||
|
||||
# Common apt packages
|
||||
cinder_apt_packages:
|
||||
- dmeventd
|
||||
|
@ -34,7 +34,6 @@
|
||||
owner: "{{ cinder_system_user_name }}"
|
||||
group: "{{ cinder_system_group_name }}"
|
||||
with_items:
|
||||
- { src: "policy.json", dest: "/etc/cinder/policy.json" }
|
||||
- { src: "volume.filters", dest: "/etc/cinder/rootwrap.d/volume.filters" }
|
||||
- { src: "rootwrap.conf", dest: "/etc/cinder/rootwrap.conf" }
|
||||
notify:
|
||||
@ -42,6 +41,21 @@
|
||||
tags:
|
||||
- cinder-config
|
||||
|
||||
- name: Apply updates to Policy file
|
||||
copy_updates:
|
||||
content="{{ item.content }}"
|
||||
updates="{{ item.policy_data }}"
|
||||
dest="{{ item.dest }}"
|
||||
owner="{{ cinder_system_user_name }}"
|
||||
group="{{ cinder_system_group_name }}"
|
||||
mode="{{ item.mode|default('0644') }}"
|
||||
with_items:
|
||||
- { content: "{{ lookup('file', 'policy.json') | b64encode }}", policy_data: "{{ cinder_policy_overrides|default('') }}", dest: "/etc/cinder/policy.json" }
|
||||
notify:
|
||||
- Restart cinder services
|
||||
tags:
|
||||
- cinder-config
|
||||
|
||||
- name: Ensure cinder tgt include
|
||||
lineinfile:
|
||||
dest: /etc/tgt/targets.conf
|
||||
|
Loading…
Reference in New Issue
Block a user