roles: - - host.a - mon.a - mgr.a - osd.0 - - host.b - mon.b - mgr.b - osd.1 tasks: - install: - cephadm: - exec: all-hosts: - mkdir /etc/cephadm_testing - cephadm.apply: specs: - service_type: mon placement: host_pattern: '*' extra_container_args: - "--cpus=2" extra_entrypoint_args: - "--debug_ms 10" - service_type: container service_id: foo placement: host_pattern: '*' spec: image: "quay.io/fedora/fedora:latest" entrypoint: "bash" extra_container_args: - "-v" - "/etc/cephadm_testing:/root/cephadm_testing" extra_entrypoint_args: - "/root/write_thing_to_file.sh" - "-c" - "testing_custom_containers" - "-o" - "/root/cephadm_testing/testing.txt" custom_configs: - mount_path: "/root/write_thing_to_file.sh" content: | while getopts "o:c:" opt; do case ${opt} in o ) OUT_FILE=${OPTARG} ;; c ) CONTENT=${OPTARG} esac done echo $CONTENT > $OUT_FILE sleep infinity - cephadm.wait_for_service: service: mon - cephadm.wait_for_service: service: container.foo - exec: host.a: - | set -ex FSID=$(/home/ubuntu/cephtest/cephadm shell -- ceph fsid) sleep 60 # check extra container and entrypoint args written to mon unit run file grep "\-\-cpus=2" /var/lib/ceph/$FSID/mon.*/unit.run grep "\-\-debug_ms 10" /var/lib/ceph/$FSID/mon.*/unit.run # check that custom container properly wrote content to file. # This requires the custom config, extra container args, and # entrypoint args to all be working in order for this to have # been written. The container entrypoint was set up with custom_configs, # the content and where to write to with the entrypoint args, and the mounting # of the /etc/cephadm_testing dir with extra container args grep "testing_custom_containers" /etc/cephadm_testing/testing.txt