We call this role for each play which isn't needed.
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
- import_role:
name: ceph-facts
-
- import_role:
name: ceph-infra
when:
- containerized_deployment | bool
- ceph_docker_registry_auth | bool
+ - (group_names != ['clients']) or (inventory_hostname == groups.get('clients', [''])|first)
- import_role:
name: ceph-validate
- import_role:
name: ceph-defaults
+
- import_role:
name: ceph-facts
+ tasks_from: find_running_mon.yml
+ when: containerized_deployment | bool
- block:
- name: get ceph cluster status
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- import_role:
name: ceph-handler
- import_role:
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- import_role:
name: ceph-handler
- import_role:
tasks:
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- tasks_from: container_binary.yml
- name: set osd flags
command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd set {{ item }}"
tasks:
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- name: get osd numbers - non container
shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | sed 's/.*-//' ; fi"
tasks:
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- tasks_from: container_binary.yml
- name: set_fact container_exec_cmd_osd
set_fact:
block:
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- name: deactivate all mds rank > 0 if any
when: groups.get(mds_group_name, []) | length > 1
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
-
- name: prevent restart from the packaging
systemd:
name: ceph-mds@{{ ansible_hostname }}
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
-
- name: prevent restarts from the packaging
systemd:
name: ceph-mds@{{ ansible_hostname }}
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- name: stop ceph rgw when upgrading from stable-3.2
systemd:
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- import_role:
name: ceph-handler
- import_role:
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- import_role:
name: ceph-handler
- import_role:
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- import_role:
name: ceph-handler
- import_role:
tasks:
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- import_role:
name: ceph-handler
- import_role:
name: ceph-common
when: not containerized_deployment | bool
- - import_role:
- name: ceph-container-common
- when: containerized_deployment | bool
- import_role:
name: ceph-config
- import_role:
masked: yes
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- tasks_from: container_binary.yml
- import_role:
name: ceph-handler
- import_role:
tasks:
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- name: container | disallow pre-pacific OSDs and enable all new pacific-only functionality
command: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph osd require-osd-release pacific"
state: stopped
failed_when: false
- - import_role:
- name: ceph-facts
- import_role:
name: ceph-container-engine
- import_role:
- prometheus
- grafana-server
- - import_role:
- name: ceph-facts
- import_role:
name: ceph-facts
tasks_from: grafana
- name: with dashboard configuration
when: dashboard_enabled | bool
block:
- - import_role:
- name: ceph-facts
- import_role:
name: ceph-facts
tasks_from: grafana
--- /dev/null
+---
+- name: set_fact container_exec_cmd
+ set_fact:
+ container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] if not rolling_update else hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_hostname'] }}"
+ when:
+ - containerized_deployment | bool
run_once: true
when: groups.get(mon_group_name, []) | length > 0
-- name: find a running monitor
+- name: import_tasks find_running_mon.yml
+ import_tasks: find_running_mon.yml
when: groups.get(mon_group_name, []) | length > 0
- block:
- - name: set_fact container_exec_cmd
- set_fact:
- container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] if not rolling_update else hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_hostname'] }}"
- when:
- - containerized_deployment | bool
-
- - name: find a running mon container
- command: "{{ container_binary }} ps -q --filter name=ceph-mon-{{ hostvars[item]['ansible_hostname'] }}"
- register: find_running_mon_container
- failed_when: false
- run_once: true
- delegate_to: "{{ item }}"
- with_items: "{{ groups.get(mon_group_name, []) }}"
- when:
- - containerized_deployment | bool
-
- - name: check for a ceph mon socket
- shell: stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-mon*.asok
- changed_when: false
- failed_when: false
- check_mode: no
- register: mon_socket_stat
- run_once: true
- delegate_to: "{{ item }}"
- with_items: "{{ groups.get(mon_group_name, []) }}"
- when:
- - not containerized_deployment | bool
-
- - name: check if the ceph mon socket is in-use
- command: grep -q {{ item.stdout }} /proc/net/unix
- changed_when: false
- failed_when: false
- check_mode: no
- register: mon_socket
- run_once: true
- with_items: "{{ mon_socket_stat.results }}"
- when:
- - not containerized_deployment | bool
- - item.rc == 0
-
- - name: set_fact running_mon - non_container
- set_fact:
- running_mon: "{{ hostvars[item.item.item]['inventory_hostname'] }}"
- with_items: "{{ mon_socket.results }}"
- run_once: true
- when:
- - not containerized_deployment | bool
- - item.rc is defined
- - item.rc == 0
-
- - name: set_fact running_mon - container
- set_fact:
- running_mon: "{{ item.item }}"
- run_once: true
- with_items: "{{ find_running_mon_container.results }}"
- when:
- - containerized_deployment | bool
- - item.stdout_lines | default([]) | length > 0
-
- - name: set_fact _container_exec_cmd
- set_fact:
- _container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0] if running_mon is undefined else running_mon]['ansible_hostname'] }}"
- when:
- - containerized_deployment | bool
-
- # this task shouldn't run in a rolling_update situation
- # because it blindly picks a mon, which may be down because
- # of the rolling update
- - name: get current fsid if cluster is already running
- command: "{{ timeout_command }} {{ _container_exec_cmd | default('') }} ceph --cluster {{ cluster }} fsid"
- changed_when: false
- failed_when: false
- check_mode: no
- register: current_fsid
- run_once: true
- delegate_to: "{{ groups[mon_group_name][0] if running_mon is undefined else running_mon }}"
- when:
- - not rolling_update | bool
# set this as a default when performing a rolling_update
# so the rest of the tasks here will succeed
--- /dev/null
+---
+- name: import_tasks container_exec_cmd.yml
+ import_tasks: container_exec_cmd.yml
+ when: containerized_deployment | bool
+
+- name: find a running mon container
+ command: "{{ container_binary }} ps -q --filter name=ceph-mon-{{ hostvars[item]['ansible_hostname'] }}"
+ register: find_running_mon_container
+ failed_when: false
+ run_once: true
+ delegate_to: "{{ item }}"
+ with_items: "{{ groups.get(mon_group_name, []) }}"
+ when:
+ - containerized_deployment | bool
+
+- name: check for a ceph mon socket
+ shell: stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-mon*.asok
+ changed_when: false
+ failed_when: false
+ check_mode: no
+ register: mon_socket_stat
+ run_once: true
+ delegate_to: "{{ item }}"
+ with_items: "{{ groups.get(mon_group_name, []) }}"
+ when:
+ - not containerized_deployment | bool
+
+- name: check if the ceph mon socket is in-use
+ command: grep -q {{ item.stdout }} /proc/net/unix
+ changed_when: false
+ failed_when: false
+ check_mode: no
+ register: mon_socket
+ run_once: true
+ with_items: "{{ mon_socket_stat.results }}"
+ when:
+ - not containerized_deployment | bool
+ - item.rc == 0
+
+- name: set_fact running_mon - non_container
+ set_fact:
+ running_mon: "{{ hostvars[item.item.item]['inventory_hostname'] }}"
+ with_items: "{{ mon_socket.results }}"
+ run_once: true
+ when:
+ - not containerized_deployment | bool
+ - item.rc is defined
+ - item.rc == 0
+
+- name: set_fact running_mon - container
+ set_fact:
+ running_mon: "{{ item.item }}"
+ run_once: true
+ with_items: "{{ find_running_mon_container.results }}"
+ when:
+ - containerized_deployment | bool
+ - item.stdout_lines | default([]) | length > 0
+
+- name: set_fact _container_exec_cmd
+ set_fact:
+ _container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0] if running_mon is undefined else running_mon]['ansible_hostname'] }}"
+ when:
+ - containerized_deployment | bool
+
+# this task shouldn't run in a rolling_update situation
+# because it blindly picks a mon, which may be down because
+# of the rolling update
+- name: get current fsid if cluster is already running
+ command: "{{ timeout_command }} {{ _container_exec_cmd | default('') }} ceph --cluster {{ cluster }} fsid"
+ changed_when: false
+ failed_when: false
+ check_mode: no
+ register: current_fsid
+ run_once: true
+ delegate_to: "{{ groups[mon_group_name][0] if running_mon is undefined else running_mon }}"
+ when:
+ - not rolling_update | bool
\ No newline at end of file
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
tasks:
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- tasks_from: container_binary.yml
- import_role:
name: ceph-handler
- import_role:
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-handler
tags: ['ceph_update_config']
- import_role:
name: ceph-defaults
tags: ['ceph_update_config']
- - import_role:
- name: ceph-facts
- tags: ['ceph_update_config']
- import_role:
name: ceph-rgw-loadbalancer
tasks:
- import_role:
name: ceph-defaults
- - import_role:
- name: ceph-facts
- tasks_from: container_binary.yml
- import_role:
name: ceph-handler
- import_role: