def install(distro, logger, version_kind, version, adjust_repos): release = distro.release machine = distro.sudo_conn.modules.platform.machine() # Get EPEL installed before we continue: if adjust_repos: install_epel(distro, logger) if version_kind in ['stable', 'testing']: key = 'release' else: key = 'autobuild' if adjust_repos: check_call( distro.sudo_conn, logger, ['su -c \'rpm --import "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc"\''.format(key=key),], shell=True) if version_kind == 'stable': url = 'http://ceph.com/rpm-{version}/el6/'.format( version=version, ) elif version_kind == 'testing': url = 'http://ceph.com/rpm-testing/' elif version_kind == 'dev': url = 'http://gitbuilder.ceph.com/ceph-rpm-centos{release}-{machine}-basic/ref/{version}/'.format( release=release.split(".",1)[0], machine=machine, version=version, ) check_call( distro.sudo_conn, logger, [ 'rpm', '-Uvh', '--replacepkgs', '{url}noarch/ceph-release-1-0.el6.noarch.rpm'.format(url=url), ], ) check_call( distro.sudo_conn, logger, [ 'yum', '-y', '-q', 'install', 'ceph', ], ) # Check the ceph version common.ceph_version(distro.sudo_conn, logger)
def install(distro, logger, version_kind, version): codename = distro.codename machine = distro.sudo_conn.modules.platform.machine() if version_kind in ['stable', 'testing']: key = 'release' else: key = 'autobuild' # Make sure ca-certificates is installed check_call(distro.sudo_conn, logger, [ 'env', 'DEBIAN_FRONTEND=noninteractive', 'apt-get', '-q', 'install', '--assume-yes', 'ca-certificates', ]) check_call( distro.sudo_conn, logger, [ 'wget -q -O- \'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc\' | apt-key add -' .format(key=key) ], shell=True, ) if version_kind == 'stable': url = 'http://ceph.com/debian-{version}/'.format(version=version, ) elif version_kind == 'testing': url = 'http://ceph.com/debian-testing/' elif version_kind == 'dev': url = 'http://gitbuilder.ceph.com/ceph-deb-{codename}-{machine}-basic/ref/{version}'.format( codename=codename, machine=machine, version=version, ) else: raise RuntimeError('Unknown version kind: %r' % version_kind) def write_sources_list(url, codename): """add ceph deb repo to sources.list""" with file('/etc/apt/sources.list.d/ceph.list', 'w') as f: f.write('deb {url} {codename} main\n'.format( url=url, codename=codename, )) with remote(distro.sudo_conn, logger, write_sources_list) as remote_func: remote_func(url, codename) check_call( distro.sudo_conn, logger, ['apt-get', '-q', 'update'], ) # TODO this does not downgrade -- should it? check_call( distro.sudo_conn, logger, [ 'env', 'DEBIAN_FRONTEND=noninteractive', 'DEBIAN_PRIORITY=critical', 'apt-get', '-q', '-o', 'Dpkg::Options::=--force-confnew', 'install', '--no-install-recommends', '--assume-yes', '--', 'ceph', 'ceph-mds', 'ceph-common', 'ceph-fs-common', # ceph only recommends gdisk, make sure we actually have # it; only really needed for osds, but minimal collateral 'gdisk', ], ) # Check the ceph version common.ceph_version(distro.sudo_conn, logger)
def install(distro, logger, version_kind, version, adjust_repos): release = distro.release machine = distro.sudo_conn.modules.platform.machine() if version_kind in ['stable', 'testing']: key = 'release' else: key = 'autobuild' if distro.codename == 'Mantis': distro = 'opensuse12' else: distro = 'sles-11sp2' if adjust_repos: check_call( distro.sudo_conn, logger, ['su -c \'rpm --import "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc"\''.format(key=key)], shell=True, ) if version_kind == 'stable': url = 'http://ceph.com/rpm-{version}/{distro}/'.format( version=version, distro=distro, ) elif version_kind == 'testing': url = 'http://ceph.com/rpm-testing/{distro}'.format(distro=distro) elif version_kind == 'dev': url = 'http://gitbuilder.ceph.com/ceph-rpm-{distro}{release}-{machine}-basic/ref/{version}/'.format( distro=distro, release=release.split(".", 1)[0], machine=machine, version=version, ) check_call( distro.sudo_conn, logger, [ 'rpm', '-Uvh', '--replacepkgs', '--force', '--quiet', '{url}noarch/ceph-release-1-0.noarch.rpm'.format( url=url, ), ] ) check_call( distro.sudo_conn, logger, [ 'zypper', '--non-interactive', '--quiet', 'install', 'ceph', ], ) # Check the ceph version common.ceph_version(distro.sudo_conn, logger)
def install(distro, logger, version_kind, version): release = distro.release machine = distro.sudo_conn.modules.platform.machine() if version_kind in ['stable', 'testing']: key = 'release' else: key = 'autobuild' check_call( distro.sudo_conn, logger, args= 'su -c \'rpm --import "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc"\'' .format(key=key), shell=True, ) if version_kind == 'stable': url = 'http://ceph.com/rpm-{version}/fc{release}/'.format( version=version, release=release, ) elif version_kind == 'testing': url = 'http://ceph.com/rpm-testing/fc{release}'.format( release=release, ) elif version_kind == 'dev': url = 'http://gitbuilder.ceph.com/ceph-rpm-fc{release}-{machine}-basic/ref/{version}/'.format( release=release.split(".", 1)[0], machine=machine, version=version, ) check_call( distro.sudo_conn, logger, args=[ 'rpm', '-Uvh', '--replacepkgs', '--force', '--quiet', '{url}noarch/ceph-release-1-0.fc{release}.noarch.rpm'.format( url=url, release=release, ), ]) check_call( distro.sudo_conn, logger, args=[ 'yum', '-y', '-q', 'install', 'ceph', ], ) # Check the ceph version common.ceph_version(distro.sudo_conn, logger)
def install(distro, logger, version_kind, version, adjust_repos): codename = distro.codename machine = distro.sudo_conn.modules.platform.machine() if version_kind in ['stable', 'testing']: key = 'release' else: key = 'autobuild' # Make sure ca-certificates is installed check_call( distro.sudo_conn, logger, [ 'env', 'DEBIAN_FRONTEND=noninteractive', 'apt-get', '-q', 'install', '--assume-yes', 'ca-certificates', ] ) if adjust_repos: check_call( distro.sudo_conn, logger, ['wget -q -O- \'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc\' | apt-key add -'.format(key=key)], shell=True, ) if version_kind == 'stable': url = 'http://ceph.com/debian-{version}/'.format( version=version, ) elif version_kind == 'testing': url = 'http://ceph.com/debian-testing/' elif version_kind == 'dev': url = 'http://gitbuilder.ceph.com/ceph-deb-{codename}-{machine}-basic/ref/{version}'.format( codename=codename, machine=machine, version=version, ) else: raise RuntimeError('Unknown version kind: %r' % version_kind) def write_sources_list(url, codename): """add ceph deb repo to sources.list""" with file('/etc/apt/sources.list.d/ceph.list', 'w') as f: f.write('deb {url} {codename} main\n'.format( url=url, codename=codename, )) with remote(distro.sudo_conn, logger, write_sources_list) as remote_func: remote_func(url, codename) check_call( distro.sudo_conn, logger, ['apt-get', '-q', 'update'], ) # TODO this does not downgrade -- should it? check_call( distro.sudo_conn, logger, [ 'env', 'DEBIAN_FRONTEND=noninteractive', 'DEBIAN_PRIORITY=critical', 'apt-get', '-q', '-o', 'Dpkg::Options::=--force-confnew', '--no-install-recommends', '--assume-yes', 'install', '--', 'ceph', 'ceph-mds', 'ceph-common', 'ceph-fs-common', # ceph only recommends gdisk, make sure we actually have # it; only really needed for osds, but minimal collateral 'gdisk', ], ) # Check the ceph version common.ceph_version(distro.sudo_conn, logger)
def install(distro, logger, version_kind, version, adjust_repos): release = distro.release machine = distro.sudo_conn.modules.platform.machine() if version_kind in ['stable', 'testing']: key = 'release' else: key = 'autobuild' if distro.codename == 'Mantis': distro = 'opensuse12' else: distro = 'sles-11sp2' if adjust_repos: check_call( distro.sudo_conn, logger, [ 'su -c \'rpm --import "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc"\'' .format(key=key) ], shell=True, ) if version_kind == 'stable': url = 'http://ceph.com/rpm-{version}/{distro}/'.format( version=version, distro=distro, ) elif version_kind == 'testing': url = 'http://ceph.com/rpm-testing/{distro}'.format(distro=distro) elif version_kind == 'dev': url = 'http://gitbuilder.ceph.com/ceph-rpm-{distro}{release}-{machine}-basic/ref/{version}/'.format( distro=distro, release=release.split(".", 1)[0], machine=machine, version=version, ) check_call(distro.sudo_conn, logger, [ 'rpm', '-Uvh', '--replacepkgs', '--force', '--quiet', '{url}noarch/ceph-release-1-0.noarch.rpm'.format(url=url, ), ]) check_call( distro.sudo_conn, logger, [ 'zypper', '--non-interactive', '--quiet', 'install', 'ceph', ], ) # Check the ceph version common.ceph_version(distro.sudo_conn, logger)
def install(distro, logger, version_kind, version): release = distro.release machine = distro.sudo_conn.modules.platform.machine() if version_kind in ['stable', 'testing']: key = 'release' else: key = 'autobuild' check_call( distro.sudo_conn, logger, args='su -c \'rpm --import "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc"\''.format(key=key), shell=True, ) if version_kind == 'stable': url = 'http://ceph.com/rpm-{version}/fc{release}/'.format( version=version, release=release, ) elif version_kind == 'testing': url = 'http://ceph.com/rpm-testing/fc{release}'.format( release=release, ) elif version_kind == 'dev': url = 'http://gitbuilder.ceph.com/ceph-rpm-fc{release}-{machine}-basic/ref/{version}/'.format( release=release.split(".", 1)[0], machine=machine, version=version, ) check_call( distro.sudo_conn, logger, args=[ 'rpm', '-Uvh', '--replacepkgs', '--force', '--quiet', '{url}noarch/ceph-release-1-0.fc{release}.noarch.rpm'.format( url=url, release=release, ), ] ) check_call( distro.sudo_conn, logger, args=[ 'yum', '-y', '-q', 'install', 'ceph', ], ) # Check the ceph version common.ceph_version(distro.sudo_conn, logger)