Allow missing ironic policy.json sample

Since ironic change I10a4987204eb335f1fed29d4b1d7f3e075aa1792, the
sample policy.json is not present in the ironic repository. Since policy
is now in code, it is not required. This change only copies the sample
file to /etc/ironic when it exists in the ironic repository.

Change-Id: Iecdbd90b4c94556f5d0803e4340dfd6b473792c7
This commit is contained in:
Mark Goddard 2018-02-03 19:49:05 +00:00
parent ae1635427d
commit 593db8a777
1 changed files with 8 additions and 0 deletions

View File

@ -153,6 +153,13 @@
- name: "Generate ironic Configuration"
include: ironic_config.yml
# TODO(mgoddard): Remove this check and the following copy when ironic's pike release is no longer
# supported.
- name: "Check for ironic policy.json"
stat:
path: "{{ ironic_git_folder }}/etc/ironic/policy.json"
register: test_ironic_policy_json
- name: "Copy policy.json to /etc/ironic"
copy:
src: "{{ ironic_git_folder }}/etc/ironic/policy.json"
@ -161,6 +168,7 @@
owner: "ironic"
group: "ironic"
mode: 0644
when: test_ironic_policy_json.stat.exists
- name: "Create ironic DB Schema"
command: ironic-dbsync --config-file /etc/ironic/ironic.conf create_schema