Coder Social home page Coder Social logo

computology-packagecloud's Introduction

packagecloud

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with packagecloud
  4. Usage - Configuration options and additional functionality
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Overview

This is the packagecloud.io puppet module which allows you to easily get public and private packagecloud.io repositories installed on your infrastructure.

Module Description

This is the packagecloud.io puppet module which allows you to easily get public and private packagecloud.io repositories installed on your infrastructure.

Setup

What packagecloud affects

  • The packagecloud module will:
    • install apt-transport-https or pygpgme as appropriate for the underlying system
    • add the packagecloud.io gpg key for verifying repository metadata
    • add apt or yum repos to the system by creating the necessary files under /etc/apt/sources.list.d/ and /etc/yum.repos.d/, respectively

Beginning with packagecloud

Simply install the packagecloud puppet module and you will be able to use the packagecloud::repo resource in your manifests:

packagecloud::repo { 'username/publicrepo':
  type => 'rpm',
}

packagecloud::repo { 'username/privaterepo':
  type => 'deb',
  master_token => 'eae123bca276162f376b9614ba134fa7993624a8de0bb3a2',
}

packagecloud: enterprise users can specify the host and port by setting server_address:

packagecloud::repo { 'username/privaterepo':
  type => 'deb',
  master_token => 'eae123bca276162f376b9614ba134fa7993624a8de0bb3a2',
  server_address => 'http://my.internal.server.domain:1234/',
}

If you need to install more than one type of package from the same repository (for example, gem and deb files from username/publicrepo) you can use the fq_name parameter:

packagecloud::repo { 'deb repository for blah':
  fq_name => "username/blah",
  type => 'rpm',
}

packagecloud::repo { 'gem repository for blah':
  fq_name => "username/blah",
  type => 'gem',
}

In order to properly use Gem repos, be sure to set your Exec path to include the directory where your gem binary is located. For example, in your site.pp:

Exec {
  path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ]
}

Usage

As in the examples show in the above section, you should specify at least type (which can be either deb, rpm, or gem) and optionally master_token if the repository is private.

Limitations

Currently supports the following operating systems:

  • Redhat Enterprise Linux 5 and 6
  • CentOS 5 and 6
  • Scientific Linux 5 and 6
  • Fedora 14 - 20
  • AWS Linux
  • Ubuntu 4.10 - 14.04
  • Debian 4.0 - 8.0

Development

Pull requests are welcome!

Release Notes/Contributors/Etc

Special thanks to Eric Lindvall for help with puppet.

computology-packagecloud's People

Contributors

alexsacr avatar colinhebert avatar ice799 avatar igalic avatar mmonaco avatar petems avatar t0xiccode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

computology-packagecloud's Issues

Slow execution of `yum_make_cache`

Notice: /Stage[main]/Baseline/Packagecloud::Repo[haf/oss]/Exec[yum_make_cache_haf/oss]/returns: executed successfully

Takes a long time to execute.

Every puppet run tries to add keys

On every puppet run we get something that looks like this.

Notice: /Stage[main]/Profile::Splunk/Packagecloud::Repo[X/Y]/Exec[apt_key_add_X_Y]/returns: executed successfully
Notice: /Stage[main]/Profile::Splunk/Packagecloud::Repo[umich/splunk]/Exec[apt_get_update_X_Y]/returns: executed successfully

Looks like you should check to see if they key is installed first?

`pygpgme` not available on RHEL8/CentOS8

Puppet error:

Error: Execution of '/usr/bin/dnf -d 0 -e 1 -y install pygpgme' returned 1: Error: Unable to find a match: pygpgme
Error: /Stage[main]/Packagecloud/Package[pygpgme]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/dnf -d 0 -e 1 -y install pygpgme' returned 1: Error: Unable to find a match: pygpgme

Error regarding the URL of the API

The API's Url seems to have changed :

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 404 "Not Found" at /etc/puppet/environments/production/modules/packagecloud/manifests/repo.pp:42

use apt and yumrepo as dependencies

this module should re-use puppetlabs-apt and yumrepo, rather than reinventing their behaviour.

This has the added benefit, that when someone already uses apt to manage their sources, a packagecloud managed repo will not suddenly vanish, because they purge /etc/apt/sources.list*


it should also fix #9.

