<commit_before>---
- name: update apt cache
  apt:
    update-cache: yes
  when: ansible_os_family == 'Debian'

- block:
  - name: copy mon restart script
    template:
      src: restart_mon_daemon.sh.j2
      dest: /tmp/restart_mon_daemon.sh
      owner: root
      group: root
      mode: 0750
    listen: "restart ceph mons"

  - name: restart ceph mon daemon(s)
    command: /tmp/restart_mon_daemon.sh
    listen: "restart ceph mons"
  when:
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
    - socket.rc == 0
    - mon_group_name in group_names

# This does not just restart OSDs but everything else too. Unfortunately
# at this time the ansible role does not have an OSD id list to use
# for restarting them specifically.
- name: copy osd restart script
  template:
    src: restart_osd_daemon.sh.j2
    dest: /tmp/restart_osd_daemon.sh
    owner: root
    group: root
    mode: 0750
  listen: "restart ceph osds"
  when:
    - inventory_hostname in play_hosts
    - osd_group_name in group_names

- name: restart containerized ceph osds daemon(s)
  command: /tmp/restart_osd_daemon.sh
  listen: "restart ceph osds"
  with_items: "{{ socket_osd_container.results }}"
  when:
  # We do not want to run these checks on initial deployment (`socket_osd_container.results[n].rc == 0`)
  # except when a crush location is specified. ceph-disk will start the osds before the osd crush location is specified
    - containerized_deployment
    - ((crush_location is defined and crush_location) or item.get('rc') == 0)
    - handler_health_osd_check
    # See https://github.com/ceph/ceph-ansible/issues/1457 for the condition below
    - inventory_hostname in play_hosts
    - osd_group_name in group_names

- name: restart non-containerized ceph osds daemon(s)<commit_msg>ceph-defaults: fix handler for osd container<commit_after>---
- name: update apt cache
  apt:
    update-cache: yes
  when: ansible_os_family == 'Debian'

- block:
  - name: copy mon restart script
    template:
      src: restart_mon_daemon.sh.j2
      dest: /tmp/restart_mon_daemon.sh
      owner: root
      group: root
      mode: 0750
    listen: "restart ceph mons"

  - name: restart ceph mon daemon(s)
    command: /tmp/restart_mon_daemon.sh
    listen: "restart ceph mons"
  when:
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
    - socket.rc == 0
    - mon_group_name in group_names

# This does not just restart OSDs but everything else too. Unfortunately
# at this time the ansible role does not have an OSD id list to use
# for restarting them specifically.
- name: copy osd restart script
  template:
    src: restart_osd_daemon.sh.j2
    dest: /tmp/restart_osd_daemon.sh
    owner: root
    group: root
    mode: 0750
  listen: "restart ceph osds"
  when:
    - inventory_hostname in play_hosts
    - osd_group_name in group_names

- name: restart containerized ceph osds daemon(s)
  command: /tmp/restart_osd_daemon.sh
  listen: "restart ceph osds"
  with_items: "{{ socket_osd_container.results }}"
  when:
  # We do not want to run these checks on initial deployment (`socket_osd_container.results[n].rc == 0`)
  # except when a crush location is specified. ceph-disk will start the osds before the osd crush location is specified
    - containerized_deployment
    - not item.get("skipped")
    - ((crush_location is defined and crush_location) or item.get('rc') == 0)
    - handler_health_osd_check
    # See https://github.com/ceph/ceph-ansible/issues/1457 for the condition below
    - inventory_hostname in play_hosts
    - osd_group_name in group_names

- name: restart non-containerized ceph osds daemon(s)
{'fraction_non_alphanumeric': 0.08294679399727149, 'fraction_numerical': 0.009822646657571623, 'mean_word_length': 3.272727272727273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5699082', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1202, 'n_words': 394}