コード例 #1
0
ファイル: install.py プロジェクト: STEI-ITB/roseph
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
    release = distro.release
    machine = distro.machine_type

    if version_kind in ['stable', 'testing']:
        key = 'release'
    else:
        key = 'autobuild'

    if adjust_repos:
        if distro.packager.name == 'yum':
            distro.packager.install('yum-plugin-priorities')
            # haven't been able to determine necessity of check_obsoletes with DNF
            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']:
            distro.packager.add_repo_gpg_key(gpg.url(key))

            if version_kind == 'stable':
                url = 'https://download.ceph.com/rpm-{version}/fc{release}/'.format(
                    version=version,
                    release=release,
                )
            elif version_kind == 'testing':
                url = 'https://download.ceph.com/rpm-testing/fc{release}'.format(
                    release=release, )

            remoto.process.run(distro.conn, [
                'rpm',
                '-Uvh',
                '--replacepkgs',
                '--force',
                '--quiet',
                '{url}noarch/ceph-release-1-0.fc{release}.noarch.rpm'.format(
                    url=url,
                    release=release,
                ),
            ])

            # 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')

        elif version_kind in ['dev', 'dev_commit']:
            logger.info('skipping install of ceph-release package')
            logger.info('repo file will be created manually')
            mirror_install(
                distro,
                'http://gitbuilder.ceph.com/ceph-rpm-fc{release}-{machine}-basic/{sub}/{version}/'
                .format(release=release.split(".", 1)[0],
                        machine=machine,
                        sub='ref' if version_kind == 'dev' else 'sha1',
                        version=version),
                gpg.url(key),
                adjust_repos=True,
                extra_installs=False,
                gpgcheck=gpgcheck,
            )

        else:
            raise Exception('unrecognized version_kind %s' % version_kind)

    distro.packager.install(packages)
コード例 #2
0
ファイル: install.py プロジェクト: grepory/ceph-deploy
def install(distro, version_kind, version, adjust_repos):
    logger = distro.conn.logger
    release = distro.release
    machine = distro.machine_type

    if version_kind in ['stable', 'testing']:
        key = 'release'
    else:
        key = 'autobuild'

    if adjust_repos:
        if version_kind != 'dev':
            remoto.process.run(distro.conn, [
                'rpm', '--import',
                "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc"
                .format(key=key)
            ])

            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, )

            remoto.process.run(distro.conn, [
                'rpm',
                '-Uvh',
                '--replacepkgs',
                '--force',
                '--quiet',
                '{url}noarch/ceph-release-1-0.fc{release}.noarch.rpm'.format(
                    url=url,
                    release=release,
                ),
            ])

        if version_kind == 'dev':
            logger.info('skipping install of ceph-release package')
            logger.info('repo file will be created manually')
            mirror_install(
                distro,
                'http://gitbuilder.ceph.com/ceph-rpm-fc{release}-{machine}-basic/ref/{version}/'
                .format(release=release.split(".", 1)[0],
                        machine=machine,
                        version=version),
                "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc"
                .format(key=key),
                adjust_repos=True,
                extra_installs=False)

        # 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')

    remoto.process.run(
        distro.conn,
        [
            'yum',
            '-y',
            '-q',
            'install',
            'ceph',
        ],
    )
コード例 #3
0
ファイル: install.py プロジェクト: 1oscar/ceph-deploy
def install(distro, version_kind, version, adjust_repos):
    logger = distro.conn.logger
    release = distro.release
    machine = distro.machine_type

    if version_kind in ['stable', 'testing']:
        key = 'release'
    else:
        key = 'autobuild'

    if adjust_repos:
        install_yum_priorities(distro)

        if version_kind != 'dev':
            remoto.process.run(
                distro.conn,
                [
                    'rpm',
                    '--import',
                    "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc".format(key=key)
                ]
            )

            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,
                    )

            remoto.process.run(
                distro.conn,
                [
                    'rpm',
                    '-Uvh',
                    '--replacepkgs',
                    '--force',
                    '--quiet',
                    '{url}noarch/ceph-release-1-0.fc{release}.noarch.rpm'.format(
                        url=url,
                        release=release,
                        ),
                ]
            )

        if version_kind == 'dev':
            logger.info('skipping install of ceph-release package')
            logger.info('repo file will be created manually')
            mirror_install(
                distro,
                'http://gitbuilder.ceph.com/ceph-rpm-fc{release}-{machine}-basic/ref/{version}/'.format(
                    release=release.split(".", 1)[0],
                    machine=machine,
                    version=version),
                "https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/{key}.asc".format(key=key),
                adjust_repos=True,
                extra_installs=False
            )

        # 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')

    remoto.process.run(
        distro.conn,
        [
            'yum',
            '-y',
            '-q',
            'install',
            'ceph',
        ],
    )