Idempotency Issues

  • Every run tries to add keys (#20)
  • Yum makecache and apt-get update run every Puppet run regardless of changes
  • New apt-key is added everytime Puppet is run

Caveats

  • Some people use the workflow of releasing a Package to PackageCloud throughout the day, so need every Puppet run to update the metadata for packages, therefore would never have idempotent runs

Possible improvements

  • There should be a $always_update_cache parameter, turned on by default (as to not break this behaviour for people updating the module) that makes it so that the apt-get update and the yum makecache (Suggested by @spuder in #12)
  • For people who use something like run stages for cache updates or only want to use a package that doesn't change that often, the cache updates should have a refreshonly parameter
  • This refreshonly parameter could be a boolean value, taken from $always_update_cache to only run the cache updates if true.

Error message for pygpgme_installed on debian

On Debian, with puppet 3.7.4, using the module outputs this message :

Could not retrieve pygpgme_installed: uninitialized constant Facter::Core

It seems the fact uses rpm command without checking the os.

missing exec path

It looks like a default puppet module (for deb packages) fails with:
Error: Validation of Exec[apt_key_add_myrepo_mypackage] failed: 'wget -qO - https://packagecloud.io/gpg.key | apt-key add -' is not qualified and no path was specified. Please qualify the command or specify a path. at /tmp/vagrant-puppet-2/modules-1/packagecloud/manifests/repo.pp:74

Possible solutions:

It's not a huge problem so feel free to close this issue, but a short info in README or a minor code change could help.

Use of ensure_packages over package { 'apt-transport-https': ..}

Hi!

What is the status of this project? I can see #18 has been open for a while, and the last activity on this project was on the 16th of June last year.

@ice799 are you still actively maintaining this project as part of the packagecloud.io portfolio? Or is this something that isn't supported anymore?

I'm particularly after the replacement of package { 'apt-transport-https': ..} with ensure_packages that currently prevents this puppet module from playing nicely with others.

Execs should not run every time

The gpg key imports should not run every time that the puppet configuration is applied. They should run only if the key doesn't exist in the keychain.

expected folder structure for puppet module

I suggest these changes to make using this puppet module more amenable to pulling into an existing setup.

  • change the name of the repository to puppet-packagecloud - this will make it easier to find this repository through search engines - it's only puppetlabs that puts its name as a prefix, the rest of us use 'puppet'
  • the module should be possible to pull down through e.g. librarian-puppet-simple which looks at <root>/manifests where you currently have an integration test specification instead of the module's code

Missing proxy configuration

The module assumes direct connection to the internet, which in light of log4shell is a bad idea. It always was a bad idea not to block outgoing traffic in general.

However adding the possibility tp configure a proxy will ease up on this.

Puppet 8 compatibility

puppet-lint

packagecloud//manifests/gem_repo.pp - WARNING: defined type not documented on line 1 (check: documentation)
packagecloud//manifests/init.pp - WARNING: class not documented on line 21 (check: documentation)
packagecloud//manifests/init.pp - WARNING: legacy fact 'operatingsystem' on line 22 (check: legacy_facts)
packagecloud//manifests/init.pp - WARNING: legacy fact 'operatingsystem' on line 39 (check: legacy_facts)
packagecloud//manifests/init.pp - WARNING: top scope fact instead of facts hash on line 22 (check: top_scope_facts)
packagecloud//manifests/init.pp - WARNING: top scope fact instead of facts hash on line 39 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: defined type not documented on line 21 (check: documentation)
packagecloud//manifests/repo.pp - WARNING: line has more than 140 characters on line 82 (check: 140chars)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'operatingsystem' on line 59 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'lsbdistcodename' on line 65 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'operatingsystem' on line 95 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'operatingsystem' on line 100 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'operatingsystem' on line 113 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'architecture' on line 114 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'architecture' on line 115 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'architecture' on line 116 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'operatingsystem' on line 120 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'architecture' on line 121 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'architecture' on line 122 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'architecture' on line 123 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'operatingsystem' on line 128 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'architecture' on line 129 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'architecture' on line 130 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'architecture' on line 131 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'operatingsystem' on line 137 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'operatingsystem' on line 146 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'architecture' on line 148 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'architecture' on line 149 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: legacy fact 'operatingsystem' on line 175 (check: legacy_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 59 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 65 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 95 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 100 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 103 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 104 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 113 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 114 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 115 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 116 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 120 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 121 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 122 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 123 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 128 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 129 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 130 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 131 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 137 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 146 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 148 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 149 (check: top_scope_facts)
packagecloud//manifests/repo.pp - WARNING: top scope fact instead of facts hash on line 175 (check: top_scope_facts)
packagecloud//test/test/manifests/site.pp - WARNING: case statement without a default case on line 5 (check: case_without_default)
packagecloud//test/test/manifests/site.pp - WARNING: legacy fact 'operatingsystemrelease' on line 12 (check: legacy_facts)
packagecloud//test/test/manifests/site.pp - WARNING: top scope fact instead of facts hash on line 12 (check: top_scope_facts)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.