Exemplo n.º 1
0
def repo_install(distro, reponame, baseurl, gpgkey, **kw):
    # Get some defaults
    name = kw.get("name", "%s repo" % reponame)
    enabled = kw.get("enabled", 1)
    gpgcheck = kw.get("gpgcheck", 1)
    install_ceph = kw.pop("install_ceph", False)
    proxy = kw.get("proxy")
    _type = "repo-md"
    baseurl = baseurl.strip("/")  # Remove trailing slashes

    pkg_managers.yum_clean(distro.conn)

    if gpgkey:
        remoto.process.run(distro.conn, ["rpm", "--import", gpgkey])

    repo_content = templates.custom_repo(
        reponame=reponame,
        name=name,
        baseurl=baseurl,
        enabled=enabled,
        gpgcheck=gpgcheck,
        _type=_type,
        gpgkey=gpgkey,
        proxy=proxy,
    )

    distro.conn.remote_module.write_yum_repo(repo_content, "%s.repo" % reponame)

    # Some custom repos do not need to install ceph
    if install_ceph:
        # Before any install, make sure we have `wget`
        pkg_managers.yum(distro.conn, "wget")

        pkg_managers.yum(distro.conn, "ceph")
Exemplo n.º 2
0
def mirror_install(distro, repo_url, gpg_url, adjust_repos, extra_installs=True):
    repo_url = repo_url.strip('/')  # Remove trailing slashes
    gpg_url_path = gpg_url.split('file://')[-1]  # Remove file if present

    pkg_managers.yum_clean(distro.conn)

    if adjust_repos:
        remoto.process.run(
            distro.conn,
            [
                'rpm',
                '--import',
                gpg_url_path,
            ]
        )

        ceph_repo_content = templates.ceph_repo.format(
            repo_url=repo_url,
            gpg_url=gpg_url
        )

        distro.conn.remote_module.write_yum_repo(ceph_repo_content)

    if extra_installs:
        # Before any install, make sure we have `wget`
        pkg_managers.yum(distro.conn, 'wget')

        pkg_managers.yum(distro.conn, 'ceph')
Exemplo n.º 3
0
def mirror_install(distro, repo_url,
                   gpg_url, adjust_repos, extra_installs=True, **kw):
    packages = kw.get('components', [])
    repo_url = repo_url.strip('/')  # Remove trailing slashes
    gpg_url_path = gpg_url.split('file://')[-1]  # Remove file if present

    pkg_managers.yum_clean(distro.conn)

    if adjust_repos:
        remoto.process.run(
            distro.conn,
            [
                'rpm',
                '--import',
                gpg_url_path,
            ]
        )

        ceph_repo_content = templates.ceph_repo.format(
            repo_url=repo_url,
            gpg_url=gpg_url
        )

        distro.conn.remote_module.write_yum_repo(ceph_repo_content)

    if extra_installs:
        pkg_managers.yum(distro.conn, packages)
Exemplo n.º 4
0
def mirror_install(distro, repo_url, gpg_url, adjust_repos, extra_installs=True):
    repo_url = repo_url.strip('/')  # Remove trailing slashes
    gpg_url_path = gpg_url.split('file://')[-1]  # Remove file if present

    pkg_managers.yum_clean(distro.conn)

    if adjust_repos:
        remoto.process.run(
            distro.conn,
            [
                'rpm',
                '--import',
                gpg_url_path,
            ]
        )

        ceph_repo_content = templates.ceph_repo.format(
            repo_url=repo_url,
            gpg_url=gpg_url
        )

        distro.conn.remote_module.write_yum_repo(ceph_repo_content)
        # set the right priority
        install_yum_priorities(distro)
        distro.conn.remote_module.set_repo_priority(['Ceph', 'Ceph-noarch', 'ceph-source'])
        distro.conn.logger.warning('alter.d ceph.repo priorities to contain: priority=1')


    if extra_installs:
        pkg_managers.yum(distro.conn, 'ceph')
Exemplo n.º 5
0
def mirror_install(distro, repo_url, gpg_url, adjust_repos, extra_installs=True):
    repo_url = repo_url.strip('/')  # Remove trailing slashes
    gpg_url_path = gpg_url.split('file://')[-1]  # Remove file if present

    pkg_managers.yum_clean(distro.conn)

    if adjust_repos:
        remoto.process.run(
            distro.conn,
            [
                'rpm',
                '--import',
                gpg_url_path,
            ]
        )

        ceph_repo_content = templates.ceph_repo.format(
            repo_url=repo_url,
            gpg_url=gpg_url
        )

        distro.conn.remote_module.write_yum_repo(ceph_repo_content)
        # set the right priority
        install_yum_priorities(distro)
        distro.conn.remote_module.set_repo_priority(['Ceph', 'Ceph-noarch', 'ceph-source'])
        distro.conn.logger.warning('alter.d ceph.repo priorities to contain: priority=1')


    if extra_installs:
        pkg_managers.yum(distro.conn, 'ceph')
