Merge "Move ceph-loop3 to ceph-loop-device role for standalone scenarios"

This commit is contained in:
Zuul 2018-12-03 18:19:16 +00:00 committed by Gerrit Code Review
commit 3a591264da
5 changed files with 64 additions and 22 deletions

View File

@ -1,24 +1,5 @@
- hosts: subnodes
name: Bootstrap subnodes - setup ceph-ansible /dev/loop3 /var/lib/ceph-osd.img
vars:
ceph_loop_device: /dev/loop3
ceph_loop_device_file: /var/lib/ceph-osd.img
tasks:
- name: stat ceph_loop_device see if it already exists
stat:
path: "{{ ceph_loop_device }}"
register: dev_loop3_res
- name: log to syslog if ceph_loop_device exists
syslogger:
msg: "boostrap-subnodes - warning {{ ceph_loop_device }} already exists"
when: dev_loop3_res.stat.exists
- name: Make sure we have losetup installed/latest
package:
name: util-linux
state: latest
- name: Use dd and losetup to create the loop device
become: true
shell: |
dd if=/dev/zero of={{ ceph_loop_device_file }} bs=1 count=0 seek=7G
losetup {{ ceph_loop_device }} {{ ceph_loop_device_file }}
lsblk
- include_role:
name: ceph-loop-device

View File

@ -36,7 +36,6 @@
chdir: '{{ tripleo_root }}'
environment: '{{ zuul | zuul_legacy_vars }}'
- set_fact:
zuul_dump: "{{ {'zuul': zuul} }}"
@ -72,6 +71,9 @@
vars:
custom_env: { 'standalone_custom_env_files': "{{ featureset_override.standalone_environment_files | default([]) | map('regex_replace', '(.*)', '/usr/share/openstack-tripleo-heat-templates/\\1') | list }}" }
when: featureset_override['standalone_environment_files'] is defined
- include_role:
name: ceph-loop-device
when: "{{ standalone_ceph|default(false) }}"
- name: Generate featureset overriding file
template:
src: templates/featureset-override.j2

View File

@ -0,0 +1,37 @@
ceph-loop-device
================
This role creates the /dev/loop3 (default) loop device required when you have
ceph services in the deployment.
Role Variables
--------------
ceph_loop_device: /dev/loop3
ceph_loop_device_file: /var/lib/ceph-osd.img
Requirements
------------
- ansible >= 2.4
- python >= 2.6
Dependencies
------------
None
Example Playbooks
-----------------
.. code-block::
- hosts: localhost
roles:
- ceph-loop-device
License
-------
Apache 2.0

View File

@ -0,0 +1,3 @@
---
ceph_loop_device: /dev/loop3
ceph_loop_device_file: /var/lib/ceph-osd.img

View File

@ -0,0 +1,19 @@
---
- name: stat ceph_loop_device see if it already exists
stat:
path: "{{ ceph_loop_device }}"
register: dev_loop3_res
- name: log to syslog if ceph_loop_device exists
syslogger:
msg: "boostrap-subnodes - warning {{ ceph_loop_device }} already exists"
when: dev_loop3_res.stat.exists
- name: Make sure we have losetup installed/latest
package:
name: util-linux
state: latest
- name: Use dd and losetup to create the loop device
become: true
shell: |
dd if=/dev/zero of={{ ceph_loop_device_file }} bs=1 count=0 seek=7G
losetup {{ ceph_loop_device }} {{ ceph_loop_device_file }}
lsblk