the next stable release will drop this feature.
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
#container_binary:
-############
-# KV store #
-############
-#containerized_deployment_with_kv: false
-#mon_containerized_default_ceph_conf_with_kv: false
-#kv_type: etcd
-#kv_endpoint: 127.0.0.1
-#kv_port: 2379
-
# this is only here for usage with the rolling_update.yml playbook
# do not ever change this here
#container_binary:
-############
-# KV store #
-############
-#containerized_deployment_with_kv: false
-#mon_containerized_default_ceph_conf_with_kv: false
-#kv_type: etcd
-#kv_endpoint: 127.0.0.1
-#kv_port: 2379
-
# this is only here for usage with the rolling_update.yml playbook
# do not ever change this here
when:
- not containerized_deployment|bool
-# ceph-container-common
-# only create fetch directory when:
-# we are not populating kv_store with default ceph.conf AND host is a mon
-# OR
-# we are not population kv_store with default ceph.conf AND there at least 1 nfs in nfs group AND host is the first nfs
- block:
- name: create a local fetch directory if it does not exist
file:
run_once: true
when:
- (cephx or generate_fsid)
- - (not mon_containerized_default_ceph_conf_with_kv and
- (inventory_hostname in groups.get(mon_group_name, []))) or
- (not mon_containerized_default_ceph_conf_with_kv and
- ((groups.get(nfs_group_name, []) | length > 0)
- and (inventory_hostname == groups.get(nfs_group_name, [])[0])))
+ - ((inventory_hostname in groups.get(mon_group_name, [])) or
+ (groups.get(nfs_group_name, []) | length > 0) and inventory_hostname == groups.get(nfs_group_name, [])[0])
- name: generate cluster uuid
shell: python -c 'import uuid; print(str(uuid.uuid4()))' | tee {{ fetch_directory }}/ceph_cluster_uuid.conf
- name: include checks.yml
include_tasks: checks.yml
when:
- - (not containerized_deployment_with_kv and
- ((inventory_hostname in groups.get(mon_group_name, [])) or
- (inventory_hostname in groups.get(nfs_group_name, [])) or
- (inventory_hostname in groups.get(osd_group_name, []))))
+ - (inventory_hostname in groups.get(mon_group_name, []) or
+ inventory_hostname in groups.get(nfs_group_name, []) or
+ inventory_hostname in groups.get(osd_group_name, []))
- not ceph_current_status.get('rc', 1) == 0
- not rolling_update | default(false)
container_binary:
-############
-# KV store #
-############
-containerized_deployment_with_kv: false
-mon_containerized_default_ceph_conf_with_kv: false
-kv_type: etcd
-kv_endpoint: 127.0.0.1
-kv_port: 2379
-
# this is only here for usage with the rolling_update.yml playbook
# do not ever change this here
{% else -%}
--cpu-quota={{ ceph_mds_docker_cpu_limit * 100000 }} \
{% endif -%}
- {% if not containerized_deployment_with_kv -%}
-v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \
-v /var/run/ceph:/var/run/ceph:z \
- {% else -%}
- -e KV_TYPE={{kv_type}} \
- -e KV_IP={{kv_endpoint}} \
- -e KV_PORT={{kv_port}} \
- {% endif -%}
-v /etc/localtime:/etc/localtime:ro \
-e CLUSTER={{ cluster }} \
-e CEPH_DAEMON=MDS \
{% else -%}
--cpu-quota={{ ceph_mgr_docker_cpu_limit * 100000 }} \
{% endif -%}
- {% if not containerized_deployment_with_kv -%}
-v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \
-v /var/run/ceph:/var/run/ceph:z \
- {% else -%}
- -e KV_TYPE={{kv_type}} \
- -e KV_IP={{kv_endpoint}} \
- -e KV_PORT={{kv_port}} \
- {% endif -%}
-v /etc/localtime:/etc/localtime:ro \
-e CLUSTER={{ cluster }} \
-e CEPH_DAEMON=MGR \
- cephx
- ansible_version.major == 2 and ansible_version.minor < 4
-- name: test if initial mon keyring is in mon kv store
- command: ceph --cluster {{ cluster }} config-key get initial_mon_keyring
- changed_when: false
- ignore_errors: true
- check_mode: no
- run_once: true
- failed_when: false
- register: is_initial_mon_keyring_in_kv
-
-- name: put initial mon keyring in mon kv store
- command: ceph --cluster {{ cluster }} config-key put initial_mon_keyring {{ monitor_keyring.stdout }}
- changed_when: false
- check_mode: no
- run_once: true
- when:
- - is_initial_mon_keyring_in_kv.rc != 0
- - cephx
-
- name: create ceph mgr keyring(s) when mon is not containerized
ceph_key:
name: "mgr.{{ hostvars[item]['ansible_hostname'] }}"
---
- name: include copy_configs.yml
include_tasks: copy_configs.yml
- when: not containerized_deployment_with_kv
- name: include start_docker_monitor.yml
include_tasks: start_docker_monitor.yml
command: "{{ docker_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint {{ _current_monitor_address }}"
changed_when: false
failed_when: false
- when:
- - not containerized_deployment_with_kv
- name: include fetch_configs.yml
include_tasks: fetch_configs.yml
run_once: true
- when: not containerized_deployment_with_kv
- block:
- name: create ceph mgr keyring(s) when mon is containerized
- cephx
- containerized_deployment
- groups.get(mgr_group_name, []) | length > 0
- - not containerized_deployment_with_kv
with_items: "{{ groups.get(mgr_group_name, []) }}"
- name: fetch ceph mgr key(s)
---
-- name: populate kv_store with default ceph.conf
- docker_container:
- name: populate-kv-store
- image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
- command: populate_kvstore
- network: host
- env:
- KV_TYPE: "{{kv_type}}"
- KV_IP: "{{kv_endpoint}}"
- KV_PORT: "{{kv_port}}"
- run_once: true
- when:
- - inventory_hostname == groups[mon_group_name][0]
- - containerized_deployment_with_kv
- - mon_containerized_default_ceph_conf_with_kv
-
-- name: populate kv_store with custom ceph.conf
- docker_container:
- name: populate-kv-store
- image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
- command: populate_kvstore
- network: host
- env:
- KV_TYPE: "{{kv_type}}"
- KV_IP: "{{kv_endpoint}}"
- KV_PORT: "{{kv_port}}"
- volumes:
- - /etc/ceph/"{{ cluster }}".conf:/etc/ceph/ceph.defaults
- run_once: true
- when:
- - inventory_hostname == groups[mon_group_name][0]
- - containerized_deployment_with_kv
- - not mon_containerized_default_ceph_conf_with_kv
-
-- name: delete populate-kv-store docker
- docker_container:
- name: populate-kv-store
- state: absent
- image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
- when: containerized_deployment_with_kv
-
- name: generate systemd unit file
become: true
template:
{% else -%}
--cpu-quota={{ ceph_mon_docker_cpu_limit * 100000 }} \
{% endif -%}
-{% if not containerized_deployment_with_kv -%}
-v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \
-v /var/run/ceph:/var/run/ceph:z \
-{% else -%}
- -e KV_TYPE={{kv_type}} \
- -e KV_IP={{kv_endpoint}}\
- -e KV_PORT={{kv_port}} \
-{% endif -%}
-v /etc/localtime:/etc/localtime:ro \
{% if mon_docker_privileged -%}
--privileged \
ExecStartPre=-/usr/bin/{{ container_binary }} rm ceph-nfs-%i
ExecStartPre=/usr/bin/mkdir -p /etc/ceph /etc/ganesha /var/lib/nfs/ganesha
ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
- {% if not containerized_deployment_with_kv -%}
-v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \
-v /var/lib/nfs/ganesha:/var/lib/nfs/ganesha:z \
--privileged \
-v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket \
{% endif -%}
- {% else -%}
- -e KV_TYPE={{kv_type}} \
- -e KV_IP={{kv_endpoint}}\
- -e KV_PORT={{kv_port}} \
- {% endif -%}
-v /etc/localtime:/etc/localtime:ro \
-e CLUSTER={{ cluster }} \
-e CEPH_DAEMON=NFS \
- dmcrypt
- not containerized_deployment
-- name: set_fact docker_env_args '-e KV_TYPE={{ kv_type }} -e KV_IP={{ kv_endpoint }} -e KV_PORT={{ kv_port }}'
- set_fact:
- docker_env_args: -e KV_TYPE={{ kv_type }} -e KV_IP={{ kv_endpoint }} -e KV_PORT={{ kv_port }}
- when:
- - containerized_deployment_with_kv
-
- name: set_fact docker_env_args '-e OSD_BLUESTORE=0 -e OSD_FILESTORE=1 -e OSD_DMCRYPT=0'
set_fact:
docker_env_args: -e OSD_BLUESTORE=0 -e OSD_FILESTORE=1 -e OSD_DMCRYPT=0
{% if ansible_distribution == 'Ubuntu' -%}
--security-opt apparmor:unconfined \
{% endif -%}
- {% if containerized_deployment_with_kv -%}
- -e KV_TYPE={{ kv_type }} \
- -e KV_IP={{ kv_endpoint }} \
- -e KV_PORT={{ kv_port }} \
- {% endif -%}
{% if osd_objectstore == 'filestore' and not dmcrypt -%}
-e OSD_FILESTORE=1 \
-e OSD_DMCRYPT=0 \
{% else -%}
--cpu-quota={{ ceph_rbd_mirror_docker_cpu_limit * 100000 }} \
{% endif -%}
- {% if not containerized_deployment_with_kv -%}
-v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \
-v /var/run/ceph:/var/run/ceph:z \
- {% else -%}
- -e KV_TYPE={{kv_type}} \
- -e KV_IP={{kv_endpoint}} \
- -e KV_PORT={{kv_port}} \
- {% endif -%}
-v /etc/localtime:/etc/localtime:ro \
-e CLUSTER={{ cluster }} \
-e CEPH_DAEMON=RBD_MIRROR \
{% else -%}
--cpu-quota={{ ceph_rgw_docker_cpu_limit * 100000 }} \
{% endif -%}
- {% if not containerized_deployment_with_kv -%}
-v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \
-v /var/run/ceph:/var/run/ceph:z \
- {% else -%}
- -e KV_TYPE={{ kv_type }} \
- -e KV_IP={{ kv_endpoint }} \
- -e KV_PORT={{ kv_port }} \
- {% endif -%}
-v /etc/localtime:/etc/localtime:ro \
-e CEPH_DAEMON=RGW \
-e CLUSTER={{ cluster }} \