Exemplo n.º 6
0
def mirror_install(distro, repo_url, gpg_url, adjust_repos, extra_installs=True):
    repo_url = repo_url.strip('/')  # Remove trailing slashes
    gpg_url_path = gpg_url.split('file://')[-1]  # Remove file if present

    pkg_managers.yum_clean(distro.conn)

    if adjust_repos:
        remoto.process.run(
            distro.conn,
            [
                'rpm',
                '--import',
                gpg_url_path,
            ]
        )

        ceph_repo_content = templates.ceph_repo.format(
            repo_url=repo_url,
            gpg_url=gpg_url
        )

        distro.conn.remote_module.write_yum_repo(ceph_repo_content)

    if extra_installs:
        # Before any install, make sure we have `wget`
        pkg_managers.yum(distro.conn, 'wget')

        pkg_managers.yum(distro.conn, 'ceph')
Exemplo n.º 7
0
def install(distro, version_kind, version, adjust_repos):
    release = distro.release
    machine = distro.machine_type

    pkg_managers.yum_clean(distro.conn)

    # Even before EPEL, make sure we have `wget`
    pkg_managers.yum(distro.conn, 'wget')

    # Get EPEL installed before we continue:
    if adjust_repos:
        install_epel(distro)
    if version_kind in ['stable', 'testing']:
        key = 'release'
    else:
        key = 'autobuild'

    if adjust_repos:
        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}/el6/'.format(
                version=version,
                )
        elif version_kind == 'testing':
            url = 'http://ceph.com/rpm-testing/el6/'
        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,
                )

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

    process.run(
        distro.conn,
        [
            'yum',
            '-y',
            '-q',
            'install',
            'ceph',
        ],
    )
Exemplo n.º 8
0
def mirror_install(distro,
                   repo_url,
                   gpg_url,
                   adjust_repos,
                   extra_installs=True,
                   **kw):
    packages = kw.get('components', [])
    repo_url = repo_url.strip('/')  # Remove trailing slashes
    gpg_url_path = gpg_url.split('file://')[-1]  # Remove file if present

    pkg_managers.yum_clean(distro.conn)

    if adjust_repos:
        remoto.process.run(distro.conn, [
            'rpm',
            '--import',
            gpg_url_path,
        ])

        ceph_repo_content = templates.ceph_repo.format(repo_url=repo_url,
                                                       gpg_url=gpg_url)

        distro.conn.remote_module.write_yum_repo(ceph_repo_content)

    if extra_installs:
        pkg_managers.yum(distro.conn, packages)
Exemplo n.º 9
0
def repo_install(distro, reponame, baseurl, gpgkey, **kw):
    logger = distro.conn.logger
    # Get some defaults
    name = kw.pop('name', '%s repo' % reponame)
    enabled = kw.pop('enabled', 1)
    gpgcheck = kw.pop('gpgcheck', 1)
    install_ceph = kw.pop('install_ceph', False)
    proxy = kw.pop('proxy', '') # will get ignored if empty
    _type = 'repo-md'
    baseurl = baseurl.strip('/')  # Remove trailing slashes

    pkg_managers.yum_clean(distro.conn)

    if gpgkey:
        remoto.process.run(
            distro.conn,
            [
                'rpm',
                '--import',
                gpgkey,
            ]
        )

    repo_content = templates.custom_repo(
        reponame=reponame,
        name=name,
        baseurl=baseurl,
        enabled=enabled,
        gpgcheck=gpgcheck,
        _type=_type,
        gpgkey=gpgkey,
        proxy=proxy,
        **kw
    )

    distro.conn.remote_module.write_yum_repo(
        repo_content,
        "%s.repo" % reponame
    )

    repo_path = '/etc/yum.repos.d/{reponame}.repo'.format(reponame=reponame)

    # set the right priority
    if kw.get('priority'):
        install_yum_priorities(distro)
        logger.warning(
            'ensuring that {repo_path} contains a high priority'.format(
                repo_path=repo_path)
        )

        distro.conn.remote_module.set_repo_priority([reponame], repo_path)
        logger.warning('altered {reponame}.repo priorities to contain: priority=1'.format(
            reponame=reponame)
        )

    # Some custom repos do not need to install ceph
    if install_ceph:
        pkg_managers.yum(distro.conn, 'ceph')
