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_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
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
ulimits: &id001
- host
volumes:
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
- dockerfile: Dockerfile
environment:
http_proxy: '{{ lookup(''env'', ''http_proxy'') }}'
https_proxy: '{{ lookup(''env'', ''https_proxy'') }}'
hostname: centos8
image: centos:8
name: centos8
pkg_extras: python*-setuptools python*-enum34 python*-netaddr ruby python*-PyYAML
ulimits: *id001
volumes:
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
provisioner:
env:
ANSIBLE_LIBRARY: ../../../../library:../../../../roles/roles.galaxy/validations-common/validations_common/library
ANSIBLE_STDOUT_CALLBACK: yaml
log: true
name: ansible
scenario:
name: ceph-ansible-installed
test_sequence:
- destroy
- create
- prepare
- converge
- verify
- destroy
verifier:
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
Scenario: default¶
Example default configuration¶
driver:
name: podman
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
ulimits: &id001
- host
- environment:
http_proxy: '{{ lookup(''env'', ''http_proxy'') }}'
https_proxy: '{{ lookup(''env'', ''https_proxy'') }}'
hostname: centos8
image: centos:8
name: centos8
pkg_extras: python*-setuptools python*-enum34 python*-netaddr ruby python*-PyYAML
ulimits: *id001
provisioner:
env:
ANSIBLE_LIBRARY: ../../../../library:../../../../roles/roles.galaxy/validations-common/validations_common/library
ANSIBLE_STDOUT_CALLBACK: yaml
log: true
name: ansible
scenario:
test_sequence:
- destroy
- create
- prepare
- converge
- verify
- destroy
verifier:
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