Restart containers when ceph.conf changed
When ceph.conf changed, we need restart some containers. Change-Id: Iddeaf9dd4f288165fcef288e5384d79b61a0910b Closes-Bug: #1810010
This commit is contained in:
parent
3a5ef38f3b
commit
7d9cb44d1f
@ -56,6 +56,7 @@
|
|||||||
service: "{{ cinder_services[service_name] }}"
|
service: "{{ cinder_services[service_name] }}"
|
||||||
config_json: "{{ cinder_config_jsons.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 }}"
|
cinder_conf: "{{ cinder_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
|
ceph_conf: "{{ ceph_confs.results|selectattr('item.key', 'equalto', service_name)|first if ceph_confs is defined else none }}"
|
||||||
policy_overwriting: "{{ cinder_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
policy_overwriting: "{{ cinder_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
cinder_volume_container: "{{ check_cinder_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
cinder_volume_container: "{{ check_cinder_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
become: true
|
become: true
|
||||||
@ -76,6 +77,7 @@
|
|||||||
or cinder_conf.changed | bool
|
or cinder_conf.changed | bool
|
||||||
or policy_overwriting.changed | bool
|
or policy_overwriting.changed | bool
|
||||||
or cinder_volume_container.changed | bool
|
or cinder_volume_container.changed | bool
|
||||||
|
or ( ceph_conf is not none and ceph_conf.changed | bool )
|
||||||
|
|
||||||
- name: Restart cinder-backup container
|
- name: Restart cinder-backup container
|
||||||
vars:
|
vars:
|
||||||
@ -83,6 +85,7 @@
|
|||||||
service: "{{ cinder_services[service_name] }}"
|
service: "{{ cinder_services[service_name] }}"
|
||||||
config_json: "{{ cinder_config_jsons.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 }}"
|
cinder_conf: "{{ cinder_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
|
ceph_conf: "{{ ceph_confs.results|selectattr('item.key', 'equalto', service_name)|first if ceph_confs is defined else none }}"
|
||||||
policy_overwriting: "{{ cinder_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
policy_overwriting: "{{ cinder_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
cinder_backup_container: "{{ check_cinder_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
cinder_backup_container: "{{ check_cinder_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
become: true
|
become: true
|
||||||
@ -102,3 +105,4 @@
|
|||||||
or cinder_conf.changed | bool
|
or cinder_conf.changed | bool
|
||||||
or policy_overwriting.changed | bool
|
or policy_overwriting.changed | bool
|
||||||
or cinder_backup_container.changed | bool
|
or cinder_backup_container.changed | bool
|
||||||
|
or ( ceph_conf is not none and ceph_conf.changed | bool )
|
||||||
|
@ -12,11 +12,14 @@
|
|||||||
dest: "{{ node_config_directory }}/{{ item.key }}/ceph.conf"
|
dest: "{{ node_config_directory }}/{{ item.key }}/ceph.conf"
|
||||||
mode: "0660"
|
mode: "0660"
|
||||||
become: true
|
become: true
|
||||||
|
register: ceph_confs
|
||||||
when:
|
when:
|
||||||
- item.value.enabled | bool
|
- item.value.enabled | bool
|
||||||
- inventory_hostname in groups[item.value.group]
|
- inventory_hostname in groups[item.value.group]
|
||||||
- item.key in services_need_config
|
- item.key in services_need_config
|
||||||
with_dict: "{{ cinder_services }}"
|
with_dict: "{{ cinder_services }}"
|
||||||
|
notify:
|
||||||
|
- Restart {{ item.key }} container
|
||||||
|
|
||||||
- include_tasks: ../../ceph_pools.yml
|
- include_tasks: ../../ceph_pools.yml
|
||||||
vars:
|
vars:
|
||||||
|
@ -11,14 +11,14 @@
|
|||||||
dest: "{{ node_config_directory }}/{{ item.key }}/ceph.conf"
|
dest: "{{ node_config_directory }}/{{ item.key }}/ceph.conf"
|
||||||
mode: "0660"
|
mode: "0660"
|
||||||
become: true
|
become: true
|
||||||
|
register: ceph_confs
|
||||||
when:
|
when:
|
||||||
- item.value.enabled | bool
|
- item.value.enabled | bool
|
||||||
- inventory_hostname in groups[item.value.group]
|
- inventory_hostname in groups[item.value.group]
|
||||||
- item.key in services_need_config
|
- item.key in services_need_config
|
||||||
with_dict: "{{ cinder_services }}"
|
with_dict: "{{ cinder_services }}"
|
||||||
notify:
|
notify:
|
||||||
- Restart cinder-volume container
|
- Restart {{ item.key }} container
|
||||||
- Restart cinder-backup container
|
|
||||||
|
|
||||||
- name: Copy over Ceph keyring files for cinder-volume
|
- name: Copy over Ceph keyring files for cinder-volume
|
||||||
copy:
|
copy:
|
||||||
|
@ -80,6 +80,7 @@
|
|||||||
service_name: "nova-libvirt"
|
service_name: "nova-libvirt"
|
||||||
service: "{{ nova_services[service_name] }}"
|
service: "{{ nova_services[service_name] }}"
|
||||||
config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
|
ceph_conf: "{{ ceph_confs.results|selectattr('item', 'equalto', service_name)|first if ceph_confs is defined else none }}"
|
||||||
nova_libvirt_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
nova_libvirt_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
become: true
|
become: true
|
||||||
kolla_docker:
|
kolla_docker:
|
||||||
@ -103,6 +104,7 @@
|
|||||||
- config_json.changed | bool
|
- config_json.changed | bool
|
||||||
or nova_libvirt_confs.changed | bool
|
or nova_libvirt_confs.changed | bool
|
||||||
or nova_libvirt_container.changed | bool
|
or nova_libvirt_container.changed | bool
|
||||||
|
or ( ceph_conf is not none and ceph_conf.changed | bool )
|
||||||
|
|
||||||
- name: Restart nova-scheduler container
|
- name: Restart nova-scheduler container
|
||||||
vars:
|
vars:
|
||||||
@ -266,6 +268,7 @@
|
|||||||
service: "{{ nova_services[service_name] }}"
|
service: "{{ nova_services[service_name] }}"
|
||||||
config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
config_json: "{{ config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
nova_conf: "{{ nova_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
nova_conf: "{{ nova_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
|
ceph_conf: "{{ ceph_confs.results|selectattr('item', 'equalto', service_name)|first if ceph_confs is defined else none }}"
|
||||||
policy_overwriting: "{{ nova_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
policy_overwriting: "{{ nova_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
nova_compute_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
nova_compute_container: "{{ check_nova_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
|
||||||
become: true
|
become: true
|
||||||
@ -289,6 +292,7 @@
|
|||||||
or vcenter_ca_file | bool
|
or vcenter_ca_file | bool
|
||||||
or nova_compute_release_file | bool
|
or nova_compute_release_file | bool
|
||||||
or nova_compute_container.changed | bool
|
or nova_compute_container.changed | bool
|
||||||
|
or ( ceph_conf is not none and ceph_conf.changed | bool )
|
||||||
|
|
||||||
- name: Restart nova-compute-ironic container
|
- name: Restart nova-compute-ironic container
|
||||||
vars:
|
vars:
|
||||||
|
@ -20,10 +20,13 @@
|
|||||||
dest: "{{ node_config_directory }}/{{ item }}/ceph.conf"
|
dest: "{{ node_config_directory }}/{{ item }}/ceph.conf"
|
||||||
mode: "0660"
|
mode: "0660"
|
||||||
become: true
|
become: true
|
||||||
|
register: ceph_confs
|
||||||
with_items:
|
with_items:
|
||||||
- "nova-compute"
|
- "nova-compute"
|
||||||
- "nova-libvirt"
|
- "nova-libvirt"
|
||||||
when: inventory_hostname in groups['compute']
|
when: inventory_hostname in groups['compute']
|
||||||
|
notify:
|
||||||
|
- Restart {{ item }} container
|
||||||
|
|
||||||
- include_tasks: ../../ceph_pools.yml
|
- include_tasks: ../../ceph_pools.yml
|
||||||
vars:
|
vars:
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
dest: "{{ node_config_directory }}/{{ item }}/"
|
dest: "{{ node_config_directory }}/{{ item }}/"
|
||||||
mode: "0660"
|
mode: "0660"
|
||||||
become: true
|
become: true
|
||||||
|
register: ceph_confs
|
||||||
with_items:
|
with_items:
|
||||||
- nova-compute
|
- nova-compute
|
||||||
- nova-libvirt
|
- nova-libvirt
|
||||||
@ -58,8 +59,7 @@
|
|||||||
- inventory_hostname in groups['compute']
|
- inventory_hostname in groups['compute']
|
||||||
- nova_backend == "rbd"
|
- nova_backend == "rbd"
|
||||||
notify:
|
notify:
|
||||||
- Restart nova-compute container
|
- Restart {{ item }} container
|
||||||
- Restart nova-libvirt container
|
|
||||||
|
|
||||||
- name: Pushing nova secret xml for libvirt
|
- name: Pushing nova secret xml for libvirt
|
||||||
template:
|
template:
|
||||||
|
Loading…
Reference in New Issue
Block a user