def command_bootstrap(ctx):
# type: (CephadmContext) -> int
- host: Optional[str] = None
-
if not ctx.output_config:
ctx.output_config = os.path.join(ctx.output_dir, 'ceph.conf')
if not ctx.output_keyring:
is_available(ctx, 'mgr epoch %d' % epoch, mgr_has_latest_epoch)
# ssh
- host = None
if not ctx.skip_ssh:
prepare_ssh(ctx, cli, wait_for_mgr_restart)
if 'hostname:' in line:
line = line.replace('\n', '')
split = line.split(': ')
- if split[1] != host:
+ if split[1] != hostname:
logger.info('Adding ssh key to %s' % split[1])
ssh_key = '/etc/ceph/ceph.pub'
if ctx.ssh_public_key:
ssh_key = ctx.ssh_public_key.name
- out, err, code = call_throws(ctx, ['ssh-copy-id', '-f', '-i', ssh_key, '%s@%s' % (ctx.ssh_user, split[1])])
+ out, err, code = call_throws(ctx, ['sudo', '-u', ctx.ssh_user, 'ssh-copy-id', '-f', '-i', ssh_key, '-o StrictHostKeyChecking=no', '%s@%s' % (ctx.ssh_user, split[1])])
mounts = {}
mounts[pathify(ctx.apply_spec)] = '/tmp/spec.yml:z'