From 2b402ace4d56d65fce75891811f47af97ab624db Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Sun, 5 Feb 2017 20:48:32 +0800 Subject: [PATCH] Fix the WARNING in copy keystone domain task Change-Id: I2bf2e8a6ba17c813bb2b9cdf05d3062f29d9fdf6 Closes-Bug: #1653168 --- ansible/roles/keystone/tasks/config.yml | 35 +++++++++++-------- .../roles/keystone/templates/keystone.conf.j2 | 2 +- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/ansible/roles/keystone/tasks/config.yml b/ansible/roles/keystone/tasks/config.yml index 3efc8844c1..0066941bf5 100644 --- a/ansible/roles/keystone/tasks/config.yml +++ b/ansible/roles/keystone/tasks/config.yml @@ -5,7 +5,7 @@ - name: Check if Keystone Domain specific settings enabled local_action: stat path="{{ node_custom_config }}/keystone/domains" - register: keystone_domain_cfg + register: keystone_domain_directory - name: Ensuring config directories exist file: @@ -17,17 +17,6 @@ - item.value.enabled with_dict: "{{ keystone_services }}" -- name: Creating Keystone Domain directory - vars: - keystone: "{{ keystone_services.keystone }}" - file: - dest: "{{ node_config_directory }}/keystone/domains/" - state: "directory" - when: - - inventory_hostname in groups[keystone.group] - - keystone.enabled | bool - - keystone_domain_cfg.stat.exists - - name: Copying over config.json files for services template: src: "{{ item.key }}.json.j2" @@ -65,18 +54,34 @@ - Restart keystone container - Restart keystone-fernet container +- name: Creating Keystone Domain directory + vars: + keystone: "{{ keystone_services.keystone }}" + file: + dest: "{{ node_config_directory }}/keystone/domains/" + state: "directory" + when: + - inventory_hostname in groups[keystone.group] + - keystone.enabled | bool + - keystone_domain_directory.stat.exists + +- name: Get file list in custom domains folder + local_action: find path="{{ node_custom_config }}/keystone/domains" recurse=no file_type=file + register: keystone_domains + when: keystone_domain_directory.stat.exists + - name: Copying Keystone Domain specific settings vars: keystone: "{{ keystone_services.keystone }}" copy: - src: "{{ item }}" + src: "{{ item.path }}" dest: "{{ node_config_directory }}/keystone/domains/" register: keystone_domains when: - inventory_hostname in groups[keystone.group] - keystone.enabled | bool - with_fileglob: - - "{{ node_custom_config }}/keystone/domains/*" + - keystone_domain_directory.stat.exists + with_items: "{{ keystone_domains.files|default([]) }}" notify: - Restart keystone container diff --git a/ansible/roles/keystone/templates/keystone.conf.j2 b/ansible/roles/keystone/templates/keystone.conf.j2 index ff33a241ff..55fb614e18 100644 --- a/ansible/roles/keystone/templates/keystone.conf.j2 +++ b/ansible/roles/keystone/templates/keystone.conf.j2 @@ -14,7 +14,7 @@ secure_proxy_ssl_header = HTTP_X_FORWARDED_PROTO connection = mysql+pymysql://{{ keystone_database_user }}:{{ keystone_database_password }}@{{ keystone_database_address }}/{{ keystone_database_name }} max_retries = -1 -{% if keystone_domain_cfg.stat.exists %} +{% if keystone_domain_directory.stat.exists %} [identity] domain_specific_drivers_enabled = true domain_config_dir = /etc/keystone/domains