ceph.ceph_admin.bootstrap module

Module that allows QE to interface with cephadm bootstrap CLI.

class ceph.ceph_admin.bootstrap.BootstrapMixin

Bases: object

Add bootstrap support to the child class.

bootstrap(config: Dict)

Execute cephadm bootstrap with the passed kwargs on the installer node.:

Bootstrap involves,
  - Creates /etc/ceph directory with permissions
  - CLI creation with bootstrap options with custom/default image
  - Execution of bootstrap command
Parameters

config (Dict) – Key/value pairs passed from the test case.

Example:

config:
    command: bootstrap
    base_cmd_args:
        verbose: true
    args:
        custom_repo: custom repository path
        custom_image: <image path> or <boolean>
        mon-ip: <node_name>
        mgr-id: <mgr_id>
        fsid: <id>
        registry-url: <registry.url.name>
        registry-json: <registry.url.name>
        initial-dashboard-user: <admin123>
        initial-dashboard-password: <admin123>

custom_image:

image path: compose path for example alpha build,
    ftp://partners.redhat.com/d960e6f2052ade028fa16dfc24a827f5/rhel-8/Tools/x86_64/os/

boolean:
    True: use latest image from test config
    False: do not use latest image from test config,
            and also indicates usage of default image from cephadm source-code.
ceph.ceph_admin.bootstrap.construct_registry(cls, registry: str, json_file: bool = False)

Construct registry credentials for bootstrapping cluster

Parameters
  • cls (CephAdmin) – class object

  • registry (Str) – registry name

  • json_file (Bool) – registry credentials in JSON file (default:False)

Example:

json_file:
    - False : Constructs registry credentials for bootstrap
    - True  : Creates file with registry name attached with it,
              and saved as /tmp/<registry>.json file.
Returns

constructed string of registry credentials ( Str )

ceph.ceph_admin.bootstrap.copy_ceph_configuration_files(cls, ceph_conf_args)

Copy ceph configuration files to ceph default “/etc/ceph” path.

Parameters
  • cls (CephAdmin) – cephadm instance

  • ceph_conf_args (Dict) – bootstrap arguments

Example:

ceph_conf_args:
    output-dir: "/root/ceph"
    output-keyring : "/root/ceph/ceph.client.admin.keyring"
    output-config : "/root/ceph/ceph.conf"
    output-pub-ssh-key : "/root/ceph/ceph.pub"
    ssh-public-key : "/root/ceph/ceph.pub"
Note

we can eliminate this definition when we have support to access ceph cli via custom ceph config files.

ceph.ceph_admin.bootstrap.generate_ssl_certificate(cls, dashboard_key, dashboard_crt)

Construct dashboard key and certificate files for bootstrapping cluster with dashboard custom key and certificate files for ssl

Parameters
  • cls (CephAdmin) – class object

  • dashboard_key (Str) – path to generate ssl key

  • dashboard_crt (Str) – path to generate ssl certificate

Returns

constructed string of SSL CLI option (Str)