2015-01-30 20:34:35 +08:00
|
|
|
---
|
2018-10-01 23:11:13 +08:00
|
|
|
- name: pool related tasks
|
|
|
|
block:
|
|
|
|
- name: create openstack pool(s)
|
2020-04-29 00:08:59 +08:00
|
|
|
ceph_pool:
|
|
|
|
name: "{{ item.name }}"
|
|
|
|
cluster: "{{ cluster }}"
|
2020-09-29 05:27:47 +08:00
|
|
|
pg_num: "{{ item.pg_num | default(omit) }}"
|
|
|
|
pgp_num: "{{ item.pgp_num | default(omit) }}"
|
2020-09-11 16:29:28 +08:00
|
|
|
size: "{{ item.size | default(omit) }}"
|
|
|
|
min_size: "{{ item.min_size | default(omit) }}"
|
2020-04-29 00:08:59 +08:00
|
|
|
pool_type: "{{ item.type | default('replicated') }}"
|
2020-09-11 16:29:28 +08:00
|
|
|
rule_name: "{{ item.rule_name | default(omit) }}"
|
2020-04-29 00:08:59 +08:00
|
|
|
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) }}"
|
|
|
|
with_items: "{{ openstack_pools }}"
|
2018-10-01 23:11:13 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2020-04-29 00:08:59 +08:00
|
|
|
environment:
|
2020-09-26 00:15:02 +08:00
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
2020-04-29 00:08:59 +08:00
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
2018-02-09 22:12:35 +08:00
|
|
|
|
2018-04-04 22:22:36 +08:00
|
|
|
- name: create openstack cephx key(s)
|
2019-09-23 19:30:05 +08:00
|
|
|
block:
|
|
|
|
- name: generate keys
|
|
|
|
ceph_key:
|
|
|
|
name: "{{ item.name }}"
|
|
|
|
caps: "{{ item.caps }}"
|
|
|
|
secret: "{{ item.key | default('') }}"
|
|
|
|
cluster: "{{ cluster }}"
|
2020-11-02 22:56:28 +08:00
|
|
|
mode: "{{ item.mode | default(ceph_keyring_permissions) }}"
|
2019-09-23 19:30:05 +08:00
|
|
|
environment:
|
2020-09-26 00:15:02 +08:00
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
2019-09-23 19:30:05 +08:00
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
|
|
|
with_items: "{{ openstack_keys }}"
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2021-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
2017-06-23 18:35:39 +08:00
|
|
|
|
2019-09-23 19:30:05 +08:00
|
|
|
- name: get keys from monitors
|
2020-10-24 03:19:53 +08:00
|
|
|
ceph_key:
|
|
|
|
name: "{{ item.name }}"
|
|
|
|
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 }}"
|
2019-09-23 19:30:05 +08:00
|
|
|
register: _osp_keys
|
|
|
|
with_items: "{{ openstack_keys }}"
|
|
|
|
delegate_to: "{{ groups.get(mon_group_name)[0] }}"
|
2021-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
2017-07-19 05:11:55 +08:00
|
|
|
|
2019-09-23 19:30:05 +08:00
|
|
|
- name: copy ceph key(s) if needed
|
|
|
|
copy:
|
|
|
|
dest: "/etc/ceph/{{ cluster }}.{{ item.0.item.name }}.keyring"
|
|
|
|
content: "{{ item.0.stdout + '\n' }}"
|
2020-09-26 00:15:02 +08:00
|
|
|
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
|
|
|
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
2020-08-10 17:52:56 +08:00
|
|
|
mode: "{{ item.0.item.mode | default(ceph_keyring_permissions) }}"
|
2019-09-23 19:30:05 +08:00
|
|
|
with_nested:
|
|
|
|
- "{{ _osp_keys.results }}"
|
|
|
|
- "{{ groups[mon_group_name] }}"
|
|
|
|
delegate_to: "{{ item.1 }}"
|
2021-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
2017-07-19 05:11:55 +08:00
|
|
|
when:
|
2019-05-22 16:02:42 +08:00
|
|
|
- cephx | bool
|
|
|
|
- openstack_config | bool
|