ceph

Role Documentation

Welcome to the “ceph” role documentation.

Role Defaults

This section highlights all of the defaults and variables set within the “ceph” role.

ceph_ansible_repo: centos-ceph-nautilus
fail_on_ceph_health_err: false
fail_without_ceph_ansible: false
fail_without_deps: false
osd_percentage_min: 0

Molecule Scenarios

Molecule is being used to test the “ceph” role. The following section highlights the drivers in service and provides an example playbook showing how the role is leveraged.

Scenario: default

Example default configuration
driver:
  name: docker
lint:
  enabled: false
log: true
platforms:
- easy_install:
  - pip
  environment:
    http_proxy: '{{ lookup(''env'', ''http_proxy'') }}'
    https_proxy: '{{ lookup(''env'', ''https_proxy'') }}'
  hostname: centos7
  image: centos:7
  name: centos7
  pkg_extras: python-setuptools python-enum34 python-netaddr ruby epel-release PyYAML
- environment:
    http_proxy: '{{ lookup(''env'', ''http_proxy'') }}'
    https_proxy: '{{ lookup(''env'', ''https_proxy'') }}'
  hostname: fedora28
  image: fedora:28
  name: fedora28
  pkg_extras: python*-setuptools python*-enum python*-netaddr ruby PyYAML
provisioner:
  env:
    ANSIBLE_LIBRARY: ../../../../library
    ANSIBLE_STDOUT_CALLBACK: yaml
  log: true
  name: ansible
scenario:
  test_sequence:
  - destroy
  - create
  - prepare
  - converge
  - verify
  - destroy
verifier:
  lint:
    name: flake8
  name: testinfra
Example default playbook
- gather_facts: false
  hosts: all
  name: Converge
  tasks:
  - debug:
      msg: No "main" to run, nothing to do
    name: Nothing to do

Scenario: ceph-ansible-installed

Example ceph-ansible-installed configuration
driver:
  name: docker
lint:
  enabled: false
log: true
platforms:
- easy_install:
  - pip
  environment:
    http_proxy: '{{ lookup(''env'', ''http_proxy'') }}'
    https_proxy: '{{ lookup(''env'', ''https_proxy'') }}'
  hostname: centos7
  image: centos:7
  name: centos7
  pkg_extras: python-setuptools python-enum34 python-netaddr ruby epel-release PyYAML
- environment:
    http_proxy: '{{ lookup(''env'', ''http_proxy'') }}'
    https_proxy: '{{ lookup(''env'', ''https_proxy'') }}'
  hostname: fedora28
  image: fedora:28
  name: fedora28
  pkg_extras: python*-setuptools python*-enum python*-netaddr ruby PyYAML
provisioner:
  env:
    ANSIBLE_LIBRARY: ../../../../library
    ANSIBLE_STDOUT_CALLBACK: yaml
  log: true
  name: ansible
scenario:
  name: ceph-ansible-installed
  test_sequence:
  - destroy
  - create
  - prepare
  - converge
  - verify
  - destroy
verifier:
  lint:
    name: flake8
  name: testinfra
Example ceph-ansible-installed playbook
- gather_facts: false
  hosts: all
  name: Converge
  tasks:
  - include_role:
      name: ceph
      tasks_from: ceph-ansible-installed
    name: Ensure we do not fail with default behavior
  - block:
    - include_role:
        name: ceph
        tasks_from: ceph-ansible-installed
      name: Run validation
      vars:
        fail_without_ceph_ansible: true
    name: Ensure we fail if ceph-ansible is absent
    rescue:
    - meta: clear_host_errors
      name: Clear host errors
    - debug:
        msg: 'Properly detected missing package

          '
      name: Test output
  - name: install ceph-ansible
    package:
      name: ceph-ansible
      state: present
  - include_role:
      name: ceph
      tasks_from: ceph-ansible-installed
    name: Re-run the validation with ceph-ansible installed
  - block:
    - include_role:
        name: ceph
        tasks_from: ceph-ansible-installed
      name: Enforce failure in case of wrong repo
      vars:
        fail_without_ceph_ansible: true
    name: Re-run the validation with ceph-ansible installed and fail due to wrong
      repo
    rescue:
    - meta: clear_host_errors
      name: Clear host errors
    - debug:
        msg: 'Properly detected wrong repository

          '
      name: Test output