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
container_client: podman
fail_on_ceph_health_err: false
fail_on_ceph_health_warn: 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: podman
log: true
platforms:
- dockerfile: ../../../../.config/molecule/Dockerfile
  environment:
    http_proxy: '{{ lookup(''env'', ''http_proxy'') }}'
    https_proxy: '{{ lookup(''env'', ''https_proxy'') }}'
  hostname: centos
  image: centos/centos:stream8
  name: centos
  pkg_extras: python*-setuptools python*-pyyaml
  privileged: true
  registry:
    url: quay.io
  ulimits:
  - host
  volumes:
  - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
provisioner:
  env:
    ANSIBLE_LIBRARY: ${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}
    ANSIBLE_ROLES_PATH: ${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles
    ANSIBLE_STDOUT_CALLBACK: yaml
  inventory:
    hosts:
      all:
        hosts:
          centos:
            ansible_python_interpreter: /usr/bin/python3
  log: true
  name: ansible
  options:
    vvv: true
scenario:
  test_sequence:
  - destroy
  - create
  - prepare
  - converge
  - verify
  - destroy
verifier:
  name: ansible
Molecule Inventory
hosts:
  all:
    hosts:
      centos:
        ansible_python_interpreter: /usr/bin/python3
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: podman
log: true
platforms:
- dockerfile: ../../../../.config/molecule/Dockerfile
  environment:
    http_proxy: '{{ lookup(''env'', ''http_proxy'') }}'
    https_proxy: '{{ lookup(''env'', ''https_proxy'') }}'
  hostname: centos
  image: centos/centos:stream8
  name: centos
  pkg_extras: python*-setuptools python*-pyyaml
  privileged: true
  registry:
    url: quay.io
  ulimits:
  - host
  volumes:
  - /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
provisioner:
  env:
    ANSIBLE_LIBRARY: ${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}
    ANSIBLE_ROLES_PATH: ${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles
    ANSIBLE_STDOUT_CALLBACK: yaml
  inventory:
    hosts:
      all:
        hosts:
          centos:
            ansible_python_interpreter: /usr/bin/python3
  log: true
  name: ansible
  options:
    vvv: true
scenario:
  test_sequence:
  - destroy
  - create
  - prepare
  - converge
  - verify
  - destroy
verifier:
  name: ansible
Molecule Inventory
hosts:
  all:
    hosts:
      centos:
        ansible_python_interpreter: /usr/bin/python3
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