Module - ceph_spec_bootstrap

This module provides for the following ansible plugin:

  • ceph_spec_bootstrap

Module Documentation

The ceph_spec_bootstrap module uses information from both the composed services in TripleO roles and the deployed hosts file ('openstack overcloud node provision' output), or just the inventory file (tripleo-ansible-inventory output) to determine what Ceph services should run on what hosts and generate a valid Ceph spec. This allows the desired end state defined in TripleO to be translated into an end state defined in Ceph orchestrator. The intention is to use this module when bootstraping a new Ceph cluster.

Options

deployed_metalsmith

The absolute path to a file like deployed_metal.yaml, as genereated by 'openstack overcloud node provision --output deployed_metal.yaml'. This file is used to map which ceph_service_types map to which deployed hosts. Use this option if you have deployed servers with metalsmith but do not yet have an inventory genereated from the overcloud in Heat. Either tripleo_ansible_inventory xor deployed_metalsmith must be used (not both) unless the method option is used.

tripleo_ansible_inventory

The absolute path to an Ansible inventory genereated by running the tripleo-ansible-inventory command. This file is used to map which ceph_service_types map to which deployed hosts. Use this option if you already have an inventory genereated from the overcloud in Heat. Either tripleo_ansible_inventory xor deployed_metalsmith must be used (not both) unless the method option is used.

new_ceph_spec

The absolute path to a new file which will be created by the module and contain the resultant Ceph specification. If not provided, defaults to /home/stack/ceph_spec.yaml.

ceph_service_types

List of Ceph services being deployed on overcloud. All service names must be a valid service_type as described in the Ceph Orchestrator CLI service spec documentation. If not provided, defaults to ['mon', 'mgr', 'osd'], which are presently the only supported service types this module supports.

tripleo_roles

The absolute path to the TripleO roles file. Only necessary if deployed_metalsmith is used. If not provided then defaults to /usr/share/openstack-tripleo-heat-templates/roles_data.yaml. This file is used to map which ceph_service_types map to which roles. E.g. all roles with OS::TripleO::Services::CephOSD will get the Ceph service_type 'osd'. This paramter is ignored if tripleo_ansible_inventory is used.

osd_spec

A valid osd service specification. If not passed defaults to using all available data devices (data_devices all true).

fqdn

When true, the "hostname" and "hosts" in the generated Ceph spec will have their fully qualified domain name. This paramter defaults to false and only has an effect when tripleo_ansible_inventory is used.

crush_hierarchy

The crush hierarchy, expressed as a dict, maps the relevant OSD nodes to a user defined crush hierarchy.

standalone

Create a spec file for a standalone deployment. Used for single server development or testing environments.

mon_ip

The desired IP address of the first Ceph monitor. Required when standalone is true, otherwise ignored.

method

Whether the deployed_metalsmith file or tripleo_ansible_inventory file should be used to build the spec if both of these parameters are passed. When "both" is used the roles, services and hosts are determined from deployed_metalsmith and tripleo_roles parameters but the IPs come from the tripleo_ansible_inventory parameter.

Authors

John Fulton (fultonj)

Example Tasks

- name: make spec from 'openstack overcloud node provision' output
  ceph_spec_bootstrap:
    new_ceph_spec: '{{ playbook_dir }}/ceph_spec.yaml'
    deployed_metalsmith: ~/overcloud-baremetal-deployed.yaml
- name: make spec from tripleo-ansible-inventory output
  ceph_spec_bootstrap:
    new_ceph_spec: '{{ playbook_dir }}/ceph_spec.yaml'
    tripleo_ansible_inventory: ~/config-download/overcloud/tripleo-ansible-inventory.yaml
- name: make spec from deployed_metalsmith; use inventory not DeployedSeverPortMap
    for IPs
  ceph_spec_bootstrap:
    new_ceph_spec: '{{ playbook_dir }}/ceph_spec.yaml'
    tripleo_ansible_inventory: ~/config-download/overcloud/tripleo-ansible-inventory.yaml
    deployed_metalsmith: ~/overcloud-baremetal-deployed.yaml
    method: both
- name: make spec from inventory with FQDNs and custom osd_spec
  ceph_spec_bootstrap:
    new_ceph_spec: '{{ playbook_dir }}/ceph_spec.yaml'
    tripleo_ansible_inventory: ~/config-download/overcloud/tripleo-ansible-inventory.yaml
    crush_hierarchy:
      ceph_osd-0:
        rack: r1
      ceph_osd-1:
        rack: r1
      ceph_osd-2:
        rack: r1
    fqdn: true
    osd_spec:
      data_devices:
        paths:
        - /dev/ceph_vg/ceph_lv_data
- name: make spec with only Ceph mons and managers
  ceph_spec_bootstrap:
    new_ceph_spec: '{{ playbook_dir }}/ceph_spec.yaml'
    deployed_metalsmith: ~/overcloud-baremetal-deployed.yaml
    ceph_service_types:
    - mon
    - mgr
- name: make spec with composed roles/ HDDs for data/ SSDs for db
  ceph_spec_bootstrap:
    new_ceph_spec: '{{ playbook_dir }}/ceph_spec.yaml'
    deployed_metalsmith: ~/overcloud-baremetal-deployed.yaml
    tripleo_roles: ~/templates/custom_roles_data.yaml
    osd_spec:
      data_devices:
        rotational: 1
      db_devices:
        rotational: 0
- name: Create Ceph spec for standalone deployment
  ceph_spec_bootstrap:
    new_ceph_spec: '{{ playbook_dir }}/ceph_spec.yaml'
    mon_ip: '{{ tripleo_cephadm_first_mon_ip }}'
    standalone: true