Exemplo n.º 10
0
def repo_install(distro, reponame, baseurl, gpgkey, **kw):
    logger = distro.conn.logger
    # Get some defaults
    name = kw.pop('name', '%s repo' % reponame)
    enabled = kw.pop('enabled', 1)
    gpgcheck = kw.pop('gpgcheck', 1)
    install_ceph = kw.pop('install_ceph', False)
    proxy = kw.pop('proxy', '') # will get ignored if empty
    _type = 'repo-md'
    baseurl = baseurl.strip('/')  # Remove trailing slashes

    pkg_managers.yum_clean(distro.conn)

    if gpgkey:
        remoto.process.run(
            distro.conn,
            [
                'rpm',
                '--import',
                gpgkey,
            ]
        )

    repo_content = templates.custom_repo(
        reponame=reponame,
        name=name,
        baseurl=baseurl,
        enabled=enabled,
        gpgcheck=gpgcheck,
        _type=_type,
        gpgkey=gpgkey,
        proxy=proxy,
        **kw
    )

    distro.conn.remote_module.write_yum_repo(
        repo_content,
        "%s.repo" % reponame
    )

    repo_path = '/etc/yum.repos.d/{reponame}.repo'.format(reponame=reponame)

    # set the right priority
    if kw.get('priority'):
        install_yum_priorities(distro)
        logger.warning(
            'ensuring that {repo_path} contains a high priority'.format(
                repo_path=repo_path)
        )

        distro.conn.remote_module.set_repo_priority([reponame], repo_path)
        logger.warning('altered {reponame}.repo priorities to contain: priority=1'.format(
            reponame=reponame)
        )

    # Some custom repos do not need to install ceph
    if install_ceph:
        pkg_managers.yum(distro.conn, 'ceph')
Exemplo n.º 11
0
def uninstall(conn, purge=False):
    packages = ['ceph', 'ceph-common', 'ceph-mon', 'ceph-osd', 'ceph-radosgw']

    pkg_managers.yum_remove(
        conn,
        packages,
    )

    pkg_managers.yum_clean(conn)
Exemplo n.º 12
0
def uninstall(conn, purge=False):
    packages = [
        'ceph',
        'ceph-release',
        ]

    pkg_managers.yum_remove(
        conn,
        packages,
    )

    pkg_managers.yum_clean(conn)
Exemplo n.º 13
0
def uninstall(conn, purge=False):
    packages = [
        'ceph',
        'ceph-release',
    ]

    pkg_managers.yum_remove(
        conn,
        packages,
    )

    pkg_managers.yum_clean(conn)
Exemplo n.º 14
0
def uninstall(conn, purge=False):
    packages = [
        'ceph',
        'ceph-common',
        'ceph-mon',
        'ceph-osd',
        'ceph-radosgw'
        ]

    pkg_managers.yum_remove(
        conn,
        packages,
    )

    pkg_managers.yum_clean(conn)
Exemplo n.º 15
0
def repo_install(distro, reponame, baseurl, gpgkey, **kw):
    # do we have specific components to install?
    # removed them from `kw` so that we don't mess with other defaults
    packages = kw.pop('components', [])

    # Get some defaults
    name = kw.pop('name', '%s repo' % reponame)
    enabled = kw.pop('enabled', 1)
    gpgcheck = kw.pop('gpgcheck', 1)
    install_ceph = kw.pop('install_ceph', False)
    proxy = kw.pop('proxy', '') # will get ignored if empty
    _type = 'repo-md'
    baseurl = baseurl.strip('/')  # Remove trailing slashes

    pkg_managers.yum_clean(distro.conn)

    if gpgkey:
        remoto.process.run(
            distro.conn,
            [
                'rpm',
                '--import',
                gpgkey,
            ]
        )

    repo_content = templates.custom_repo(
        reponame=reponame,
        name=name,
        baseurl=baseurl,
        enabled=enabled,
        gpgcheck=gpgcheck,
        _type=_type,
        gpgkey=gpgkey,
        proxy=proxy,
        **kw
    )

    distro.conn.remote_module.write_yum_repo(
        repo_content,
        "%s.repo" % reponame
    )

    # Some custom repos do not need to install ceph
    if install_ceph:
        pkg_managers.yum(distro.conn, packages)
Exemplo n.º 16
0
def repo_install(distro, reponame, baseurl, gpgkey, **kw):
    # Get some defaults
    name = kw.get('name', '%s repo' % reponame)
    enabled = kw.get('enabled', 1)
    gpgcheck = kw.get('gpgcheck', 1)
    install_ceph = kw.pop('install_ceph', False)
    proxy = kw.get('proxy')
    _type = 'repo-md'
    baseurl = baseurl.strip('/')  # Remove trailing slashes

    pkg_managers.yum_clean(distro.conn)

    if gpgkey:
        remoto.process.run(
            distro.conn,
            [
                'rpm',
                '--import',
                gpgkey,
            ]
        )

    repo_content = templates.custom_repo(
        reponame=reponame,
        name = name,
        baseurl = baseurl,
        enabled = enabled,
        gpgcheck = gpgcheck,
        _type = _type,
        gpgkey = gpgkey,
        proxy = proxy,
    )

    distro.conn.remote_module.write_yum_repo(
        repo_content,
        "%s.repo" % reponame
    )

    # Some custom repos do not need to install ceph
    if install_ceph:
        # Before any install, make sure we have `wget`
        pkg_managers.yum(distro.conn, 'wget')

        pkg_managers.yum(distro.conn, 'ceph')
Exemplo n.º 17
0
def repo_install(distro, reponame, baseurl, gpgkey, **kw):
    # Get some defaults
    name = kw.get('name', '%s repo' % reponame)
    enabled = kw.get('enabled', 1)
    gpgcheck = kw.get('gpgcheck', 1)
    install_ceph = kw.pop('install_ceph', False)
    proxy = kw.get('proxy')
    _type = 'repo-md'
    baseurl = baseurl.strip('/')  # Remove trailing slashes

    pkg_managers.yum_clean(distro.conn)

    if gpgkey:
        remoto.process.run(
            distro.conn,
            [
                'rpm',
                '--import',
                gpgkey,
            ]
        )

    repo_content = templates.custom_repo(
        reponame=reponame,
        name = name,
        baseurl = baseurl,
        enabled = enabled,
        gpgcheck = gpgcheck,
        _type = _type,
        gpgkey = gpgkey,
        proxy = proxy,
    )

    distro.conn.remote_module.write_yum_repo(
        repo_content,
        "%s.repo" % reponame
    )

    # Some custom repos do not need to install ceph
    if install_ceph:
        # Before any install, make sure we have `wget`
        pkg_managers.yum(distro.conn, 'wget')

        pkg_managers.yum(distro.conn, 'ceph')
Exemplo n.º 18
0
def repo_install(distro, reponame, baseurl, gpgkey, **kw):
    # do we have specific components to install?
    # removed them from `kw` so that we don't mess with other defaults
    packages = kw.pop('components', [])

    # Get some defaults
    name = kw.pop('name', '%s repo' % reponame)
    enabled = kw.pop('enabled', 1)
    gpgcheck = kw.pop('gpgcheck', 1)
    install_ceph = kw.pop('install_ceph', False)
    proxy = kw.pop('proxy', '')  # will get ignored if empty
    _type = 'repo-md'
    baseurl = baseurl.strip('/')  # Remove trailing slashes

    pkg_managers.yum_clean(distro.conn)

    if gpgkey:
        remoto.process.run(distro.conn, [
            'rpm',
            '--import',
            gpgkey,
        ])

    repo_content = templates.custom_repo(reponame=reponame,
                                         name=name,
                                         baseurl=baseurl,
                                         enabled=enabled,
                                         gpgcheck=gpgcheck,
                                         _type=_type,
                                         gpgkey=gpgkey,
                                         proxy=proxy,
                                         **kw)

    distro.conn.remote_module.write_yum_repo(repo_content,
                                             "%s.repo" % reponame)

    # Some custom repos do not need to install ceph
    if install_ceph:
        pkg_managers.yum(distro.conn, packages)
Exemplo n.º 19
0
def install(distro, version_kind, version, adjust_repos, **kw):
    packages = kw.get('components', [])
    pkg_managers.yum_clean(distro.conn)
    pkg_managers.yum(distro.conn, packages)
