Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cephadm: allow users to provide their dashboard cert during bootstrap #33472

Merged
merged 1 commit into from Feb 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 21 additions & 2 deletions src/cephadm/cephadm
Expand Up @@ -1979,8 +1979,19 @@ def command_bootstrap():
return 'dashboard' in out
is_available('Dashboard', is_dashboard_available)()

logger.info('Generating a dashboard self-signed certificate...')
cli(['dashboard', 'create-self-signed-cert'])


# dashboard crt and key
if args.dashboard_key and args.dashboard_crt:
logger.info('Using provided dashboard certificate...')
mounts = {}
mounts[pathify(args.dashboard_crt)] = '/tmp/dashboard.crt:z'
mounts[pathify(args.dashboard_key)] = '/tmp/dashboard.key:z'
cli(['dashboard', 'set-ssl-certificate', '-i', '/tmp/dashboard.crt'], extra_mounts=mounts)
cli(['dashboard', 'set-ssl-certificate-key', '-i', '/tmp/dashboard.key'], extra_mounts=mounts)
else:
logger.info('Generating a dashboard self-signed certificate...')
cli(['dashboard', 'create-self-signed-cert'])

logger.info('Creating initial admin user...')
password = args.initial_dashboard_password or generate_password()
Expand Down Expand Up @@ -3240,6 +3251,14 @@ def _get_parser():
parser_bootstrap.add_argument(
'--initial-dashboard-password',
help='Initial password for the initial dashboard user')

parser_bootstrap.add_argument(
'--dashboard-key',
help='Dashboard key')
parser_bootstrap.add_argument(
'--dashboard-crt',
help='Dashboard certificate')

parser_bootstrap.add_argument(
'--skip-dashboard',
action='store_true',
Expand Down