diff --git a/ansible/roles/glance/tasks/config.yml b/ansible/roles/glance/tasks/config.yml index d2c2c0076c..54a5394139 100644 --- a/ansible/roles/glance/tasks/config.yml +++ b/ansible/roles/glance/tasks/config.yml @@ -1,4 +1,14 @@ --- +- include: ceph.yml + when: + - enable_ceph | bool + - glance_backend_ceph | bool + +- include: external_ceph.yml + when: + - enable_ceph | bool == False + - glance_backend_ceph | bool + - name: Ensuring config directories exist file: path: "{{ node_config_directory }}/{{ item.key }}" diff --git a/ansible/roles/glance/tasks/deploy.yml b/ansible/roles/glance/tasks/deploy.yml index aed4e7bd66..a27897d84a 100644 --- a/ansible/roles/glance/tasks/deploy.yml +++ b/ansible/roles/glance/tasks/deploy.yml @@ -1,23 +1,8 @@ --- -- include: ceph.yml - when: - - (enable_ceph | bool) and (glance_backend_ceph | bool) - - inventory_hostname in groups['ceph-mon'] or - inventory_hostname in groups['glance-api'] or - inventory_hostname in groups['glance-registry'] - -- include: external_ceph.yml - when: - - (enable_ceph | bool == False) and (glance_backend_ceph | bool) - - inventory_hostname in groups['glance-api'] or - inventory_hostname in groups['glance-registry'] - - include: register.yml when: inventory_hostname in groups['glance-api'] - include: config.yml - when: inventory_hostname in groups['glance-api'] or - inventory_hostname in groups['glance-registry'] - include: clone.yml when: diff --git a/ansible/roles/glance/tasks/external_ceph.yml b/ansible/roles/glance/tasks/external_ceph.yml index 0eeb588296..ebbd8faf32 100644 --- a/ansible/roles/glance/tasks/external_ceph.yml +++ b/ansible/roles/glance/tasks/external_ceph.yml @@ -11,6 +11,7 @@ src: "{{ item }}" dest: "{{ node_config_directory }}/glance-api/" mode: "0660" + when: inventory_hostname in groups['glance-api'] with_fileglob: - "{{ node_custom_config }}/glance/ceph*"