mirror of https://github.com/ceph/ceph-ansible.git
ceph-iscsi: Update gateway config/template
- Remove gateway_keyring from the configuration file because it's
not used in ceph-iscsi 3.x release.
- Use config_template instead of template module for iscsi-gateway
configuration file. Because the file is an ini file and we might want
to override more parameters than those present in ceph-ansible.
- Because we can now set the pool name in the configuration, we should
use a variable for that. This is refact with the iscsi_pool_* variables
also used to configure the pool size.
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 1f2a4f1910
)
pull/4219/head
parent
1b6d8f9b45
commit
c040c34d97
|
@ -15,7 +15,9 @@ dummy:
|
|||
# Whether or not to generate secure certificate to iSCSI gateway nodes
|
||||
#generate_crt: False
|
||||
|
||||
#rbd_pool_size: "{{ osd_pool_default_size }}"
|
||||
#iscsi_conf_overrides: {}
|
||||
#iscsi_pool_name: rbd
|
||||
#iscsi_pool_size: "{{ osd_pool_default_size }}"
|
||||
|
||||
##################
|
||||
# RBD-TARGET-API #
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
# Whether or not to generate secure certificate to iSCSI gateway nodes
|
||||
generate_crt: False
|
||||
|
||||
rbd_pool_size: "{{ osd_pool_default_size }}"
|
||||
iscsi_conf_overrides: {}
|
||||
iscsi_pool_name: rbd
|
||||
iscsi_pool_size: "{{ osd_pool_default_size }}"
|
||||
|
||||
##################
|
||||
# RBD-TARGET-API #
|
||||
|
|
|
@ -9,9 +9,11 @@
|
|||
when: cephx | bool
|
||||
|
||||
- name: deploy gateway settings, used by the ceph_iscsi_config modules
|
||||
template:
|
||||
config_template:
|
||||
src: "{{ role_path }}/templates/iscsi-gateway.cfg.j2"
|
||||
dest: /etc/ceph/iscsi-gateway.cfg
|
||||
config_type: ini
|
||||
config_overrides: '{{ iscsi_conf_overrides }}'
|
||||
|
||||
- name: set_fact container_exec_cmd
|
||||
set_fact:
|
||||
|
@ -22,24 +24,24 @@
|
|||
- name: check if a rbd pool exists
|
||||
command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool ls --format json"
|
||||
changed_when: false
|
||||
register: rbd_pool_exists
|
||||
register: iscsi_pool_exists
|
||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||
|
||||
- name: rbd pool related tasks
|
||||
when: "'rbd' not in (rbd_pool_exists.stdout | from_json)"
|
||||
- name: iscsi pool related tasks
|
||||
when: "iscsi_pool_name not in (iscsi_pool_exists.stdout | from_json)"
|
||||
block:
|
||||
- name: create a rbd pool if it doesn't exist
|
||||
command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool create rbd {{ osd_pool_default_pg_num }}"
|
||||
- name: create a iscsi pool if it doesn't exist
|
||||
command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool create {{ iscsi_pool_name }} {{ osd_pool_default_pg_num }}"
|
||||
changed_when: false
|
||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||
|
||||
- name: assign application rbd to pool 'rbd'
|
||||
command: "{{ container_exec_cmd }} ceph --connect-timeout 5 --cluster {{ cluster }} osd pool application enable rbd rbd"
|
||||
- name: assign application rbd to iscsi pool
|
||||
command: "{{ container_exec_cmd }} ceph --connect-timeout 5 --cluster {{ cluster }} osd pool application enable {{ iscsi_pool_name }} rbd"
|
||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||
run_once: True
|
||||
|
||||
- name: customize pool size
|
||||
command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool set rbd size {{ rbd_pool_size | default(osd_pool_default_size) }}"
|
||||
command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool set {{ iscsi_pool_name }} size {{ iscsi_pool_size | default(osd_pool_default_size) }}"
|
||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||
changed_when: false
|
||||
when: rbd_pool_size | default(osd_pool_default_size) != ceph_osd_pool_default_size
|
||||
when: iscsi_pool_size | default(osd_pool_default_size) != ceph_osd_pool_default_size
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
[config]
|
||||
cluster_name = {{ cluster }}
|
||||
gateway_keyring = {{ cluster }}.client.admin.keyring
|
||||
|
||||
# API settings.
|
||||
# The API supports a number of options that allow you to tailor it to your
|
||||
|
|
Loading…
Reference in New Issue