Oglop
Oglop

Reputation: 61

Setting Repo with Puppet for Debian

I am trying to just set a repo in Ubuntu that is not centrally managed repo. In the past I worked on CentOS at work and would just use the yumrepo resource definition to do this. But, now I'm in an Ubuntu shop and that won't work. The Puppet docs say I need to use dpkg to do this, but I cannot find anything in the docs over dpkg, only yumrepo. I'm a tad confused and would appreciate someone clearing this up. Seems like it shouldn't be hard and it also seems like something I shouldn't have to install a third party module for, but that's the only solution I've seen people recommending online and that's just not an option for me. Thanks.

Upvotes: 1

Views: 715

Answers (2)

yodog
yodog

Reputation: 6232

This creates a Debian repository using the apt class pointing to any server you want, local or remote:

apt::source {
    "$lsbdistcodename":
        include_src => false,
        location    => "http://10.0.0.8/debian/$lsbdistcodename",
        repos       => "main contrib non-free",
    ;
}

Upvotes: 1

Alex Harvey
Alex Harvey

Reputation: 15472

Puppet has a supported module puppetlabs/apt that you should use on Ubuntu Linux. Also, as noted in the Puppet 6 release notes, the yumrepo type has also moved to an external module now, which has resolved the inconsistency you alluded to in the way Red Hat was previously treated as more of a first-class citizen in the Puppet ecosystem, which was never really the intention.

Upvotes: 2

Related Questions