From 0ec2bf39ef90fa4192439a8b331603f99e0391c4 Mon Sep 17 00:00:00 2001 From: zhubingbing Date: Tue, 1 Aug 2017 17:47:39 -0400 Subject: [PATCH] Fix modify external ceph.conf not restart related containers modify /etc/kolla/config/cinder/ceph.conf, run kolla-ansible reconfigure but in the container /etc/ceph.conf has not changed Change-Id: I3bd55f76295b9ad1b799db9e910dbd0cd03d417c --- ansible/roles/cinder/handlers/main.yml | 4 ++++ ansible/roles/cinder/tasks/ceph.yml | 4 ++++ ansible/roles/cinder/tasks/external_ceph.yml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/ansible/roles/cinder/handlers/main.yml b/ansible/roles/cinder/handlers/main.yml index 485669848e..ec5a6091aa 100644 --- a/ansible/roles/cinder/handlers/main.yml +++ b/ansible/roles/cinder/handlers/main.yml @@ -50,6 +50,7 @@ vars: service_name: "cinder-volume" service: "{{ cinder_services[service_name] }}" + ceph_config: "{{ cinder_ceph_configs.results|selectattr('item.key', 'equalto', service_name)|first }}" config_json: "{{ cinder_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" cinder_conf: "{{ cinder_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" policy_json: "{{ cinder_policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" @@ -70,11 +71,13 @@ or cinder_conf.changed | bool or policy_json.changed | bool or cinder_volume_container.changed | bool + or ceph_config.changed | bool - name: Restart cinder-backup container vars: service_name: "cinder-backup" service: "{{ cinder_services[service_name] }}" + ceph_config: "{{ cinder_ceph_configs.results|selectattr('item.key', 'equalto', service_name)|first }}" config_json: "{{ cinder_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" cinder_conf: "{{ cinder_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" policy_json: "{{ cinder_policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" @@ -94,3 +97,4 @@ or cinder_conf.changed | bool or policy_json.changed | bool or cinder_backup_container.changed | bool + or ceph_config.changed | bool diff --git a/ansible/roles/cinder/tasks/ceph.yml b/ansible/roles/cinder/tasks/ceph.yml index 5e2d05daad..1e706e3924 100644 --- a/ansible/roles/cinder/tasks/ceph.yml +++ b/ansible/roles/cinder/tasks/ceph.yml @@ -29,6 +29,10 @@ - inventory_hostname in groups[item.value.group] - item.key in services_need_config with_dict: "{{ cinder_services }}" + register: cinder_ceph_configs + notify: + - Restart cinder-volume container + - Restart cinder-backup container - include: ../../ceph_pools.yml vars: diff --git a/ansible/roles/cinder/tasks/external_ceph.yml b/ansible/roles/cinder/tasks/external_ceph.yml index 4d64963863..fbbb32e391 100644 --- a/ansible/roles/cinder/tasks/external_ceph.yml +++ b/ansible/roles/cinder/tasks/external_ceph.yml @@ -28,6 +28,10 @@ - inventory_hostname in groups[item.value.group] - item.key in services_need_config with_dict: "{{ cinder_services }}" + register: cinder_ceph_configs + notify: + - Restart cinder-volume container + - Restart cinder-backup container - name: Copy over Ceph keyring files for cinder-volume copy: