view modules/vcs/manifests/init.pp @ 421:a5d1f34a7d3f

Ensure keyring is installed with pip3 The default `pip` alias doesn't exist on CentOS
author IBBoard <dev@ibboard.co.uk>
date Sat, 08 Oct 2022 16:00:06 +0100
parents fa2747b27bb4
children
line wrap: on
line source

class vcs {
    @package { [
            "mercurial",
            "git"
        ]:
        ensure => installed
    }
    python::pip { 'mercurial-keyring':
        ensure => 'present',
        pip_provider => 'pip3',
    }
    # Alt keyrings are insecure, but a) we're on a limited access server and
    # b) I share the Mecurial config with the desktop, which uses the system
    # keyring rather than
    #
    # [backend]
    # default-keyring=keyrings.alt.file.PlaintextKeyring
    python::pip { 'keyrings.alt':
        ensure => 'present',
        pip_provider => 'pip3',
    }
    if $operatingsystem == 'Ubuntu' {
        $gitprompt = '/etc/bash_completion.d/git-prompt'
    }
    else {
        $gitprompt = '/usr/share/git-core/contrib/completion/git-prompt.sh'
    }
    file { '/etc/bash_completion.d/git-prompt.sh':
        ensure => 'link',
        target => $gitprompt,
    }
}

class vcs::client inherits vcs {
	realize(Package["mercurial"],
		Python::Pip["mercurial-keyring"],
		Python::Pip["keyrings.alt"],
		Package["git"])
}

class vcs::server inherits vcs {
	realize(Package["mercurial"],
		Package["git"])
}