diff --git a/tasks/cinder_post_install.yml b/tasks/cinder_post_install.yml index 048de668..ecbea02d 100644 --- a/tasks/cinder_post_install.yml +++ b/tasks/cinder_post_install.yml @@ -62,7 +62,7 @@ state: present notify: Ensure tgt service restarted when: - - inventory_hostname in groups['cinder_volume'] + - "cinder_services['cinder-volume']['group'] in group_names" - cinder_backend_lvm_inuse | bool - name: Create nfs shares export file @@ -71,8 +71,8 @@ dest: "{{ item.value.nfs_shares_config }}" with_dict: "{{ cinder_backends | default({}) }}" when: + - "cinder_services['cinder-volume']['group'] in group_names" - item.value.nfs_shares_config is defined - - inventory_hostname in groups['cinder_volume'] tags: - cinder-nfs diff --git a/tasks/main.yml b/tasks/main.yml index fa81278e..846ebbb2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -54,7 +54,7 @@ static: no when: - "groups['cinder_api'] | length > 0" - - "'cinder_api' in group_names" + - "cinder_services['cinder-api']['group'] in group_names" - "inventory_hostname == ((groups['cinder_api'] | intersect(ansible_play_hosts)) | list)[0]" tags: - cinder-config @@ -67,7 +67,7 @@ static: no when: - "groups['cinder_api'] | length > 0" - - "'cinder_api' in group_names" + - "cinder_services['cinder-api']['group'] in group_names" - "inventory_hostname == ((groups['cinder_api'] | intersect(ansible_play_hosts)) | list)[0]" tags: - cinder-config @@ -83,7 +83,7 @@ openstack_service_system_user: "{{ cinder_system_user_name }}" openstack_service_venv_bin: "{{ cinder_bin }}" when: - - "'cinder_volume' in group_names" + - "cinder_services['cinder-volume']['group'] in group_names" - "cinder_backend_rbd_inuse | bool" tags: - ceph @@ -95,14 +95,14 @@ static: no when: - "groups['cinder_volume'] | length > 0" - - "'cinder_volume' in group_names" + - "cinder_services['cinder-volume']['group'] in group_names" - "inventory_hostname == ((groups['cinder_volume'] | intersect(ansible_play_hosts)) | list)[0]" tags: - cinder-config - include: cinder_lvm_config.yml when: - - "'cinder_volume' in group_names" + - "cinder_services['cinder-volume']['group'] in group_names" - "cinder_backend_lvm_inuse | bool" tags: - cinder-config diff --git a/templates/cinder.conf.j2 b/templates/cinder.conf.j2 index 88707c22..22b99d30 100644 --- a/templates/cinder.conf.j2 +++ b/templates/cinder.conf.j2 @@ -18,7 +18,7 @@ enable_v1_api = {{ cinder_enable_v1_api }} enable_v2_api = {{ cinder_enable_v2_api }} enable_v3_api = {{ cinder_enable_v3_api }} -{% if inventory_hostname in groups['cinder_volume'] %} +{% if cinder_services['cinder-volume']['group'] in group_names %} {% if cinder_service_backup_program_enabled == true %} ## Cinder Backup backup_driver = {{ cinder_service_backup_driver }}