mirror of https://github.com/ceph/ceph-ansible.git
70 lines
1.5 KiB
YAML
70 lines
1.5 KiB
YAML
---
|
|
- hosts: all
|
|
gather_facts: false
|
|
become: yes
|
|
tasks:
|
|
- import_tasks: ../../raw_install_python.yml
|
|
|
|
- hosts: osds
|
|
gather_facts: false
|
|
become: yes
|
|
tasks:
|
|
- name: check if it is atomic host
|
|
stat:
|
|
path: /run/ostree-booted
|
|
register: stat_ostree
|
|
tags: always
|
|
- name: set_fact is_atomic
|
|
set_fact:
|
|
is_atomic: '{{ stat_ostree.stat.exists }}'
|
|
tags: always
|
|
# Some images may not have lvm2 installed
|
|
- name: install lvm2
|
|
package:
|
|
name: lvm2
|
|
state: present
|
|
register: result
|
|
until: result is succeeded
|
|
when: not is_atomic | bool
|
|
- name: create volume group
|
|
lvg:
|
|
vg: test_group
|
|
pvs: /dev/sdb
|
|
- name: create logical volume 1
|
|
lvol:
|
|
vg: test_group
|
|
lv: data-lv1
|
|
size: 50%FREE
|
|
- name: create logical volume 2
|
|
lvol:
|
|
vg: test_group
|
|
lv: data-lv2
|
|
size: 100%FREE
|
|
- name: partition /dev/sdc for journals
|
|
parted:
|
|
device: /dev/sdc
|
|
number: 1
|
|
part_start: 0%
|
|
part_end: 50%
|
|
unit: '%'
|
|
label: gpt
|
|
state: present
|
|
- name: partition /dev/sdc for journals
|
|
parted:
|
|
device: /dev/sdc
|
|
number: 2
|
|
part_start: 50%
|
|
part_end: 100%
|
|
unit: '%'
|
|
state: present
|
|
label: gpt
|
|
- name: create journals vg from /dev/sdc2
|
|
lvg:
|
|
vg: journals
|
|
pvs: /dev/sdc2
|
|
- name: create journal1 lv
|
|
lvol:
|
|
vg: journals
|
|
lv: journal1
|
|
size: 100%FREE
|