voxpupuli/puppet-pkgng

[Feature request/Proposion] Add support of signature repository

Closed this issue · 2 comments

I added initial support of signature repository but I don't know how to push it, so I attached diff below. It would be nice if you review and approve it.
I'm a newbie in ruby, so my code are far for ideal, I'm afraid.
signature.patch.txt

Usage example:

class repository {
    if ($operatingsystem == "FreeBSD") {
        if ($operatingsystemmajrelease * 1) == 10 {
        pkgng::repo { 'smart':
            packagehost => 'pkg.smartspb.net',
            repopath => '/packages/101amd64',
            protocol => "http",
            mirror_type => "http",
            pubkey => "/usr/local/etc/pkg/repos/smart.cert",
            priority => 100 }
        }
        file {'smart.cert':
                ensure  => file,
                path    => '/usr/local/etc/pkg/repos/smart.cert',
                owner   => root,
                group   => wheel,
                mode    => "0644",
                source  => "puppet:///files/others/pkg/smart.cert",
                purge   => true,
        }
    }
}

Result:

cat /usr/local/etc/pkg/repos/smart.conf

# File managed by Puppet

smart: {
    url:                "http://pkg.smartspb.net/packages/101amd64",
    mirror_type:        "http",
    enabled:            "yes",
    priority:           "100"
    pubkey:             "/usr/local/etc/pkg/repos/smart.cert"
    signature_type:     "pubkey"

}

Added pull request.