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.

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

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: ceph-ansible-installed

Driver: podman:
Molecule Platform(s)
- name: centos
  hostname: centos
  image: centos/centos:stream8
  registry:
    url: quay.io
  dockerfile: ../../../../.config/molecule/Dockerfile
  pkg_extras: python*-setuptools python*-pyyaml
  volumes:
  - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
  privileged: true
  environment:
    http_proxy: "{{ lookup('env', 'http_proxy') }}"
    https_proxy: "{{ lookup('env', 'https_proxy') }}"
  ulimits:
  - host
Molecule Inventory
hosts:
  all:
    hosts:
      centos:
        ansible_python_interpreter: /usr/bin/python3
Example ceph-ansible-installed playbook
- name: Converge
  hosts: all
  gather_facts: false

  tasks:
  - name: Ensure we do not fail with default behavior
    include_role:
      name: ceph
      tasks_from: ceph-ansible-installed

  - name: Ensure we fail if ceph-ansible is absent
    block:
    - name: Run validation
      include_role:
        name: ceph
        tasks_from: ceph-ansible-installed
      vars:
        fail_without_ceph_ansible: true
    rescue:
    - name: Clear host errors
      meta: clear_host_errors

    - name: Test output
      debug:
        msg: |
          Properly detected missing package

  - name: install ceph-ansible
    package:
      name: ceph-ansible
      state: present

  - name: Re-run the validation with ceph-ansible installed
    include_role:
      name: ceph
      tasks_from: ceph-ansible-installed

  - name: Re-run the validation with ceph-ansible installed and fail due to wrong
      repo
    block:
    - name: Enforce failure in case of wrong repo
      include_role:
        name: ceph
        tasks_from: ceph-ansible-installed
      vars:
        fail_without_ceph_ansible: true
    rescue:
    - name: Clear host errors
      meta: clear_host_errors

    - name: Test output
      debug:
        msg: |
          Properly detected wrong repository

Scenario: default

Driver: podman:
Molecule Platform(s)
- name: centos
  hostname: centos
  image: centos/centos:stream8
  registry:
    url: quay.io
  dockerfile: ../../../../.config/molecule/Dockerfile
  pkg_extras: python*-setuptools python*-pyyaml
  volumes:
  - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
  privileged: true
  environment:
    http_proxy: "{{ lookup('env', 'http_proxy') }}"
    https_proxy: "{{ lookup('env', 'https_proxy') }}"
  ulimits:
  - host
Molecule Inventory
hosts:
  all:
    hosts:
      centos:
        ansible_python_interpreter: /usr/bin/python3
Example default playbook
- name: Converge
  hosts: all
  gather_facts: false

  tasks:
  - name: Nothing to do
    debug:
      msg: No "main" to run, nothing to do