diff --git a/ansible/roles/cinder/tasks/ceph.yml b/ansible/roles/cinder/tasks/ceph.yml index 952ebeddcf..719458fc8a 100644 --- a/ansible/roles/cinder/tasks/ceph.yml +++ b/ansible/roles/cinder/tasks/ceph.yml @@ -1,22 +1,4 @@ --- -- name: Ensuring config directory exists - vars: - services_need_directory: - - "cinder-volume" - - "cinder-backup" - file: - path: "{{ node_config_directory }}/{{ item.key }}" - state: "directory" - owner: "{{ config_owner_user }}" - group: "{{ config_owner_group }}" - mode: "0770" - become: true - when: - - item.value.enabled | bool - - inventory_hostname in groups[item.value.group] - - item.key in services_need_directory - with_dict: "{{ cinder_services }}" - - name: Copying over ceph.conf(s) vars: services_need_config: diff --git a/ansible/roles/cinder/tasks/config.yml b/ansible/roles/cinder/tasks/config.yml index 348f5674dd..c7b69411e8 100644 --- a/ansible/roles/cinder/tasks/config.yml +++ b/ansible/roles/cinder/tasks/config.yml @@ -12,6 +12,21 @@ - item.value.enabled | bool with_dict: "{{ cinder_services }}" +- include_tasks: ceph.yml + when: + - (enable_ceph | bool) and (cinder_backend_ceph | bool) + - inventory_hostname in groups['ceph-mon'] or + inventory_hostname in groups['cinder-api'] or + inventory_hostname in groups['cinder-volume'] or + inventory_hostname in groups['cinder-scheduler'] or + inventory_hostname in groups['cinder-backup'] + +- include_tasks: external_ceph.yml + when: + - (enable_ceph | bool == False) and (cinder_backend_ceph | bool) + - inventory_hostname in groups['cinder-volume'] or + inventory_hostname in groups['cinder-backup'] + - name: Check if policies shall be overwritten local_action: stat path="{{ item }}" run_once: True diff --git a/ansible/roles/cinder/tasks/deploy.yml b/ansible/roles/cinder/tasks/deploy.yml index 9a5765f17e..d7bd033ac9 100644 --- a/ansible/roles/cinder/tasks/deploy.yml +++ b/ansible/roles/cinder/tasks/deploy.yml @@ -1,24 +1,10 @@ --- -- include_tasks: ceph.yml - when: - - (enable_ceph | bool) and (cinder_backend_ceph | bool) - - inventory_hostname in groups['ceph-mon'] or - inventory_hostname in groups['cinder-api'] or - inventory_hostname in groups['cinder-volume'] or - inventory_hostname in groups['cinder-scheduler'] or - inventory_hostname in groups['cinder-backup'] - -- include_tasks: external_ceph.yml - when: - - (enable_ceph | bool == False) and (cinder_backend_ceph | bool) - - inventory_hostname in groups['cinder-volume'] or - inventory_hostname in groups['cinder-backup'] - - include_tasks: register.yml when: inventory_hostname in groups['cinder-api'] - include_tasks: config.yml - when: inventory_hostname in groups['cinder-api'] or + when: inventory_hostname in groups['ceph-mon'] or + inventory_hostname in groups['cinder-api'] or inventory_hostname in groups['cinder-volume'] or inventory_hostname in groups['cinder-scheduler'] or inventory_hostname in groups['cinder-backup'] diff --git a/ansible/roles/cinder/tasks/external_ceph.yml b/ansible/roles/cinder/tasks/external_ceph.yml index d23b20d2d9..2d63d06d9e 100644 --- a/ansible/roles/cinder/tasks/external_ceph.yml +++ b/ansible/roles/cinder/tasks/external_ceph.yml @@ -1,22 +1,4 @@ --- -- name: Ensuring config directory exists - vars: - services_need_directory: - - "cinder-volume" - - "cinder-backup" - file: - path: "{{ node_config_directory }}/{{ item.key }}" - state: "directory" - owner: "{{ config_owner_user }}" - group: "{{ config_owner_group }}" - mode: "0770" - become: true - when: - - item.value.enabled | bool - - inventory_hostname in groups[item.value.group] - - item.key in services_need_directory - with_dict: "{{ cinder_services }}" - - name: Copying over ceph.conf for Cinder vars: services_need_config: diff --git a/ansible/roles/glance/tasks/ceph.yml b/ansible/roles/glance/tasks/ceph.yml index 04ff51af3e..49f43bd2c7 100644 --- a/ansible/roles/glance/tasks/ceph.yml +++ b/ansible/roles/glance/tasks/ceph.yml @@ -1,12 +1,4 @@ --- -- name: Ensuring config directory exists - file: - path: "{{ node_config_directory }}/glance-api" - state: "directory" - mode: "0770" - become: true - when: inventory_hostname in groups['glance-api'] - - name: Copying over ceph.conf(s) merge_configs: sources: diff --git a/ansible/roles/glance/tasks/config.yml b/ansible/roles/glance/tasks/config.yml index f39a879bd4..e7c459555f 100644 --- a/ansible/roles/glance/tasks/config.yml +++ b/ansible/roles/glance/tasks/config.yml @@ -1,14 +1,4 @@ --- -- include_tasks: ceph.yml - when: - - enable_ceph | bool - - glance_backend_ceph | bool - -- include_tasks: external_ceph.yml - when: - - enable_ceph | bool == False - - glance_backend_ceph | bool - - name: Ensuring config directories exist file: path: "{{ node_config_directory }}/{{ item.key }}" @@ -22,6 +12,16 @@ - item.value.enabled | bool with_dict: "{{ glance_services }}" +- include_tasks: ceph.yml + when: + - enable_ceph | bool + - glance_backend_ceph | bool + +- include_tasks: external_ceph.yml + when: + - enable_ceph | bool == False + - glance_backend_ceph | bool + - name: Check if policies shall be overwritten local_action: stat path="{{ item }}" run_once: True diff --git a/ansible/roles/glance/tasks/external_ceph.yml b/ansible/roles/glance/tasks/external_ceph.yml index 513e063508..33b20731b8 100644 --- a/ansible/roles/glance/tasks/external_ceph.yml +++ b/ansible/roles/glance/tasks/external_ceph.yml @@ -1,12 +1,4 @@ --- -- name: Ensuring config directory exists - file: - path: "{{ node_config_directory }}/glance-api" - state: "directory" - mode: "0770" - become: true - when: inventory_hostname in groups['glance-api'] - - name: Copy over ceph files copy: src: "{{ item }}" diff --git a/ansible/roles/gnocchi/tasks/ceph.yml b/ansible/roles/gnocchi/tasks/ceph.yml index d6bed838e3..f85eae2c0f 100644 --- a/ansible/roles/gnocchi/tasks/ceph.yml +++ b/ansible/roles/gnocchi/tasks/ceph.yml @@ -1,15 +1,4 @@ --- -- name: Ensuring config directory exists - file: - path: "{{ node_config_directory }}/{{ item }}" - state: "directory" - become: true - when: inventory_hostname in groups[item] - with_items: - - "gnocchi-api" - - "gnocchi-metricd" - - "gnocchi-statsd" - - name: Copying over ceph.conf(s) merge_configs: sources: diff --git a/ansible/roles/gnocchi/tasks/config.yml b/ansible/roles/gnocchi/tasks/config.yml index 6922dfff0c..87c4e87f23 100644 --- a/ansible/roles/gnocchi/tasks/config.yml +++ b/ansible/roles/gnocchi/tasks/config.yml @@ -12,6 +12,16 @@ - item.value.enabled | bool with_dict: "{{ gnocchi_services }}" +- include_tasks: ceph.yml + when: + - enable_ceph | bool + - gnocchi_backend_storage == 'ceph' + +- include_tasks: external_ceph.yml + when: + - enable_ceph | bool == False + - gnocchi_backend_storage == 'ceph' + - name: Check if policies shall be overwritten local_action: stat path="{{ item }}" run_once: True diff --git a/ansible/roles/gnocchi/tasks/deploy.yml b/ansible/roles/gnocchi/tasks/deploy.yml index e80952cb85..f371e4f03e 100644 --- a/ansible/roles/gnocchi/tasks/deploy.yml +++ b/ansible/roles/gnocchi/tasks/deploy.yml @@ -1,14 +1,4 @@ --- -- include_tasks: ceph.yml - when: - - enable_ceph | bool - - gnocchi_backend_storage == 'ceph' - -- include_tasks: external_ceph.yml - when: - - enable_ceph | bool == False - - gnocchi_backend_storage == 'ceph' - - include_tasks: register.yml when: inventory_hostname in groups['gnocchi-api'] diff --git a/ansible/roles/gnocchi/tasks/external_ceph.yml b/ansible/roles/gnocchi/tasks/external_ceph.yml index e3bf801ad0..0e54c73b11 100644 --- a/ansible/roles/gnocchi/tasks/external_ceph.yml +++ b/ansible/roles/gnocchi/tasks/external_ceph.yml @@ -1,15 +1,4 @@ --- -- name: Ensuring config directory exists - file: - path: "{{ node_config_directory }}/{{ item }}" - state: "directory" - become: true - when: inventory_hostname in groups[item] - with_items: - - "gnocchi-api" - - "gnocchi-metricd" - - "gnocchi-statsd" - - name: Copy over ceph.conf file template: src: "{{ node_custom_config }}/gnocchi/ceph.conf" diff --git a/ansible/roles/manila/tasks/ceph.yml b/ansible/roles/manila/tasks/ceph.yml index 2cbc0b343c..eb1870cb7a 100644 --- a/ansible/roles/manila/tasks/ceph.yml +++ b/ansible/roles/manila/tasks/ceph.yml @@ -1,10 +1,4 @@ --- -- name: Ensuring config directory exists - file: - path: "{{ node_config_directory }}/manila-share" - state: "directory" - become: true - - name: Copying over ceph.conf for manila merge_configs: sources: diff --git a/ansible/roles/manila/tasks/config.yml b/ansible/roles/manila/tasks/config.yml index aa54addb6e..15da1faf84 100644 --- a/ansible/roles/manila/tasks/config.yml +++ b/ansible/roles/manila/tasks/config.yml @@ -12,6 +12,20 @@ - item.value.enabled | bool with_dict: "{{ manila_services }}" +- include_tasks: ceph.yml + when: + - enable_ceph | bool + - enable_ceph_mds | bool + - (enable_manila_backend_cephfs_native | bool) or (enable_manila_backend_cephfs_nfs | bool) + - inventory_hostname in groups['manila-share'] + +- include_tasks: external_ceph.yml + when: + - enable_ceph| bool == False + - enable_ceph_mds| bool == False + - (enable_manila_backend_cephfs_native | bool) or (enable_manila_backend_cephfs_nfs | bool) + - inventory_hostname in groups['manila-share'] + - name: Check if policies shall be overwritten local_action: stat path="{{ item }}" run_once: True diff --git a/ansible/roles/manila/tasks/deploy.yml b/ansible/roles/manila/tasks/deploy.yml index 00060bb0ce..1f703768e0 100644 --- a/ansible/roles/manila/tasks/deploy.yml +++ b/ansible/roles/manila/tasks/deploy.yml @@ -1,18 +1,4 @@ --- -- include_tasks: ceph.yml - when: - - enable_ceph | bool - - enable_ceph_mds | bool - - (enable_manila_backend_cephfs_native | bool) or (enable_manila_backend_cephfs_nfs | bool) - - inventory_hostname in groups['manila-share'] - -- include_tasks: external_ceph.yml - when: - - enable_ceph| bool == False - - enable_ceph_mds| bool == False - - (enable_manila_backend_cephfs_native | bool) or (enable_manila_backend_cephfs_nfs | bool) - - inventory_hostname in groups['manila-share'] - - include_tasks: clone.yml when: manila_dev_mode | bool diff --git a/ansible/roles/manila/tasks/external_ceph.yml b/ansible/roles/manila/tasks/external_ceph.yml index 10b89d4204..2ffb04c038 100644 --- a/ansible/roles/manila/tasks/external_ceph.yml +++ b/ansible/roles/manila/tasks/external_ceph.yml @@ -1,12 +1,4 @@ --- -- name: Ensuring config directory exists - file: - path: "{{ node_config_directory }}/manila-share" - state: "directory" - become: true - when: - - inventory_hostname in groups['manila-share'] - - name: Copying over ceph.conf for manila template: src: "{{ node_custom_config }}/manila/ceph.conf" diff --git a/ansible/roles/nova/tasks/ceph.yml b/ansible/roles/nova/tasks/ceph.yml index ec3122b352..76aa128447 100644 --- a/ansible/roles/nova/tasks/ceph.yml +++ b/ansible/roles/nova/tasks/ceph.yml @@ -6,7 +6,6 @@ mode: "0770" become: true with_items: - - "nova-compute" - "nova-libvirt/secrets" when: inventory_hostname in groups['compute'] diff --git a/ansible/roles/nova/tasks/config.yml b/ansible/roles/nova/tasks/config.yml index b2d956f7e0..9c9a2e75ae 100644 --- a/ansible/roles/nova/tasks/config.yml +++ b/ansible/roles/nova/tasks/config.yml @@ -24,6 +24,22 @@ - item.value.enabled | bool with_dict: "{{ nova_services }}" +- include_tasks: ceph.yml + when: + - enable_ceph | bool and nova_backend == "rbd" + - inventory_hostname in groups['ceph-mon'] or + inventory_hostname in groups['compute'] or + inventory_hostname in groups['nova-api'] or + inventory_hostname in groups['nova-conductor'] or + inventory_hostname in groups['nova-consoleauth'] or + inventory_hostname in groups['nova-novncproxy'] or + inventory_hostname in groups['nova-scheduler'] + +- include_tasks: external_ceph.yml + when: + - not enable_ceph | bool and (nova_backend == "rbd" or cinder_backend_ceph | bool) + - inventory_hostname in groups['compute'] + - name: Check if policies shall be overwritten local_action: stat path="{{ item }}" run_once: True diff --git a/ansible/roles/nova/tasks/deploy.yml b/ansible/roles/nova/tasks/deploy.yml index 74d3e50007..0ea76bd066 100644 --- a/ansible/roles/nova/tasks/deploy.yml +++ b/ansible/roles/nova/tasks/deploy.yml @@ -1,20 +1,4 @@ --- -- include_tasks: ceph.yml - when: - - enable_ceph | bool and nova_backend == "rbd" - - inventory_hostname in groups['ceph-mon'] or - inventory_hostname in groups['compute'] or - inventory_hostname in groups['nova-api'] or - inventory_hostname in groups['nova-conductor'] or - inventory_hostname in groups['nova-consoleauth'] or - inventory_hostname in groups['nova-novncproxy'] or - inventory_hostname in groups['nova-scheduler'] - -- include_tasks: external_ceph.yml - when: - - not enable_ceph | bool and (nova_backend == "rbd" or cinder_backend_ceph | bool) - - inventory_hostname in groups['compute'] - - include_tasks: register.yml when: inventory_hostname in groups['nova-api'] diff --git a/ansible/roles/nova/tasks/external_ceph.yml b/ansible/roles/nova/tasks/external_ceph.yml index 93950f621e..bbba9997d5 100644 --- a/ansible/roles/nova/tasks/external_ceph.yml +++ b/ansible/roles/nova/tasks/external_ceph.yml @@ -6,7 +6,6 @@ mode: "0770" become: true with_items: - - "nova-compute" - "nova-libvirt/secrets" when: inventory_hostname in groups['compute']