コード例 #4
0
ファイル: install.py プロジェクト: AvengerMoJo/ceph-deploy
def install(distro, version_kind, version, adjust_repos, **kw):
    packages = map_components(
        NON_SPLIT_PACKAGES,
        kw.pop('components', [])
    )
    logger = distro.conn.logger
    release = distro.release
    machine = distro.machine_type

    if version_kind in ['stable', 'testing']:
        key = 'release'
    else:
        key = 'autobuild'

    if adjust_repos:
        if distro.packager.name == 'yum':
            distro.packager.install('yum-plugin-priorities')
            # haven't been able to determine necessity of check_obsoletes with DNF
            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']:
            distro.packager.add_repo_gpg_key(gpg.url(key))

            if version_kind == 'stable':
                url = 'https://download.ceph.com/rpm-{version}/fc{release}/'.format(
                    version=version,
                    release=release,
                    )
            elif version_kind == 'testing':
                url = 'https://download.ceph.com/rpm-testing/fc{release}'.format(
                    release=release,
                    )

            remoto.process.run(
                distro.conn,
                [
                    'rpm',
                    '-Uvh',
                    '--replacepkgs',
                    '--force',
                    '--quiet',
                    '{url}noarch/ceph-release-1-0.fc{release}.noarch.rpm'.format(
                        url=url,
                        release=release,
                        ),
                ]
            )

            # 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')

        elif version_kind in ['dev', 'dev_commit']:
            logger.info('skipping install of ceph-release package')
            logger.info('repo file will be created manually')
            mirror_install(
                distro,
                'http://gitbuilder.ceph.com/ceph-rpm-fc{release}-{machine}-basic/{sub}/{version}/'.format(
                    release=release.split(".", 1)[0],
                    machine=machine,
                    sub='ref' if version_kind == 'dev' else 'sha1',
                    version=version),
                gpg.url(key),
                adjust_repos=True,
                extra_installs=False
            )

        else:
            raise Exception('unrecognized version_kind %s' % version_kind)

    distro.packager.install(
        packages
    )
コード例 #5
0
ファイル: install.py プロジェクト: JialiangSong/ceph-deploy
def install(distro, version_kind, version, adjust_repos, **kw):
    packages = map_components(NON_SPLIT_PACKAGES, kw.pop("components", []))
    logger = distro.conn.logger
    release = distro.release
    machine = distro.machine_type

    if version_kind in ["stable", "testing"]:
        key = "release"
    else:
        key = "autobuild"

    if adjust_repos:
        if distro.packager.name == "yum":
            distro.packager.install("yum-plugin-priorities")
            # haven't been able to determine necessity of check_obsoletes with DNF
            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"]:
            distro.packager.add_repo_gpg_key(gpg.url(key))

            if version_kind == "stable":
                url = "http://download.ceph.com/rpm-{version}/fc{release}/".format(version=version, release=release)
            elif version_kind == "testing":
                url = "http://download.ceph.com/rpm-testing/fc{release}".format(release=release)

            remoto.process.run(
                distro.conn,
                [
                    "rpm",
                    "-Uvh",
                    "--replacepkgs",
                    "--force",
                    "--quiet",
                    "{url}noarch/ceph-release-1-0.fc{release}.noarch.rpm".format(url=url, release=release),
                ],
            )

            # 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")

        elif version_kind in ["dev", "dev_commit"]:
            logger.info("skipping install of ceph-release package")
            logger.info("repo file will be created manually")
            mirror_install(
                distro,
                "http://gitbuilder.ceph.com/ceph-rpm-fc{release}-{machine}-basic/{sub}/{version}/".format(
                    release=release.split(".", 1)[0],
                    machine=machine,
                    sub="ref" if version_kind == "dev" else "sha1",
                    version=version,
                ),
                gpg.url(key),
                adjust_repos=True,
                extra_installs=False,
            )

        else:
            raise Exception("unrecognized version_kind %s" % version_kind)

    distro.packager.install(packages)
