def install(distro, version_kind, version, adjust_repos, **kw): packages = map_components(NON_SPLIT_PACKAGES, kw.pop('components', [])) gpgcheck = kw.pop('gpgcheck', 1) logger = distro.conn.logger machine = distro.machine_type repo_part = repository_url_part(distro) dist = rpm_dist(distro) distro.packager.clean() # Get EPEL installed before we continue: if adjust_repos: distro.packager.install('epel-release') distro.packager.install('yum-plugin-priorities') distro.conn.remote_module.enable_yum_priority_obsoletes() logger.warning( 'check_obsoletes has been enabled for Yum priorities plugin') if version_kind in ['stable', 'testing']: key = 'release' else: key = 'autobuild' if adjust_repos: if version_kind in ['stable', 'testing']: distro.packager.add_repo_gpg_key(gpg.url(key)) if version_kind == 'stable': url = 'https://download.ceph.com/rpm-{version}/{repo}/'.format( version=version, repo=repo_part, ) elif version_kind == 'testing': url = 'https://download.ceph.com/rpm-testing/{repo}/'.format( repo=repo_part) remoto.process.run( distro.conn, [ 'rpm', '-Uvh', '--replacepkgs', '{url}noarch/ceph-release-1-0.{dist}.noarch.rpm'.format( url=url, dist=dist), ], ) elif version_kind in ['dev', 'dev_commit']: logger.info('skipping install of ceph-release package') logger.info('repo file will be created manually') shaman_url = 'https://shaman.ceph.com/api/repos/ceph/{version}/{sha1}/{distro}/{distro_version}/repo/?arch={arch}'.format( distro=distro.normalized_name, distro_version=distro.normalized_release.major, version=kw['args'].dev, sha1=kw['args'].dev_commit or 'latest', arch=machine) LOG.debug('fetching repo information from: %s' % shaman_url) content = net.get_chacra_repo(shaman_url) mirror_install( distro, '', # empty repo_url None, # no need to use gpg here, repos are unsigned adjust_repos=True, extra_installs=False, gpgcheck=gpgcheck, repo_content=content) else: raise Exception('unrecognized version_kind %s' % version_kind) # set the right priority logger.warning( 'ensuring that /etc/yum.repos.d/ceph.repo contains a high priority' ) distro.conn.remote_module.set_repo_priority( ['Ceph', 'Ceph-noarch', 'ceph-source']) logger.warning('altered ceph.repo priorities to contain: priority=1') if packages: distro.packager.install(packages)
def install(distro, version_kind, version, adjust_repos, **kw): packages = kw.pop('components', []) codename = distro.codename machine = distro.machine_type if version_kind in ['stable', 'testing']: key = 'release' else: key = 'autobuild' distro.packager.install(['ca-certificates', 'apt-transport-https']) if adjust_repos: # Wheezy does not like the download.ceph.com SSL cert protocol = 'https' if codename == 'wheezy': protocol = 'http' if version_kind in ['dev', 'dev_commit']: shaman_url = 'https://shaman.ceph.com/api/repos/ceph/{version}/{sha1}/{distro}/{distro_version}/repo/?arch={arch}'.format( distro=distro.normalized_name, distro_version=distro.codename, version=kw['args'].dev, sha1=kw['args'].dev_commit or 'latest', arch=machine ) LOG.debug('fetching repo information from: %s' % shaman_url) chacra_url = net.get_request(shaman_url).geturl() content = net.get_chacra_repo(shaman_url) # set the repo priority for the right domain fqdn = urlparse(chacra_url).hostname distro.conn.remote_module.set_apt_priority(fqdn) distro.conn.remote_module.write_sources_list_content(content) extra_install_flags = ['-o', 'Dpkg::Options::=--force-confnew', '--allow-unauthenticated'] else: distro.packager.add_repo_gpg_key(gpg.url(key, protocol=protocol)) if version_kind == 'stable': url = '{protocol}://download.ceph.com/debian-{version}/'.format( protocol=protocol, version=version, ) elif version_kind == 'testing': url = '{protocol}://download.ceph.com/debian-testing/'.format( protocol=protocol, ) else: raise RuntimeError('Unknown version kind: %r' % version_kind) # set the repo priority for the right domain fqdn = urlparse(url).hostname distro.conn.remote_module.set_apt_priority(fqdn) distro.conn.remote_module.write_sources_list(url, codename) extra_install_flags = ['-o', 'Dpkg::Options::=--force-confnew'] distro.packager.clean() # TODO this does not downgrade -- should it? if packages: distro.packager.install( packages, extra_install_flags=extra_install_flags )
def install(distro, version_kind, version, adjust_repos, **kw): packages = map_components( NON_SPLIT_PACKAGES, kw.pop('components', []) ) gpgcheck = kw.pop('gpgcheck', 1) logger = distro.conn.logger machine = distro.machine_type repo_part = repository_url_part(distro) dist = rpm_dist(distro) distro.packager.clean() # Get EPEL installed before we continue: if adjust_repos: distro.packager.install('epel-release') distro.packager.install('yum-plugin-priorities') distro.conn.remote_module.enable_yum_priority_obsoletes() logger.warning('check_obsoletes has been enabled for Yum priorities plugin') if version_kind in ['stable', 'testing']: key = 'release' else: key = 'autobuild' if adjust_repos: if version_kind in ['stable', 'testing']: distro.packager.add_repo_gpg_key(gpg.url(key)) if version_kind == 'stable': url = 'https://download.ceph.com/rpm-{version}/{repo}/'.format( version=version, repo=repo_part, ) elif version_kind == 'testing': url = 'https://download.ceph.com/rpm-testing/{repo}/'.format(repo=repo_part) # remove any old ceph-release package from prevoius release remoto.process.run( distro.conn, [ 'yum', 'remove', '-y', 'ceph-release' ], ) remoto.process.run( distro.conn, [ 'yum', 'install', '-y', '{url}noarch/ceph-release-1-0.{dist}.noarch.rpm'.format(url=url, dist=dist), ], ) elif version_kind in ['dev', 'dev_commit']: logger.info('skipping install of ceph-release package') logger.info('repo file will be created manually') shaman_url = 'https://shaman.ceph.com/api/repos/ceph/{version}/{sha1}/{distro}/{distro_version}/repo/?arch={arch}'.format( distro=distro.normalized_name, distro_version=distro.normalized_release.major, version=kw['args'].dev, sha1=kw['args'].dev_commit or 'latest', arch=machine ) LOG.debug('fetching repo information from: %s' % shaman_url) content = net.get_chacra_repo(shaman_url) mirror_install( distro, '', # empty repo_url None, # no need to use gpg here, repos are unsigned adjust_repos=True, extra_installs=False, gpgcheck=gpgcheck, repo_content=content ) else: raise Exception('unrecognized version_kind %s' % version_kind) # set the right priority logger.warning('ensuring that /etc/yum.repos.d/ceph.repo contains a high priority') distro.conn.remote_module.set_repo_priority(['Ceph', 'Ceph-noarch', 'ceph-source']) logger.warning('altered ceph.repo priorities to contain: priority=1') if packages: distro.packager.install(packages)
def install(distro, version_kind, version, adjust_repos, **kw): packages = kw.pop('components', []) codename = distro.codename machine = distro.machine_type extra_install_flags = [] if version_kind in ['stable', 'testing']: key = 'release' else: key = 'autobuild' distro.packager.install(['ca-certificates', 'apt-transport-https']) if adjust_repos: # Wheezy does not like the download.ceph.com SSL cert protocol = 'https' if codename == 'wheezy': protocol = 'http' if version_kind in ['dev', 'dev_commit']: shaman_url = 'https://shaman.ceph.com/api/repos/ceph/{version}/{sha1}/{distro}/{distro_version}/repo/?arch={arch}'.format( distro=distro.normalized_name, distro_version=distro.codename, version=kw['args'].dev, sha1=kw['args'].dev_commit or 'latest', arch=machine) LOG.debug('fetching repo information from: %s' % shaman_url) chacra_url = net.get_request(shaman_url).geturl() content = net.get_chacra_repo(shaman_url) # set the repo priority for the right domain fqdn = urlparse(chacra_url).hostname distro.conn.remote_module.set_apt_priority(fqdn) distro.conn.remote_module.write_sources_list_content(content) extra_install_flags = [ '-o', 'Dpkg::Options::=--force-confnew', '--allow-unauthenticated' ] else: distro.packager.add_repo_gpg_key(gpg.url(key, protocol=protocol)) if version_kind == 'stable': url = '{protocol}://download.ceph.com/debian-{version}/'.format( protocol=protocol, version=version, ) elif version_kind == 'testing': url = '{protocol}://download.ceph.com/debian-testing/'.format( protocol=protocol, ) else: raise RuntimeError('Unknown version kind: %r' % version_kind) # set the repo priority for the right domain fqdn = urlparse(url).hostname distro.conn.remote_module.set_apt_priority(fqdn) distro.conn.remote_module.write_sources_list(url, codename) extra_install_flags = ['-o', 'Dpkg::Options::=--force-confnew'] distro.packager.clean() # TODO this does not downgrade -- should it? if packages: distro.packager.install(packages, extra_install_flags=extra_install_flags)
def install(distro, version_kind, version, adjust_repos, **kw): packages = map_components(NON_SPLIT_PACKAGES, kw.pop('components', [])) gpgcheck = kw.pop('gpgcheck', 1) logger = distro.conn.logger machine = distro.machine_type repo_part = repository_url_part(distro) dist = rpm_dist(distro) distro.packager.clean() # Get EPEL installed before we continue: if adjust_repos: distro.packager.install('epel-release') distro.packager.install('yum-plugin-priorities') distro.conn.remote_module.enable_yum_priority_obsoletes() logger.warning( 'check_obsoletes has been enabled for Yum priorities plugin') if version_kind in ['stable', 'testing']: key = 'release' else: key = 'autobuild' if adjust_repos: if version_kind in ['stable', 'testing']: repo_suffix = 'el' if distro.normalized_name == 'eurolinux' else 'lp' repo_mapping = { 'name': 'ceph-{suffix}'.format(suffix=repo_suffix), 'baseurl': 'https://repo.eurolinux.local/ceph/14_{suffix}/prod/'.format( suffix=repo_suffix), 'gpgcheck': '1', # actually it's prefix but nvm 'gpgkey_url': 'https://repo.eurolinux.local/ceph/{suffix}_gpg.key'.format( suffix=repo_suffix), 'ssl_verify': '0' } yum_repo_text = '[{name}]\nname=Ceph {name}\nbaseurl={baseurl}' + \ '\ngpgcheck={gpgcheck}\ngpgkey={gpgkey_url}\nsslverify={ssl_verify}' distro.conn.remote_module.write_yum_repo(yum_repo_text) elif version_kind in ['dev', 'dev_commit']: logger.info('skipping install of ceph-release package') logger.info('repo file will be created manually') shaman_url = 'https://shaman.ceph.com/api/repos/ceph/{version}/{sha1}/{distro}/{distro_version}/repo/?arch={arch}'.format( distro=distro.normalized_name, distro_version=distro.normalized_release.major, version=kw['args'].dev, sha1=kw['args'].dev_commit or 'latest', arch=machine) LOG.debug('fetching repo information from: %s' % shaman_url) content = net.get_chacra_repo(shaman_url) mirror_install( distro, '', # empty repo_url None, # no need to use gpg here, repos are unsigned adjust_repos=True, extra_installs=False, gpgcheck=gpgcheck, repo_content=content) else: raise Exception('unrecognized version_kind %s' % version_kind) # set the right priority logger.warning( 'ensuring that /etc/yum.repos.d/ceph.repo contains a high priority' ) distro.conn.remote_module.set_repo_priority( ['Ceph', 'Ceph-noarch', 'ceph-source']) logger.warning('altered ceph.repo priorities to contain: priority=1') if packages: distro.packager.install(packages)