blob: b5e0ec98f3239c91e0fecd0be3c1876f71212a56 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
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
|