Exemplo n.º 20
0
def install(distro, version_kind, version, adjust_repos):
    logger = distro.conn.logger
    release = distro.release
    machine = distro.machine_type
    repo_part = repository_url_part(distro)
    dist = rpm_dist(distro)

    pkg_managers.yum_clean(distro.conn)

    # Even before EPEL, make sure we have `wget`
    has_wget = distro.conn.remote_module.which("wget")
    if not has_wget:
        pkg_managers.yum(distro.conn, "wget")

    # Get EPEL installed before we continue:
    if adjust_repos:
        install_epel(distro)
        install_yum_priorities(distro)
    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}/{repo}/".format(version=version, repo=repo_part)
            elif version_kind == "testing":
                url = "http://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),
                ],
            )

        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-centos{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", "install", "ceph"])
Exemplo n.º 21
0
def install(distro, version_kind, version, adjust_repos, **kw):
    # note: when split packages for ceph land for CentOS, `kw['components']`
    # will have those. Unused for now.
    logger = distro.conn.logger
    release = distro.release
    machine = distro.machine_type
    repo_part = repository_url_part(distro)
    dist = rpm_dist(distro)

    pkg_managers.yum_clean(distro.conn)

    # Get EPEL installed before we continue:
    if adjust_repos:
        install_epel(distro)
        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 in ['stable', 'testing']:
        key = 'release'
    else:
        key = 'autobuild'

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

            if version_kind == 'stable':
                url = 'http://ceph.com/rpm-{version}/{repo}/'.format(
                    version=version,
                    repo=repo_part,
                )
            elif version_kind == 'testing':
                url = 'http://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),
                ],
            )

        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-centos{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',
            'install',
            'ceph',
            'ceph-radosgw',
        ],
    )
Exemplo n.º 22
0
def install(distro, version_kind, version, adjust_repos):
    logger = distro.conn.logger
    release = distro.release
    machine = distro.machine_type
    repo_part = repository_url_part(distro)
    dist = rpm_dist(distro)

    pkg_managers.yum_clean(distro.conn)

    # Even before EPEL, make sure we have `wget`
    has_wget = distro.conn.remote_module.which('wget')
    if not has_wget:
        pkg_managers.yum(distro.conn, 'wget')

    # Get EPEL installed before we continue:
    if adjust_repos:
        install_epel(distro)
        install_yum_priorities(distro)
    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}/{repo}/'.format(
                    version=version,
                    repo=repo_part,
                    )
            elif version_kind == 'testing':
                url = 'http://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),
                ],
            )

        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-centos{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',
            'install',
            'ceph',
        ],
    )
Exemplo n.º 23
0
def install(distro, version_kind, version, adjust_repos):
    pkg_managers.yum_clean(distro.conn)
    pkg_managers.yum(distro.conn, ['ceph', 'ceph-mon', 'ceph-osd'])
Exemplo n.º 24
0
def install(distro, version_kind, version, adjust_repos):
    pkg_managers.yum_clean(distro.conn)
    pkg_managers.yum(distro.conn, ['ceph', 'ceph-mon', 'ceph-osd'])
Exemplo n.º 25
0
def install(distro, version_kind, version, adjust_repos, **kw):
    packages = kw.get('components', [])
    pkg_managers.yum_clean(distro.conn)
    pkg_managers.yum(distro.conn, packages)
Exemplo n.º 26
0
def install(distro, version_kind, version, adjust_repos):
    logger = distro.conn.logger
    release = distro.release
    machine = distro.machine_type
    repo_part = repository_url_part(distro)
    dist = rpm_dist(distro)

    pkg_managers.yum_clean(distro.conn)

    # Even before EPEL, make sure we have `wget`
    pkg_managers.yum(distro.conn, 'wget')

    # Get EPEL installed before we continue:
    if adjust_repos:
        install_epel(distro)
        install_yum_priorities(distro)
    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}/{repo}/'.format(
                    version=version,
                    repo=repo_part,
                    )
            elif version_kind == 'testing':
                url = 'http://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),
                ],
            )

        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-centos{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',
            'install',
            'ceph',
        ],
    )
Exemplo n.º 27
0
def install(distro, version_kind, version, adjust_repos, **kw):
    # note: when split packages for ceph land for CentOS, `kw['components']`
    # will have those. Unused for now.
    logger = distro.conn.logger
    release = distro.release
    machine = distro.machine_type
    repo_part = repository_url_part(distro)
    dist = rpm_dist(distro)

    pkg_managers.yum_clean(distro.conn)

    # Get EPEL installed before we continue:
    if adjust_repos:
        install_epel(distro)
        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 in ['stable', 'testing']:
        key = 'release'
    else:
        key = 'autobuild'

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

            if version_kind == 'stable':
                url = 'http://ceph.com/rpm-{version}/{repo}/'.format(
                    version=version,
                    repo=repo_part,
                    )
            elif version_kind == 'testing':
                url = 'http://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),
                ],
            )

        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-centos{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',
            'install',
            'ceph',
            'ceph-radosgw',
        ],
    )