diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index b15d5e54b..b5ffcf102 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -410,6 +410,10 @@ - import_role: name: ceph-facts + - import_role: + name: ceph-config + tasks_from: rgw_systemd_environment_file.yml + # NOTE: changed from file module to raw find command for performance reasons # The file module has to run checks on current ownership of all directories and files. This is unnecessary # as in this case we know we want all owned by ceph user diff --git a/roles/ceph-config/tasks/main.yml b/roles/ceph-config/tasks/main.yml index 6550f437f..bb406b477 100644 --- a/roles/ceph-config/tasks/main.yml +++ b/roles/ceph-config/tasks/main.yml @@ -3,6 +3,10 @@ include_tasks: create_ceph_initial_dirs.yml when: containerized_deployment | bool +- name: include_tasks rgw_systemd_environment_file.yml + include_tasks: rgw_systemd_environment_file.yml + when: inventory_hostname in groups.get(rgw_group_name, []) + - name: config file operations related to OSDs when: - inventory_hostname in groups.get(osd_group_name, []) diff --git a/roles/ceph-config/tasks/rgw_systemd_environment_file.yml b/roles/ceph-config/tasks/rgw_systemd_environment_file.yml new file mode 100644 index 000000000..21a77850a --- /dev/null +++ b/roles/ceph-config/tasks/rgw_systemd_environment_file.yml @@ -0,0 +1,23 @@ +--- +- name: create rados gateway instance directories + file: + path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}.{{ item.instance_name }}" + state: directory + owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}" + group: "{{ ceph_uid if containerized_deployment else 'ceph' }}" + mode: "{{ ceph_directories_mode | default('0755') }}" + with_items: "{{ rgw_instances }}" + +- name: generate environment file + copy: + dest: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}.{{ item.instance_name }}/EnvironmentFile" + owner: "root" + group: "root" + mode: "0644" + content: | + INST_NAME={{ item.instance_name }} + INST_PORT={{ item.radosgw_frontend_port }} + with_items: "{{ rgw_instances }}" + when: + - containerized_deployment | bool + - rgw_instances is defined \ No newline at end of file diff --git a/roles/ceph-rgw/tasks/common.yml b/roles/ceph-rgw/tasks/common.yml index 87fb3d66e..5e0520c69 100644 --- a/roles/ceph-rgw/tasks/common.yml +++ b/roles/ceph-rgw/tasks/common.yml @@ -8,16 +8,6 @@ mode: "{{ ceph_directories_mode }}" with_items: "{{ rbd_client_admin_socket_path }}" -- name: create rados gateway instance directories - file: - path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}.{{ item.instance_name }}" - state: directory - owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}" - group: "{{ ceph_uid if containerized_deployment else 'ceph' }}" - mode: "{{ ceph_directories_mode }}" - with_items: "{{ rgw_instances }}" - when: rgw_instances is defined - - name: get keys from monitors command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} auth get {{ item.name }}" register: _rgw_keys diff --git a/roles/ceph-rgw/tasks/start_docker_rgw.yml b/roles/ceph-rgw/tasks/start_docker_rgw.yml index 7cb370214..d0d96314e 100644 --- a/roles/ceph-rgw/tasks/start_docker_rgw.yml +++ b/roles/ceph-rgw/tasks/start_docker_rgw.yml @@ -1,15 +1,4 @@ --- -- name: generate environment file - copy: - dest: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}.{{ item.instance_name }}/EnvironmentFile" - owner: "root" - group: "root" - mode: "0644" - content: | - INST_NAME={{ item.instance_name }} - INST_PORT={{ item.radosgw_frontend_port }} - with_items: "{{ rgw_instances }}" - - name: include_task systemd.yml include_tasks: systemd.yml