Useful for softwares that do data collection/monitoring like collectd.
They can connect to the socket and then retrieve information.
Even though the sockets are exposed now, I'm keeping the docker exec to
check the socket, this will allow newer version of ceph-ansible to work
with older versions.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1563280
Signed-off-by: Sébastien Han <seb@redhat.com>
file:
path: "{{ item }}"
state: directory
- owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
- group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+ owner: "{{ ceph_uid }}"
+ group: "{{ ceph_uid }}"
mode: 0755
with_items: "{{ ceph_directories }}"
}
wait_for_socket_in_docker() {
+ osd_mount_point=$(docker exec "$1" df --output=target | grep '/var/lib/ceph/osd/')
+ whoami=$(docker exec "$1" cat $osd_mount_point/whoami)
if ! docker exec "$1" timeout 10 bash -c "while [ ! -e /var/run/ceph/*.asok ]; do sleep 1 ; done"; then
echo "Timed out while trying to look for a Ceph OSD socket."
echo "Abort mission!"
{% if containerized_deployment -%}
id=$(get_dev_name "$unit")
container_id=$(get_docker_id_from_dev_name "$id")
- osd_id=$(get_docker_osd_id "$container_id")
+ wait_for_socket_in_docker "$container_id"
+ osd_id=$whoami
docker_exec="docker exec $container_id"
{% else %}
osd_id=$(echo ${unit#ceph-osd@} | grep -oE '[0-9]{1,2}')
{% 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}} \
owner: "{{ bootstrap_dirs_owner }}"
group: "{{ bootstrap_dirs_group }}"
mode: "0600"
- when: cephx
\ No newline at end of file
+ when: cephx
{% 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}} \
- "{{ statconfig.results }}"
when:
- item.1.stat.exists == true
- - not (item.0 | search("keyring"))
\ No newline at end of file
+ - not (item.0 | search("keyring"))
{% 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}}\
{% 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 \
- -v /etc/ganesha:/etc/ganesha \
+ -v /var/lib/nfs/ganesha:/var/lib/nfs/ganesha:z \
+ -v /etc/ganesha:/etc/ganesha:z \
+ -v /var/run/ceph:/var/run/ceph:z \
{% if ceph_nfs_dynamic_exports %}
--privileged \
-v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket \
group: root
mode: 0644
changed_when: false
- with_items: "{{ ceph_config_keys }}"
\ No newline at end of file
+ with_items: "{{ ceph_config_keys }}"
-v /etc/localtime:/etc/localtime:ro \
-v /var/lib/ceph:/var/lib/ceph:z \
-v /etc/ceph:/etc/ceph:z \
+ -v /var/run/ceph:/var/run/ceph:z \
$DOCKER_ENV \
{% if ansible_distribution == 'Ubuntu' -%}
--security-opt apparmor:unconfined \
- "{{ statconfig.results }}"
when:
- not item.1.get('skipped')
- - item.1.stat.exists == true
\ No newline at end of file
+ - item.1.stat.exists == true
{% 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}} \
- "{{ ceph_config_keys }}"
- "{{ statconfig.results }}"
when:
- - item.1.stat.exists == true
\ No newline at end of file
+ - item.1.stat.exists == true
- "{{ ceph_config_keys }}"
- "{{ statconfig.results }}"
when:
- - item.1.stat.exists == true
\ No newline at end of file
+ - item.1.stat.exists == true
{% 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 }} \