mirror of
https://github.com/ceph/ceph
synced 2025-01-20 18:21:57 +00:00
Merge PR #40602 into master
* refs/pull/40602/head: qa/tasks/cephadm: add apply() method/task Reviewed-by: Sebastian Wagner <swagner@suse.com>
This commit is contained in:
commit
3b391cbf7a
@ -1,5 +1,12 @@
|
||||
tasks:
|
||||
- cephadm.shell:
|
||||
host.a:
|
||||
- ceph orch apply rgw foo --port=8000 "--placement=count-per-host:4 *"
|
||||
- sleep 60
|
||||
- cephadm.apply:
|
||||
specs:
|
||||
- service_type: rgw
|
||||
service_id: foo
|
||||
placement:
|
||||
count_per_host: 4
|
||||
host_pattern: "*"
|
||||
spec:
|
||||
rgw_frontend_port: 8000
|
||||
- sleep:
|
||||
interval: 60
|
||||
|
@ -956,6 +956,38 @@ def shell(ctx, config):
|
||||
['bash', '-c', c],
|
||||
extra_cephadm_args=env)
|
||||
|
||||
def apply(ctx, config):
|
||||
"""
|
||||
Apply spec
|
||||
|
||||
tasks:
|
||||
- cephadm.apply:
|
||||
specs:
|
||||
- service_type: rgw
|
||||
service_id: foo
|
||||
spec:
|
||||
rgw_frontend_port: 8000
|
||||
- service_type: rgw
|
||||
service_id: bar
|
||||
spec:
|
||||
rgw_frontend_port: 9000
|
||||
zone: bar
|
||||
realm: asdf
|
||||
|
||||
"""
|
||||
cluster_name = config.get('cluster', 'ceph')
|
||||
|
||||
specs = config.get('specs', [])
|
||||
y = '\n---\n'.join(map(yaml.dump, specs))
|
||||
|
||||
log.info(f'Applying spec:\n{y}')
|
||||
_shell(
|
||||
ctx, cluster_name, ctx.ceph[cluster_name].bootstrap_remote,
|
||||
['ceph', 'orch', 'apply', '-i', '-'],
|
||||
stdin=y,
|
||||
)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def tweaked_option(ctx, config):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user