deep_scrub_choked
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
---
|
||||
- name: Set_fact delegated_node
|
||||
ansible.builtin.set_fact:
|
||||
delegated_node: "{{ groups[mon_group_name][0] if groups.get(mon_group_name, []) | length > 0 else inventory_hostname }}"
|
||||
|
||||
- name: Set_fact admin_key_presence
|
||||
ansible.builtin.set_fact:
|
||||
admin_key_presence: "{{ True if groups.get(mon_group_name, []) | length > 0 else copy_admin_key }}"
|
||||
|
||||
- name: Create cephx key(s)
|
||||
ceph_key:
|
||||
name: "{{ item.name }}"
|
||||
caps: "{{ item.caps }}"
|
||||
secret: "{{ item.key | default('') }}"
|
||||
cluster: "{{ cluster }}"
|
||||
dest: "{{ ceph_conf_key_directory }}"
|
||||
import_key: "{{ admin_key_presence }}"
|
||||
mode: "{{ item.mode | default(ceph_keyring_permissions) }}"
|
||||
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
environment:
|
||||
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
||||
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
||||
with_items:
|
||||
- "{{ keys }}"
|
||||
delegate_to: "{{ delegated_node }}"
|
||||
when:
|
||||
- cephx | bool
|
||||
- keys | length > 0
|
||||
- inventory_hostname == groups.get('_filtered_clients') | first
|
||||
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
||||
|
||||
- name: Slurp client cephx key(s)
|
||||
ansible.builtin.slurp:
|
||||
src: "{{ ceph_conf_key_directory }}/{{ cluster }}.{{ item.name }}.keyring"
|
||||
with_items: "{{ keys }}"
|
||||
register: slurp_client_keys
|
||||
delegate_to: "{{ delegated_node }}"
|
||||
when:
|
||||
- cephx | bool
|
||||
- keys | length > 0
|
||||
- inventory_hostname == groups.get('_filtered_clients') | first
|
||||
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
||||
|
||||
- name: Pool related tasks
|
||||
when:
|
||||
- admin_key_presence | bool
|
||||
- inventory_hostname == groups.get('_filtered_clients', []) | first
|
||||
block:
|
||||
- name: Import ceph-facts role
|
||||
ansible.builtin.import_role:
|
||||
name: ceph-facts
|
||||
tasks_from: get_def_crush_rule_name.yml
|
||||
|
||||
- name: Create ceph pool(s)
|
||||
ceph_pool:
|
||||
name: "{{ item.name }}"
|
||||
cluster: "{{ cluster }}"
|
||||
pg_num: "{{ item.pg_num | default(omit) }}"
|
||||
pgp_num: "{{ item.pgp_num | default(omit) }}"
|
||||
size: "{{ item.size | default(omit) }}"
|
||||
min_size: "{{ item.min_size | default(omit) }}"
|
||||
pool_type: "{{ item.type | default('replicated') }}"
|
||||
rule_name: "{{ item.rule_name | default(omit) }}"
|
||||
erasure_profile: "{{ item.erasure_profile | default(omit) }}"
|
||||
pg_autoscale_mode: "{{ item.pg_autoscale_mode | default(omit) }}"
|
||||
target_size_ratio: "{{ item.target_size_ratio | default(omit) }}"
|
||||
application: "{{ item.application | default(omit) }}"
|
||||
environment:
|
||||
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
||||
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
||||
with_items: "{{ pools }}"
|
||||
changed_when: false
|
||||
delegate_to: "{{ delegated_node }}"
|
||||
|
||||
- name: Get client cephx keys
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ item.source }}"
|
||||
content: "{{ item.content | b64decode }}"
|
||||
mode: "{{ item.item.get('mode', '0600') }}"
|
||||
owner: "{{ ceph_uid }}"
|
||||
group: "{{ ceph_uid }}"
|
||||
with_items: "{{ hostvars[groups['_filtered_clients'][0]]['slurp_client_keys']['results'] }}"
|
||||
when: not item.get('skipped', False)
|
||||
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: Include pre_requisite.yml
|
||||
ansible.builtin.include_tasks: pre_requisite.yml
|
||||
when: groups.get(mon_group_name, []) | length > 0
|
||||
|
||||
- name: Include create_users_keys.yml
|
||||
ansible.builtin.include_tasks: create_users_keys.yml
|
||||
when:
|
||||
- user_config | bool
|
||||
- not rolling_update | default(False) | bool
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Copy ceph admin keyring
|
||||
when:
|
||||
- cephx | bool
|
||||
- copy_admin_key | bool
|
||||
block:
|
||||
- name: Get keys from monitors
|
||||
ceph_key_info:
|
||||
name: client.admin
|
||||
cluster: "{{ cluster }}"
|
||||
output_format: plain
|
||||
state: info
|
||||
environment:
|
||||
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
||||
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
||||
register: _admin_key
|
||||
delegate_to: "{{ groups.get(mon_group_name)[0] }}"
|
||||
run_once: true
|
||||
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
||||
|
||||
- name: Copy ceph key(s) if needed
|
||||
ansible.builtin.copy:
|
||||
dest: "/etc/ceph/{{ cluster }}.client.admin.keyring"
|
||||
content: "{{ _admin_key.stdout + '\n' }}"
|
||||
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
mode: "{{ ceph_keyring_permissions }}"
|
||||
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
||||
Reference in New Issue
Block a user