mirror of https://github.com/ceph/ceph-ansible.git
client: implement proper pools creation
Just like we did for the monitor and openstack_config we now have the ability to precisely create pools. Signed-off-by: Sébastien Han <seb@redhat.com>pull/2450/head
parent
e302c1baae
commit
f119b25bbe
|
@ -14,9 +14,25 @@ dummy:
|
|||
#copy_admin_key: false
|
||||
|
||||
#user_config: false
|
||||
#test:
|
||||
# name: "test"
|
||||
# pg_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
# pgp_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
# rule_name: "replicated_rule"
|
||||
# type: "replicated"
|
||||
# erasure_profile: ""
|
||||
# size: ""
|
||||
#test2:
|
||||
# name: "test2"
|
||||
# pg_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
# pgp_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
# rule_name: "replicated_rule"
|
||||
# type: "replicated"
|
||||
# erasure_profile: ""
|
||||
# size: ""
|
||||
#pools:
|
||||
# - { name: test, pgs: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}" }
|
||||
# - { name: test2, pgs: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}" }
|
||||
# - "{{ test }}"
|
||||
# - "{{ test2 }}"
|
||||
|
||||
# Can add `mds_cap` attribute to override the default value which is '' for mds capabilities.
|
||||
# To have have ansible setfacl the generated key for $user, set the acls var like so:
|
||||
|
|
|
@ -6,9 +6,25 @@
|
|||
copy_admin_key: false
|
||||
|
||||
user_config: false
|
||||
test:
|
||||
name: "test"
|
||||
pg_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
pgp_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
rule_name: "replicated_rule"
|
||||
type: "replicated"
|
||||
erasure_profile: ""
|
||||
size: ""
|
||||
test2:
|
||||
name: "test2"
|
||||
pg_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
pgp_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
rule_name: "replicated_rule"
|
||||
type: "replicated"
|
||||
erasure_profile: ""
|
||||
size: ""
|
||||
pools:
|
||||
- { name: test, pgs: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}" }
|
||||
- { name: test2, pgs: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}" }
|
||||
- "{{ test }}"
|
||||
- "{{ test2 }}"
|
||||
|
||||
# Can add `mds_cap` attribute to override the default value which is '' for mds capabilities.
|
||||
# To have have ansible setfacl the generated key for $user, set the acls var like so:
|
||||
|
|
|
@ -45,11 +45,20 @@
|
|||
when:
|
||||
- copy_admin_key
|
||||
|
||||
- name: create pools
|
||||
command: "{{ docker_exec_client_cmd }} --cluster {{ cluster }} osd pool create {{ item.name }} {{ item.get('pgs', hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num']) }}"
|
||||
- name: create pool(s)
|
||||
command: >
|
||||
{{ docker_exec_client_cmd }} --cluster {{ cluster }}
|
||||
osd pool create {{ item.name }}
|
||||
{{ item.get('pg_num', hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num']) }}
|
||||
{{ item.pgp_num | default(item.pg_num) }}
|
||||
{{ item.rule_name | default("replicated_rule") }}
|
||||
{{ item.type | default("replicated") }}
|
||||
{%- if item.type | default("replicated") == 'erasure' and item.erasure_profile != '' %}
|
||||
{{ item.erasure_profile }}
|
||||
{%- endif %}
|
||||
{{ item.size | default('') }}
|
||||
with_items: "{{ pools }}"
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
when:
|
||||
- pools | length > 0
|
||||
- copy_admin_key
|
||||
|
|
|
@ -18,6 +18,25 @@ osd_scenario: non-collocated
|
|||
os_tuning_params:
|
||||
- { name: fs.file-max, value: 26234859 }
|
||||
user_config: True
|
||||
test:
|
||||
name: "test"
|
||||
pg_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
pgp_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
rule_name: "HDD"
|
||||
type: "replicated"
|
||||
erasure_profile: ""
|
||||
size: ""
|
||||
test2:
|
||||
name: "test2"
|
||||
pg_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
pgp_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
rule_name: "HDD"
|
||||
type: "replicated"
|
||||
erasure_profile: ""
|
||||
size: ""
|
||||
pools:
|
||||
- "{{ test }}"
|
||||
- "{{ test2 }}"
|
||||
ceph_conf_overrides:
|
||||
global:
|
||||
osd_pool_default_size: 1
|
||||
|
|
|
@ -28,6 +28,22 @@ ceph_conf_overrides:
|
|||
osd_pool_default_pg_num: 8
|
||||
osd_pool_default_size: 1
|
||||
user_config: True
|
||||
keys:
|
||||
- { name: client.test, key: "AQAin8tUoMPDGRAACcfAQHbq4eTuUoTCZdW1Uw==", mon_cap: "allow r", osd_cap: "allow class-read object_prefix rbd_children, allow rwx pool=test", mode: "0600", acls: [] }
|
||||
- { name: client.test2, key: "AQAin8tUAJkGGhAA8WZ8Lz5c7IkT8QZ5s7bI1A==", mon_cap: "allow r", osd_cap: "allow class-read object_prefix rbd_children, allow rwx pool=test2", mode: "0600", acls: [] }
|
||||
test:
|
||||
name: "test"
|
||||
pg_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
pgp_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
rule_name: "HDD"
|
||||
type: "replicated"
|
||||
erasure_profile: ""
|
||||
size: ""
|
||||
test2:
|
||||
name: "test2"
|
||||
pg_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
pgp_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
rule_name: "HDD"
|
||||
type: "replicated"
|
||||
erasure_profile: ""
|
||||
size: ""
|
||||
pools:
|
||||
- "{{ test }}"
|
||||
- "{{ test2 }}"
|
||||
|
|
|
@ -27,6 +27,22 @@ ceph_conf_overrides:
|
|||
global:
|
||||
osd_pool_default_size: 1
|
||||
user_config: True
|
||||
keys:
|
||||
- { name: client.test, key: "AQAin8tUoMPDGRAACcfAQHbq4eTuUoTCZdW1Uw==", mon_cap: "allow r", osd_cap: "allow class-read object_prefix rbd_children, allow rwx pool=test", mode: "0600", acls: [] }
|
||||
- { name: client.test2, key: "AQAin8tUAJkGGhAA8WZ8Lz5c7IkT8QZ5s7bI1A==", mon_cap: "allow r", osd_cap: "allow class-read object_prefix rbd_children, allow rwx pool=test2", mode: "0600", acls: [] }
|
||||
test:
|
||||
name: "test"
|
||||
pg_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
pgp_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
rule_name: "HDD"
|
||||
type: "replicated"
|
||||
erasure_profile: ""
|
||||
size: ""
|
||||
test2:
|
||||
name: "test2"
|
||||
pg_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
pgp_num: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}"
|
||||
rule_name: "HDD"
|
||||
type: "replicated"
|
||||
erasure_profile: ""
|
||||
size: ""
|
||||
pools:
|
||||
- "{{ test }}"
|
||||
- "{{ test2 }}"
|
||||
|
|
Loading…
Reference in New Issue