Remove ceph_client role execution from playbooks

The ceph_client role is now executed inside the nova, cinder, and
glance roles  as an include_role statement to avoid service restart
and library linking race conditions.

Change-Id: I6a76e63881150677352520ce9658f1cf6b7e5456
Depends-On: Iea317a20d37ae6f187df3eb7db6290d6b99e6997
Depends-On: I1d24a82f22663150f0db5bbfcb4d957d600db5c2
Depends-On: I620552d7de367d89a99d1622a4e0c89e78336e86
This commit is contained in:
Logan V 2017-07-12 13:21:27 -05:00
parent 16f0609040
commit be1419dbdf
5 changed files with 24 additions and 41 deletions

View File

@ -17,19 +17,6 @@ cinder_service_region: "{{ service_region }}"
cinder_service_port: 8776 cinder_service_port: 8776
# If there are Swift hosts in the environment, then enable cinder backups to it # If there are Swift hosts in the environment, then enable cinder backups to it
cinder_service_backup_program_enabled: "{{ groups['swift_all'] is defined and groups['swift_all'] | length > 0 }}" cinder_service_backup_program_enabled: "{{ groups['swift_all'] is defined and groups['swift_all'] | length > 0 }}"
# cinder_backend_rbd_inuse: True if current host has an rbd backend
cinder_backend_rbd_inuse: '{{ (cinder_backends|default("")|to_json).find("cinder.volume.drivers.rbd.RBDDriver") != -1 }}'
# cinder_backends_rbd_inuse: true if at least 1 cinder_backend on any
# cinder_volume host uses Ceph RBD
# http://stackoverflow.com/questions/9486393/jinja2-change-the-value-of-a-variable-inside-a-loop
cinder_backends_rbd_inuse: >-
{% set _var = False -%}
{% for host in groups['cinder_volume'] -%}
{% if hostvars[host]['cinder_backend_rbd_inuse'] | bool -%}
{% set _var = True -%}
{% endif -%}
{% endfor -%}
{{ _var }}
cinder_ceph_client: cinder cinder_ceph_client: cinder
# These are here rather than in cinder_all because # These are here rather than in cinder_all because

View File

@ -13,5 +13,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# cinder_backend_rbd_inuse: True if current host has an rbd backend
# this is defined identically downstream in the os_cinder role, but redefined
# here so it can be consumed by the nova group vars
cinder_backend_rbd_inuse: '{{ (cinder_backends|default("")|to_json).find("cinder.volume.drivers.rbd.RBDDriver") != -1 }}'
lxc_container_config_list: lxc_container_config_list:
- "lxc.aa_profile=unconfined" - "lxc.aa_profile=unconfined"

View File

@ -97,15 +97,6 @@
- role: "os_cinder" - role: "os_cinder"
cinder_storage_address: "{{ storage_address }}" cinder_storage_address: "{{ storage_address }}"
- role: "ceph_client"
openstack_service_system_user: "{{ cinder_system_user_name }}"
openstack_service_venv_bin: "{{ cinder_bin }}"
when:
- "'cinder_volume' in group_names"
- "cinder_backend_rbd_inuse | default(false) | bool"
tags:
- ceph
- role: "rsyslog_client" - role: "rsyslog_client"
rsyslog_client_log_rotate_file: cinder_log_rotate rsyslog_client_log_rotate_file: cinder_log_rotate
rsyslog_client_log_dir: "/var/log/cinder" rsyslog_client_log_dir: "/var/log/cinder"

View File

@ -61,15 +61,6 @@
roles: roles:
- role: "os_glance" - role: "os_glance"
- role: "ceph_client"
openstack_service_system_user: "{{ glance_system_user_name }}"
openstack_service_venv_bin: "{{ glance_bin }}"
when:
- "'glance_api' in group_names"
- "{{ 'rbd' in [glance_default_store | default('none')] + glance_additional_stores | default([]) }}"
tags:
- ceph
- role: "openstack_openrc" - role: "openstack_openrc"
tags: tags:
- openrc - openrc

View File

@ -24,6 +24,24 @@
tags: tags:
- nova - nova
pre_tasks: pre_tasks:
# Enable execution of ceph_client on the nova compute hosts if cinder RBD
# backends are used. This is necessary to ensure that volume-backed Nova
# instances can function when RBD is the volume backend.
- name: Set cinder RBD inuse fact
set_fact:
nova_cinder_rbd_inuse: |-
{% set _var = False %}
{% for host in groups['cinder_volume'] %}
{% if hostvars[host]['cinder_backend_rbd_inuse'] | bool %}
{% set _var = True %}
{% endif %}
{% endfor %}
{{ _var }}
delegate_to: localhost
delegate_facts: True
run_once: yes
tags:
- always
# In order to ensure that any container, software or # In order to ensure that any container, software or
# config file changes which causes a container/service # config file changes which causes a container/service
@ -122,16 +140,7 @@
nova_spicehtml5_git_repo: "{{ openstack_repo_git_url }}/spice-html5" nova_spicehtml5_git_repo: "{{ openstack_repo_git_url }}/spice-html5"
nova_spicehtml5_git_install_branch: "{{ spicehtml5_git_install_branch }}" nova_spicehtml5_git_install_branch: "{{ spicehtml5_git_install_branch }}"
nova_management_address: "{{ management_address }}" nova_management_address: "{{ management_address }}"
nova_cinder_rbd_inuse: "{{ hostvars['localhost']['nova_cinder_rbd_inuse'] }}"
- role: "ceph_client"
openstack_service_system_user: "{{ nova_system_user_name }}"
openstack_service_venv_bin: "{{ nova_bin }}"
when:
- "'nova_compute' in group_names"
- "(nova_libvirt_images_rbd_pool is defined) or
(cinder_backends_rbd_inuse | default(false)) | bool"
tags:
- ceph
- role: "openstack_openrc" - role: "openstack_openrc"
tags: tags: