ceph-ansible/roles/ceph-osd/tasks/main.yml

118 lines
3.2 KiB
YAML
Raw Normal View History

---
- name: include_tasks system_tuning.yml
include_tasks: system_tuning.yml
- name: install dependencies
package:
name: parted
state: present
register: result
until: result is succeeded
when:
- not containerized_deployment
- ansible_os_family != 'ClearLinux'
- name: install numactl when needed
package:
name: numactl
register: result
until: result is succeeded
when:
- containerized_deployment
- ceph_osd_numactl_opts != ""
tags:
- with_pkg
- name: install lvm2
package:
name: lvm2
register: result
until: result is succeeded
when:
- osd_scenario == 'lvm'
- not is_atomic
tags:
- with_pkg
- name: include_tasks common.yml
include_tasks: common.yml
- name: include ceph_disk_cli_options_facts.yml
include_tasks: ceph_disk_cli_options_facts.yml
- name: include build_devices.yml
include_tasks: build_devices.yml
- name: read information about the devices
parted:
device: "{{ item }}"
unit: MiB
register: parted_results
with_items: "{{ devices }}"
- name: include check_gpt.yml
include_tasks: check_gpt.yml
when:
- osd_scenario != 'lvm'
- name: include_tasks scenarios/collocated.yml
include_tasks: scenarios/collocated.yml
2016-04-01 18:57:58 +08:00
when:
- osd_scenario == 'collocated'
- name: include_tasks scenarios/non-collocated.yml
include_tasks: scenarios/non-collocated.yml
2016-04-01 18:57:58 +08:00
when:
- not osd_auto_discovery
- osd_scenario == 'non-collocated'
- name: include_tasks scenarios/lvm.yml
include_tasks: scenarios/lvm.yml
when:
- osd_scenario == 'lvm'
- lvm_volumes|length > 0
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include_tasks scenarios/lvm-batch.yml
include_tasks: scenarios/lvm-batch.yml
when:
- osd_scenario == 'lvm'
- devices|length > 0
# Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
static: False
- name: include_tasks activate_osds.yml
include_tasks: activate_osds.yml
when:
- not containerized_deployment
- osd_scenario != 'lvm'
- name: include_tasks start_osds.yml
include_tasks: start_osds.yml
- name: set_fact openstack_keys_tmp - preserve backward compatibility after the introduction of the ceph_keys module
set_fact:
openstack_keys_tmp: "{{ openstack_keys_tmp|default([]) + [ { 'key': item.key, 'name': item.name, 'caps': { 'mon': item.mon_cap, 'osd': item.osd_cap|default(''), 'mds': item.mds_cap|default(''), 'mgr': item.mgr_cap|default('') } , 'mode': item.mode } ] }}"
with_items: "{{ openstack_keys }}"
when:
- not add_osd|default(False)
- openstack_config
- item.get('mon_cap', None)
# it's enough to assume we are running an old-fashionned syntax simply by checking the presence of mon_cap since every key needs this cap
- name: set_fact keys - override keys_tmp with keys
set_fact:
openstack_keys: "{{ openstack_keys_tmp }}"
when:
- not add_osd|default(False)
- openstack_keys_tmp is defined
# Create the pools listed in openstack_pools
- name: include openstack_config.yml
include_tasks: openstack_config.yml
when:
- not add_osd|default(False)
- openstack_config
- inventory_hostname == groups[osd_group_name] | last