Allow ceph-ansible to be run on a locally built/installed Ceph

-First install ceph into a directory with CMake
	cmake -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib -DWITH_SYSTEMD=ON -DCMAKE_INSTALL_PREFIX:PATH:=/usr <ceph_src_dir> && make DESTDIR=<install_dir> install/strip

-Ceph-ansible copies over the install_dir

-User can use rundep_installer.sh to install any runtime dependencies that ceph needs onto the machine from rundep
pull/928/head
Daniel Lin 2016-06-06 10:22:20 -04:00 committed by daniel lin
parent f37a9d1181
commit 08766a243a
8 changed files with 171 additions and 18 deletions

View File

@ -84,12 +84,24 @@ dummy:
## Configure package origin
#
#ceph_origin: 'upstream' # or 'distro'
#ceph_origin: 'upstream' #'distro' or 'local'
# 'distro' means that no separate repo file will be added
# you will get whatever version of Ceph is included in your Linux distro.
#
#ceph_use_distro_backports: false # DEBIAN ONLY
# 'local' means that the ceph binaries will be copied over from the local machine
# LOCAL CEPH INSTALLATION (ceph_origin==local)
#
# Path to DESTDIR of the ceph install
#ceph_installation_dir: "/path/to/ceph_installation/"
# Whether or not to use installer script rundep_installer.sh
# This script takes in rundep and installs the packages line by line onto the machine
# If this is set to false then it is assumed that the machine ceph is being copied onto will already have
# all runtime dependencies installed
#use_installer: false
# Root directory for ceph-ansible
#ansible_dir: "/path/to/ceph-ansible"
#ceph_use_distro_backports: false # DEBIAN ONLY
# STABLE
########

View File

@ -76,12 +76,24 @@ ceph_test: False
## Configure package origin
#
ceph_origin: 'upstream' # or 'distro'
ceph_origin: 'upstream' # or 'distro' or 'local'
# 'distro' means that no separate repo file will be added
# you will get whatever version of Ceph is included in your Linux distro.
#
ceph_use_distro_backports: false # DEBIAN ONLY
# 'local' means that the ceph binaries will be copied over from the local machine
# LOCAL CEPH INSTALLATION (ceph_origin==local)
#
# Path to DESTDIR of the ceph install
#ceph_installation_dir: "/path/to/ceph_installation/"
# Whether or not to use installer script rundep_installer.sh
# This script takes in rundep and installs the packages line by line onto the machine
# If this is set to false then it is assumed that the machine ceph is being copied onto will already have
# all runtime dependencies installed
#use_installer: false
# Root directory for ceph-ansible
#ansible_dir: "/path/to/ceph-ansible"
ceph_use_distro_backports: false # DEBIAN ONLY
# STABLE
########

View File

@ -5,6 +5,7 @@
when:
- ceph_origin != 'upstream'
- ceph_origin != 'distro'
- ceph_origin != 'local'
tags:
- package-install

View File

