]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Allow ceph-ansible to be run on a locally built/installed Ceph 928/head
authorDaniel Lin <dlin@localhost.localdomain>
Mon, 6 Jun 2016 14:22:20 +0000 (10:22 -0400)
committerdaniel lin <dlin@localhost.localdomain>
Fri, 12 Aug 2016 14:02:15 +0000 (10:02 -0400)
-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

group_vars/all.sample
roles/ceph-common/defaults/main.yml
roles/ceph-common/tasks/checks/check_mandatory_vars.yml
roles/ceph-common/tasks/installs/install_on_redhat.yml
roles/ceph-mon/tasks/deploy_monitors.yml
roles/ceph-mon/tasks/start_monitor.yml
rundep.sample [new file with mode: 0644]
rundep_installer.sh [new file with mode: 0755]

index 941a2da9925b54af39b650974e95d838d87aa17b..4d3e7e15afe7e199f8cad091e62c559490804c1e 100644 (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.
+# 'local' means that the ceph binaries will be copied over from the local machine
+
+# LOCAL CEPH INSTALLATION (ceph_origin==local)
 #
-#ceph_use_distro_backports: false # DEBIAN ONLY
+# 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
 ########
index bfc5d023b25ca0b0188ea31839a4ad5a0fd67f15..fe9d16849f4ebbbf3ebc55288f24ca4bfb620824 100644 (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.
+# 'local' means that the ceph binaries will be copied over from the local machine
+
+# LOCAL CEPH INSTALLATION (ceph_origin==local)
 #
-ceph_use_distro_backports: false # DEBIAN ONLY
+# 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
 ########
index 499d593c0f4fa8e2f3bb3289cba779e78085377a..e317589b7e0ad0e6fb6d8b67441bd0a09dd50e43 100644 (file)
@@ -5,6 +5,7 @@
   when:
     - ceph_origin != 'upstream'
     - ceph_origin != 'distro'
+    - ceph_origin != 'local'
   tags:
     - package-install
 
index 93e6d045da08155ddd7d5a36e8e6c2fad62bdc55..56b3c91210ba07c1f78a0acbb80c488cc13a13ab 100644 (file)
   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: 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
+- name: install distro or red hat storage ceph mon via yum
   yum:
     name: "ceph-mon"
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
       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') }}"
       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') }}"
       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') }}"
       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') }}"
       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') }}"
       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') }}"
       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') }}"
index 2f773ce5a24fa04717fc01b4b1ebc56175cf7528..78518b4a32873c0d4b3717b651621a6bca23ff4e 100644 (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:
index 9d00eecd3cf369a3fbcb8f19d72aaa20b5b12bee..846c77392ead4721047ff7b2fc6bdad3e21a7f64 100644 (file)
   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
diff --git a/rundep.sample b/rundep.sample
new file mode 100644 (file)
index 0000000..2f76e1e
--- /dev/null
@@ -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
diff --git a/rundep_installer.sh b/rundep_installer.sh
new file mode 100755 (executable)
index 0000000..6da9162
--- /dev/null
@@ -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