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: ceph-ansible-installed¶
Example ceph-ansible-installed configuration¶
driver:
name: podman
log: true
platforms:
- dockerfile: Dockerfile
environment:
http_proxy: '{{ lookup(''env'', ''http_proxy'') }}'
https_proxy: '{{ lookup(''env'', ''https_proxy'') }}'
hostname: ubi8
image: ubi8/ubi-init
name: ubi8
pkg_extras: python*-setuptools python*-pyyaml
privileged: true
registry:
url: registry.access.redhat.com
ulimits:
- host
volumes:
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
- /etc/pki/rpm-gpg:/etc/pki/rpm-gpg
- /opt/yum.repos.d:/etc/yum.repos.d:rw
provisioner:
env:
ANSIBLE_LIBRARY: ${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}
ANSIBLE_STDOUT_CALLBACK: yaml
inventory:
hosts:
all:
hosts:
ubi8:
ansible_python_interpreter: /usr/bin/python3
vars:
ansible_user: root
log: true
name: ansible
scenario:
name: ceph-ansible-installed
test_sequence:
- destroy
- create
- prepare
- converge
- verify
- destroy
verifier:
name: testinfra
Molecule Inventory¶
hosts:
all:
hosts:
ubi8:
ansible_python_interpreter: /usr/bin/python3
vars:
ansible_user: root
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
Scenario: default¶
Example default configuration¶
driver:
name: podman
log: true
platforms:
- dockerfile: Dockerfile
environment:
http_proxy: '{{ lookup(''env'', ''http_proxy'') }}'
https_proxy: '{{ lookup(''env'', ''https_proxy'') }}'
hostname: ubi8
image: ubi8/ubi-init
name: ubi8
pkg_extras: python*-setuptools
privileged: true
registry:
url: registry.access.redhat.com
ulimits:
- host
volumes:
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
- /etc/pki/rpm-gpg:/etc/pki/rpm-gpg
- /opt/yum.repos.d:/etc/yum.repos.d:rw
provisioner:
env:
ANSIBLE_LIBRARY: ${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}
ANSIBLE_STDOUT_CALLBACK: yaml
inventory:
hosts:
all:
hosts:
ubi8:
ansible_python_interpreter: /usr/bin/python3
log: true
name: ansible
scenario:
test_sequence:
- destroy
- create
- prepare
- converge
- verify
- destroy
verifier:
name: testinfra
Molecule Inventory¶
hosts:
all:
hosts:
ubi8:
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