@ -39,13 +39,67 @@
include: redhat_ceph_repository.yml
when: ceph_origin == 'upstream'
- name: make sure /tmp exists
file:
path: /tmp
state: directory
when:
- ceph_origin == 'local'
- use_installer
- name: use mktemp to create name for rundep
command: "mktemp /tmp/rundep.XXXXXXXX"
register: rundep_location
when:
- ceph_origin == 'local'
- use_installer
- name: copy rundep
copy:
src: "{{ansible_dir}}/rundep"
dest: "{{ item }}"
with_items: rundep_location.stdout_lines
when:
- ceph_origin == 'local'
- use_installer
- name: install ceph dependencies
script: "{{ ansible_dir }}/rundep_installer.sh {{ item }}"
become: true
with_items: rundep_location.stdout_lines
when:
- ceph_origin == 'local'
- use_installer
- name: install ceph
yum:
name: ceph
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: not use_server_package_split
when:
- not use_server_package_split
- ansible_pkg_mgr == "yum"
- ceph_origin != 'local'
- name: install distro or red hat storage ceph mon
- name: synchronize ceph install
synchronize:
src: "{{ceph_installation_dir}}/"
dest: "/"
when:
- ceph_origin == 'local'
- name: create user group ceph
group:
name: 'ceph'
when:
- ceph_origin == 'local'
- name: create user ceph
user:
name: 'ceph'
when:
- ceph_origin == 'local'
- name: install distro or red hat storage ceph mon via yum
yum:
name: "ceph-mon"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
@ -57,7 +111,7 @@
or ceph_origin == "distro"
or ceph_custom
- name: install distro or red hat storage ceph mon
- name: install distro or red hat storage ceph mon via dnf
dnf:
name: "ceph-mon"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
@ -69,7 +123,7 @@
or ceph_dev
or ceph_custom
- name: install distro or red hat storage ceph osd
- name: install distro or red hat storage ceph osd via yum
yum:
name: "ceph-osd"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
@ -81,7 +135,7 @@
or ceph_dev
or ceph_custom
- name: install distro or red hat storage ceph osd
- name: install distro or red hat storage ceph osd via dnf
dnf:
name: "ceph-osd"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
@ -93,7 +147,7 @@
or ceph_dev
or ceph_custom
- name: install distro or red hat storage ceph mds
- name: install distro or red hat storage ceph mds via yum
yum:
name: "ceph-mds"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
@ -105,7 +159,7 @@
or ceph_dev
or ceph_custom
- name: install distro or red hat storage ceph mds
- name: install distro or red hat storage ceph mds via dnf
dnf:
name: "ceph-mds"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
@ -117,7 +171,7 @@
or ceph_dev
or ceph_custom
- name: install distro or red hat storage ceph base
- name: install distro or red hat storage ceph base via yum
yum:
name: "ceph-base"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
@ -129,7 +183,7 @@
or ceph_dev
or ceph_custom
- name: install distro or red hat storage ceph base
- name: install distro or red hat storage ceph base via dnf
dnf:
name: "ceph-base"
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"

View File

@ -53,7 +53,7 @@
- is_after_hammer
- name: ceph monitor mkfs without keyring (for or after infernalis release)
command: ceph-mon --setuser ceph --setgroup ceph --mkfs -i {{ monitor_name }} --fsid {{ fsid }}
command: ceph-mon --cluster {{ cluster }} --setuser ceph --setgroup ceph --mkfs -i {{ monitor_name }} --fsid {{ fsid }}
args:
creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/store.db
when:

View File

@ -10,13 +10,15 @@
with_items:
- done
- upstart
when: not use_systemd
when:
- not use_systemd
- name: start and add that the monitor service to the init sequence (ubuntu)
command: initctl emit ceph-mon cluster={{ cluster }} id={{ monitor_name }}
changed_when: false
failed_when: false
when: not use_systemd
when:
- not use_systemd
# NOTE (leseb): somehow the service ansible module is messing things up
# as a safety measure we run the raw command

45
rundep.sample 100644
View File

@ -0,0 +1,45 @@
#Package lines can be commented out with '#'
#
#boost-atomic
#boost-chrono
#boost-date-time
#boost-iostreams
#boost-program
#boost-random
#boost-regex
#boost-system
#boost-thread
#bzip2-libs
#cyrus-sasl-lib
#expat
#fcgi
#fuse-libs
#glibc
#hdparm
#keyutils-libs
#leveldb
#libaio
#libatomic_ops
#libattr
#libblkid
#libcap
#libcom_err
#libcurl
#libgcc
#libicu
#libidn
#libnghttp2
#libpsl
#libselinux
#libssh2
#libstdc++
#libunistring
#nss-softokn-freebl
#openldap
#openssl-libs
#pcre
#python-nose
#python-sphinx
#snappy
#systemd-libs
#zlib

View File

@ -0,0 +1,27 @@
#!/bin/bash -e
#
# Copyright (C) 2014, 2015 Red Hat <contact@redhat.com>
#
# Author: Daniel Lin <danielin@umich.edu>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
if test -f /etc/redhat-release ; then
PACKAGE_INSTALLER=yum
elif type apt-get > /dev/null 2>&1 ; then
PACKAGE_INSTALLER=apt-get
else
echo "ERROR: Package Installer could not be determined"
exit 1
fi
while read p; do
if [[ $p =~ ^#.* ]] ; then
continue
fi
$PACKAGE_INSTALLER install $p -y
done < $1