コード例 #6
0
def install(distro, version_kind, version, adjust_repos, **kw):
    # note: when split packages for ceph land for Fedora,
    # `kw['components']` will have those. Unused for now.
    logger = distro.conn.logger
    release = distro.release
    machine = distro.machine_type

    if version_kind in ['stable', 'testing']:
        key = 'release'
    else:
        key = 'autobuild'

    if adjust_repos:
        install_yum_priorities(distro)
        distro.conn.remote_module.enable_yum_priority_obsoletes()
        logger.warning(
            'check_obsoletes has been enabled for Yum priorities plugin')

        if version_kind != 'dev':
            remoto.process.run(distro.conn, ['rpm', '--import', gpg.url(key)])

            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, )

            remoto.process.run(distro.conn, [
                'rpm',
                '-Uvh',
                '--replacepkgs',
                '--force',
                '--quiet',
                '{url}noarch/ceph-release-1-0.fc{release}.noarch.rpm'.format(
                    url=url,
                    release=release,
                ),
            ])

        if version_kind == 'dev':
            logger.info('skipping install of ceph-release package')
            logger.info('repo file will be created manually')
            mirror_install(
                distro,
                'http://gitbuilder.ceph.com/ceph-rpm-fc{release}-{machine}-basic/ref/{version}/'
                .format(release=release.split(".", 1)[0],
                        machine=machine,
                        version=version),
                gpg.url(key),
                adjust_repos=True,
                extra_installs=False)

        # 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')

    remoto.process.run(
        distro.conn,
        [
            'yum',
            '-y',
            '-q',
            'install',
            'ceph',
            'ceph-radosgw',
        ],
    )
コード例 #7
0
ファイル: install.py プロジェクト: Abhishekvrshny/ceph-deploy
def install(distro, version_kind, version, adjust_repos, **kw):
    # note: when split packages for ceph land for Fedora,
    # `kw['components']` will have those. Unused for now.
    logger = distro.conn.logger
    release = distro.release
    machine = distro.machine_type

    if version_kind in ['stable', 'testing']:
        key = 'release'
    else:
        key = 'autobuild'

    if adjust_repos:
        install_yum_priorities(distro)
        distro.conn.remote_module.enable_yum_priority_obsoletes()
        logger.warning('check_obsoletes has been enabled for Yum priorities plugin')

        if version_kind != 'dev':
            remoto.process.run(
                distro.conn,
                [
                    'rpm',
                    '--import',
                    gpg.url(key)
                ]
            )

            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,
                    )

            remoto.process.run(
                distro.conn,
                [
                    'rpm',
                    '-Uvh',
                    '--replacepkgs',
                    '--force',
                    '--quiet',
                    '{url}noarch/ceph-release-1-0.fc{release}.noarch.rpm'.format(
                        url=url,
                        release=release,
                        ),
                ]
            )

        if version_kind == 'dev':
            logger.info('skipping install of ceph-release package')
            logger.info('repo file will be created manually')
            mirror_install(
                distro,
                'http://gitbuilder.ceph.com/ceph-rpm-fc{release}-{machine}-basic/ref/{version}/'.format(
                    release=release.split(".", 1)[0],
                    machine=machine,
                    version=version),
                gpg.url(key),
                adjust_repos=True,
                extra_installs=False
            )

        # 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')

    remoto.process.run(
        distro.conn,
        [
            'yum',
            '-y',
            '-q',
            'install',
            'ceph',
            'ceph-radosgw',
        ],
    )