1 From 73a760805b798f9df406402451578d069b95a794 Mon Sep 17 00:00:00 2001
2 From: Joe Handzik <joseph.t.handzik@hp.com>
3 Date: Tue, 7 Apr 2015 15:03:10 -0500
4 Subject: [PATCH 01/14] Updating the url used to clone the remoto repository
8 1 file changed, 1 insertion(+), 1 deletion(-)
10 diff --git a/vendor.py b/vendor.py
11 index e1c714d..506e87c 100644
14 @@ -64,7 +64,7 @@ def vendor_library(name, version, cmd=None):
15 run(['rm', '-rf', vendor_dest])
17 if not path.exists(vendor_dest):
18 - run(['git', 'clone', 'git://ceph.com/%s' % name])
19 + run(['git', 'clone', 'https://github.com/alfredodeza/%s.git' % name])
21 run(['git', 'checkout', version])
27 From 55d72f4b57cb6da0bd6d4c6207ae0a138d509be7 Mon Sep 17 00:00:00 2001
28 From: Joe Handzik <joseph.t.handzik@hp.com>
29 Date: Wed, 8 Apr 2015 09:53:33 -0500
30 Subject: [PATCH 02/14] Updating github url to point to the ceph fork of remoto
34 1 file changed, 1 insertion(+), 1 deletion(-)
36 diff --git a/vendor.py b/vendor.py
37 index 506e87c..5a88856 100644
40 @@ -64,7 +64,7 @@ def vendor_library(name, version, cmd=None):
41 run(['rm', '-rf', vendor_dest])
43 if not path.exists(vendor_dest):
44 - run(['git', 'clone', 'https://github.com/alfredodeza/%s.git' % name])
45 + run(['git', 'clone', 'https://github.com/ceph/%s.git' % name])
47 run(['git', 'checkout', version])
53 From 4fce039e050f4657f488371f6da84e724b15b60c Mon Sep 17 00:00:00 2001
54 From: Joe Handzik <joseph.t.handzik@hp.com>
55 Date: Thu, 9 Apr 2015 17:05:35 -0500
56 Subject: [PATCH 03/14] Update the run function to cascade the called process's
57 return code back to its caller
61 1 file changed, 2 insertions(+)
63 diff --git a/vendor.py b/vendor.py
64 index 5a88856..f56f1c3 100644
67 @@ -31,6 +31,8 @@ def run(cmd):
69 print_error(result.stdout.readlines(), result.stderr.readlines())
71 + return result.returncode
74 def print_error(stdout, stderr):
80 From dbf5897cf2762b6d3c19f87490822425e3a11d09 Mon Sep 17 00:00:00 2001
81 From: Joe Handzik <joseph.t.handzik@hp.com>
82 Date: Thu, 9 Apr 2015 17:18:28 -0500
83 Subject: [PATCH 04/14] Try the ceph.com mirror first. If that fails, retry
84 with the github url and the https protocol.
88 1 file changed, 4 insertions(+), 1 deletion(-)
90 diff --git a/vendor.py b/vendor.py
91 index f56f1c3..ef3c52c 100644
94 @@ -66,7 +66,10 @@ def vendor_library(name, version, cmd=None):
95 run(['rm', '-rf', vendor_dest])
97 if not path.exists(vendor_dest):
98 - run(['git', 'clone', 'https://github.com/ceph/%s.git' % name])
99 + rc = run(['git', 'clone', 'git://ceph.com/%s' % name])
101 + print "%s: git clone failed using ceph.com url with rc %s, trying github.com" % (path.basename(__file__), rc)
102 + run(['git', 'clone', 'https://github.com/ceph/%s.git' % name])
104 run(['git', 'checkout', version])
110 From 95dce45746a7044b538c03c01631a7e1f0af9bc5 Mon Sep 17 00:00:00 2001
111 From: Joe Handzik <joseph.t.handzik@hp.com>
112 Date: Fri, 10 Apr 2015 10:10:37 -0500
113 Subject: [PATCH 05/14] remove unnecessary parentheses from an if statement
117 1 file changed, 1 insertion(+), 1 deletion(-)
119 diff --git a/vendor.py b/vendor.py
120 index ef3c52c..8d6ac6a 100644
123 @@ -67,7 +67,7 @@ def vendor_library(name, version, cmd=None):
125 if not path.exists(vendor_dest):
126 rc = run(['git', 'clone', 'git://ceph.com/%s' % name])
129 print "%s: git clone failed using ceph.com url with rc %s, trying github.com" % (path.basename(__file__), rc)
130 run(['git', 'clone', 'https://github.com/ceph/%s.git' % name])
136 From c809d07b8813b0598a6dc6a14ae289be47b4a30f Mon Sep 17 00:00:00 2001
137 From: Ken Dreyer <kdreyer@redhat.com>
138 Date: Fri, 10 Apr 2015 09:18:17 -0600
139 Subject: [PATCH 06/14] doc: add CVE-2015-3010 to changelog
141 One of the changes in ceph-deploy 1.5.23 is tracked as CVE-2015-3010.
142 Document this in the changelog.
144 Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
146 docs/source/changelog.rst | 4 ++--
147 1 file changed, 2 insertions(+), 2 deletions(-)
149 diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst
150 index 5363e3b..cb67522 100644
151 --- a/docs/source/changelog.rst
152 +++ b/docs/source/changelog.rst
153 @@ -12,8 +12,8 @@ Changelog
154 * Add ``rgw`` command to easily create rgw instances.
155 * Automatically install the radosgw package.
156 * Remove unimplemented subcommands from CLI and help.
157 -* Fix an issue where keyring permissions were world readable
158 - (thanks Owen Synge).
159 +* **CVE-2015-3010**: Fix an issue where keyring permissions were
160 + world readable (thanks Owen Synge).
161 * Fix an issue preventing all but the first host given to
162 ``install --repo`` from being used.
168 From a3940704d7c91e4eabb0d579087b10629163a3d3 Mon Sep 17 00:00:00 2001
169 From: Alfredo Deza <adeza@redhat.com>
170 Date: Wed, 22 Apr 2015 09:31:32 -0400
171 Subject: [PATCH 07/14] update the changelog
173 Signed-off-by: Alfredo Deza <adeza@redhat.com>
175 docs/source/changelog.rst | 7 +++++++
176 1 file changed, 7 insertions(+)
178 diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst
179 index cb67522..9fa009d 100644
180 --- a/docs/source/changelog.rst
181 +++ b/docs/source/changelog.rst
182 @@ -4,6 +4,13 @@ Changelog
190 +* Use version 0.0.25 of `remoto` that fixes an issue where output would be cut
191 + (https://github.com/alfredodeza/remoto/issues/15).
200 From 1f0cd52e9bec1951a476cc3d12b5df4abf715a93 Mon Sep 17 00:00:00 2001
201 From: Alfredo Deza <adeza@redhat.com>
202 Date: Wed, 22 Apr 2015 09:31:57 -0400
203 Subject: [PATCH 08/14] use the new 0.0.25 version of remoto
205 Signed-off-by: Alfredo Deza <adeza@redhat.com>
208 1 file changed, 1 insertion(+), 1 deletion(-)
210 diff --git a/setup.py b/setup.py
211 index faa4e16..81fcecd 100644
214 @@ -24,7 +24,7 @@ if os.environ.get('CEPH_DEPLOY_NO_VENDOR'):
215 clean_vendor('remoto')
218 - ('remoto', '0.0.23', ['python', 'vendor.py']),
219 + ('remoto', '0.0.25', ['python', 'vendor.py']),
227 From 4bc9e271d5d5d7715dfd36d0142e8aba2911138e Mon Sep 17 00:00:00 2001
228 From: Travis Rhoden <trhoden@redhat.com>
229 Date: Thu, 7 May 2015 17:43:15 -0400
230 Subject: [PATCH 09/14] Add safe_makedirs function
232 safe_makedirs will recursively create paths, just like mkdirs -p
234 The "safe" part is that it wont error/except if any of the paths already
237 Signed-off-by: Travis Rhoden <trhoden@redhat.com>
239 ceph_deploy/hosts/remotes.py | 11 +++++++++++
240 1 file changed, 11 insertions(+)
242 diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py
243 index 88812fc..6c8e63a 100644
244 --- a/ceph_deploy/hosts/remotes.py
245 +++ b/ceph_deploy/hosts/remotes.py
246 @@ -296,6 +296,17 @@ def safe_mkdir(path):
250 +def safe_makedirs(path):
251 + """ create path recursively if it doesn't exist """
255 + if e.errno == errno.EEXIST:
262 """ zeroing last few blocks of device """
263 # this kills the crab
268 From 2a0b467bc4f520865a520cf634043c848f1a5989 Mon Sep 17 00:00:00 2001
269 From: Travis Rhoden <trhoden@redhat.com>
270 Date: Thu, 7 May 2015 17:44:37 -0400
271 Subject: [PATCH 10/14] Recursively create /var/lib/ceph/radosgw/... path
273 Previously we would fail if /var/lib/ceph/radosgw didn't already
274 exist. Go ahead and make that directory if needed.
276 Signed-off-by: Travis Rhoden <trhoden@redhat.com>
278 ceph_deploy/rgw.py | 2 +-
279 1 file changed, 1 insertion(+), 1 deletion(-)
281 diff --git a/ceph_deploy/rgw.py b/ceph_deploy/rgw.py
282 index 7364efc..f4e4b1d 100644
283 --- a/ceph_deploy/rgw.py
284 +++ b/ceph_deploy/rgw.py
285 @@ -34,7 +34,7 @@ def create_rgw(distro, name, cluster, init):
289 - conn.remote_module.safe_mkdir(path)
290 + conn.remote_module.safe_makedirs(path)
292 bootstrap_keyring = '/var/lib/ceph/bootstrap-rgw/{cluster}.keyring'.format(
298 From ff32436139d17074cbc58da0d553ffb2c5f386a1 Mon Sep 17 00:00:00 2001
299 From: Jacek Konieczny <j.konieczny@eggsoft.pl>
300 Date: Tue, 12 May 2015 15:09:52 +0200
301 Subject: [PATCH 11/14] Basic systemd support
303 Do not assume systemd is just another variant of sysvinit.
305 No point in supporting sysvinit in PLD, the init scripts are
308 ceph_deploy/install.py | 2 +-
309 ceph_deploy/mds.py | 10 ++++++++++
310 ceph_deploy/mon.py | 9 +++++++--
311 ceph_deploy/rgw.py | 10 ++++++++++
312 ceph_deploy/util/system.py | 26 ++++++++++++++++++--------
313 5 files changed, 46 insertions(+), 11 deletions(-)
315 diff --git a/ceph_deploy/install.py b/ceph_deploy/install.py
316 index 8665bd0..ca06721 100644
317 --- a/ceph_deploy/install.py
318 +++ b/ceph_deploy/install.py
319 @@ -69,7 +69,7 @@ def install(args):
323 - if distro.init == 'sysvinit' and args.cluster != 'ceph':
324 + if distro.init in ('sysvinit', 'systemd') and args.cluster != 'ceph':
325 LOG.error('refusing to install on host: %s, with custom cluster name: %s' % (
328 diff --git a/ceph_deploy/mds.py b/ceph_deploy/mds.py
329 index 07621d2..01c9d2a 100644
330 --- a/ceph_deploy/mds.py
331 +++ b/ceph_deploy/mds.py
332 @@ -97,6 +97,16 @@ def create_mds(distro, name, cluster, init):
336 + if init == 'systemd':
337 + remoto.process.run(
342 + 'ceph-mds@{name}.service'.format(name=name),
346 elif init == 'sysvinit':
349 diff --git a/ceph_deploy/mon.py b/ceph_deploy/mon.py
350 index 9b20944..d70cf82 100644
351 --- a/ceph_deploy/mon.py
352 +++ b/ceph_deploy/mon.py
353 @@ -331,7 +331,12 @@ def destroy_mon(conn, cluster, hostname):
354 'cluster={cluster}'.format(cluster=cluster),
355 'id={hostname}'.format(hostname=hostname),
358 + elif conn.remote_module.path_exists(os.path.join(path, 'systemd')):
362 + 'ceph-mon@{hostname}.service'.format(hostname=hostname),
364 elif conn.remote_module.path_exists(os.path.join(path, 'sysvinit')):
367 @@ -569,7 +574,7 @@ def is_running(conn, args):
370 result_string = ' '.join(stdout)
371 - for run_check in [': running', ' start/running']:
372 + for run_check in [': running', ' start/running', 'active (running)']:
373 if run_check in result_string:
376 diff --git a/ceph_deploy/rgw.py b/ceph_deploy/rgw.py
377 index f4e4b1d..4462ba0 100644
378 --- a/ceph_deploy/rgw.py
379 +++ b/ceph_deploy/rgw.py
380 @@ -95,6 +95,16 @@ def create_rgw(distro, name, cluster, init):
384 + elif init == 'systemd':
385 + remoto.process.run(
390 + 'ceph-radosgw@{name}'.format(name=name),
394 elif init == 'sysvinit':
397 diff --git a/ceph_deploy/util/system.py b/ceph_deploy/util/system.py
398 index 7665dff..f8e1c81 100644
399 --- a/ceph_deploy/util/system.py
400 +++ b/ceph_deploy/util/system.py
401 @@ -39,14 +39,24 @@ def enable_service(conn, service='ceph'):
402 This function does not do any kind of detection.
405 - remoto.process.run(
413 + if conn.remote_module.path_exists('/lib/systemd/system/ceph.target'):
414 + remoto.process.run(
423 + remoto.process.run(
438 From c57a04651ea4508b63f5eff536f1be66080b8864 Mon Sep 17 00:00:00 2001
439 From: Jacek Konieczny <j.konieczny@eggsoft.pl>
440 Date: Tue, 12 May 2015 15:11:19 +0200
441 Subject: [PATCH 12/14] PLD Linux support (systemd only)
443 Install packages with poldek, control services with systemctl.
445 ceph_deploy/hosts/__init__.py | 5 ++--
446 ceph_deploy/hosts/pld/__init__.py | 19 ++++++++++++++
447 ceph_deploy/hosts/pld/install.py | 27 ++++++++++++++++++++
448 ceph_deploy/hosts/pld/mon/__init__.py | 2 ++
449 ceph_deploy/hosts/pld/mon/create.py | 35 ++++++++++++++++++++++++++
450 ceph_deploy/hosts/pld/pkg.py | 15 +++++++++++
451 ceph_deploy/hosts/pld/uninstall.py | 15 +++++++++++
452 ceph_deploy/util/pkg_managers.py | 47 +++++++++++++++++++++++++++++++++++
453 8 files changed, 163 insertions(+), 2 deletions(-)
454 create mode 100644 ceph_deploy/hosts/pld/__init__.py
455 create mode 100644 ceph_deploy/hosts/pld/install.py
456 create mode 100644 ceph_deploy/hosts/pld/mon/__init__.py
457 create mode 100644 ceph_deploy/hosts/pld/mon/create.py
458 create mode 100644 ceph_deploy/hosts/pld/pkg.py
459 create mode 100644 ceph_deploy/hosts/pld/uninstall.py
461 diff --git a/ceph_deploy/hosts/__init__.py b/ceph_deploy/hosts/__init__.py
462 index a662304..0215348 100644
463 --- a/ceph_deploy/hosts/__init__.py
464 +++ b/ceph_deploy/hosts/__init__.py
465 @@ -6,7 +6,7 @@ on the type of distribution/version we are dealing with.
468 from ceph_deploy import exc
469 -from ceph_deploy.hosts import debian, centos, fedora, suse, remotes, rhel
470 +from ceph_deploy.hosts import debian, centos, fedora, suse, remotes, rhel, pld
471 from ceph_deploy.connection import get_connection
473 logger = logging.getLogger()
474 @@ -60,7 +60,7 @@ def get(hostname,
475 module.normalized_name = _normalized_distro_name(distro_name)
476 module.normalized_release = _normalized_release(release)
477 module.distro = module.normalized_name
478 - module.is_el = module.normalized_name in ['redhat', 'centos', 'fedora', 'scientific']
479 + module.is_el = module.normalized_name in ['redhat', 'centos', 'fedora', 'scientific', 'pld']
480 module.release = release
481 module.codename = codename
483 @@ -82,6 +82,7 @@ def _get_distro(distro, fallback=None, use_rhceph=False):
490 if distro == 'redhat' and use_rhceph:
491 diff --git a/ceph_deploy/hosts/pld/__init__.py b/ceph_deploy/hosts/pld/__init__.py
493 index 0000000..bff6a2a
495 +++ b/ceph_deploy/hosts/pld/__init__.py
499 +from install import install # noqa
500 +from uninstall import uninstall # noqa
502 +# Allow to set some information about this distro
511 + Select a init system
513 + Returns the name of a init system (upstart, sysvinit ...).
516 diff --git a/ceph_deploy/hosts/pld/install.py b/ceph_deploy/hosts/pld/install.py
518 index 0000000..610f326
520 +++ b/ceph_deploy/hosts/pld/install.py
524 +from ceph_deploy.lib import remoto
526 +def install(distro, version_kind, version, adjust_repos):
527 + logger = distro.conn.logger
528 + release = distro.release
529 + machine = distro.machine_type
531 + if version_kind not in ['stable', 'testing']:
532 + logger.error("Only 'stable' and 'testing' supported for PLD")
535 + if version_kind == 'testing':
536 + sources = ['-n', 'th-test', '-n', 'th-ready', '-n', 'th']
538 + sources = ['-n', 'th']
540 + remoto.process.run(
542 + [ 'poldek' ] + sources + [
549 diff --git a/ceph_deploy/hosts/pld/mon/__init__.py b/ceph_deploy/hosts/pld/mon/__init__.py
551 index 0000000..936d5d8
553 +++ b/ceph_deploy/hosts/pld/mon/__init__.py
555 +from ceph_deploy.hosts.common import mon_add as add # noqa
556 +from create import create # noqa
557 diff --git a/ceph_deploy/hosts/pld/mon/create.py b/ceph_deploy/hosts/pld/mon/create.py
559 index 0000000..19c08a8
561 +++ b/ceph_deploy/hosts/pld/mon/create.py
563 +from ceph_deploy.hosts import common
564 +from ceph_deploy.lib import remoto
567 +def create(distro, args, monitor_keyring):
568 + hostname = distro.conn.remote_module.shortname()
569 + common.mon_create(distro, args, monitor_keyring, hostname)
571 + remoto.process.run(
576 + 'ceph-mon@{hostname}.service'.format(hostname=hostname)
580 + remoto.process.run(
585 + 'ceph-mon@{hostname}.service'.format(hostname=hostname)
589 + remoto.process.run(
592 + 'ceph-create-keys',
593 + '--cluster', args.cluster,
598 diff --git a/ceph_deploy/hosts/pld/pkg.py b/ceph_deploy/hosts/pld/pkg.py
600 index 0000000..64f1857
602 +++ b/ceph_deploy/hosts/pld/pkg.py
604 +from ceph_deploy.util import pkg_managers
607 +def install(distro, packages):
608 + return pkg_managers.poldek(
614 +def remove(distro, packages):
615 + return pkg_managers.poldek_remove(
619 diff --git a/ceph_deploy/hosts/pld/uninstall.py b/ceph_deploy/hosts/pld/uninstall.py
621 index 0000000..c047e57
623 +++ b/ceph_deploy/hosts/pld/uninstall.py
625 +from ceph_deploy.util import pkg_managers
628 +def uninstall(conn, purge=False):
635 + pkg_managers.poldek_remove(
640 diff --git a/ceph_deploy/util/pkg_managers.py b/ceph_deploy/util/pkg_managers.py
641 index 8985112..ac463c3 100644
642 --- a/ceph_deploy/util/pkg_managers.py
643 +++ b/ceph_deploy/util/pkg_managers.py
644 @@ -164,3 +164,50 @@ def zypper_remove(conn, packages, *a, **kw):
649 +def poldek(conn, packages, *a, **kw):
650 + if isinstance(packages, str):
651 + packages = [packages]
658 + cmd.extend(packages)
659 + return remoto.process.run(
667 +def poldek_remove(conn, packages, *a, **kw):
668 + if isinstance(packages, str):
669 + packages = [packages]
676 + cmd.extend(packages)
678 + return remoto.process.run(
686 +def poldek_update(conn):
691 + return remoto.process.run(
699 From dc6d218f03d8cfad9a8606dcb016e2e3a45b9a53 Mon Sep 17 00:00:00 2001
700 From: Jacek Konieczny <j.konieczny@eggsoft.pl>
701 Date: Wed, 13 May 2015 11:08:15 +0200
702 Subject: [PATCH 13/14] pld: fix 'purge' action
704 - properly remove the packages installed with 'install'
705 - remove stale /etc/systemd/system/ceph.target.wants symlinks
707 ceph_deploy/hosts/pld/uninstall.py | 10 ++++++----
708 ceph_deploy/util/pkg_managers.py | 3 ++-
709 2 files changed, 8 insertions(+), 5 deletions(-)
711 diff --git a/ceph_deploy/hosts/pld/uninstall.py b/ceph_deploy/hosts/pld/uninstall.py
712 index c047e57..c7a5ee5 100644
713 --- a/ceph_deploy/hosts/pld/uninstall.py
714 +++ b/ceph_deploy/hosts/pld/uninstall.py
716 from ceph_deploy.util import pkg_managers
718 +from ceph_deploy.lib import remoto
720 def uninstall(conn, purge=False):
728 pkg_managers.poldek_remove(
733 + remoto.process.run(
735 + ['sh', '-c', 'rm -f /etc/systemd/system/ceph.target.wants/* || :']
737 diff --git a/ceph_deploy/util/pkg_managers.py b/ceph_deploy/util/pkg_managers.py
738 index ac463c3..d7db533 100644
739 --- a/ceph_deploy/util/pkg_managers.py
740 +++ b/ceph_deploy/util/pkg_managers.py
741 @@ -190,7 +190,8 @@ def poldek_remove(conn, packages, *a, **kw):
755 From bfd4cdafbf34fd34f777038ad8c2efa10e7bc32f Mon Sep 17 00:00:00 2001
756 From: Jacek Konieczny <j.konieczny@eggsoft.pl>
757 Date: Wed, 13 May 2015 13:18:22 +0200
758 Subject: [PATCH 14/14] bootstrap script updated for PLD
761 bootstrap | 13 +++++++++++++
762 1 file changed, 13 insertions(+)
764 diff --git a/bootstrap b/bootstrap
765 index 9b6fda8..c11f413 100755
768 @@ -16,6 +16,19 @@ if command -v lsb_release >/dev/null 2>&1; then
773 + for package in python-virtualenv; do
774 + if ! rpm -q $package >/dev/null 2>&1; then
775 + # add a space after old values
776 + missing="${missing:+$missing }$package"
779 + if [ -n "$missing" ]; then
780 + echo "$0: missing required packages, please install them:" 1>&2
781 + echo " poldek --cmd install $missing"
787 case "$(lsb_release --id --short | awk '{print $1}')" in