Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up package classes, allow installing mainline upstream packages #519

Merged
merged 14 commits into from
Dec 15, 2014
Merged

Clean up package classes, allow installing mainline upstream packages #519

merged 14 commits into from
Dec 15, 2014

Conversation

3flex
Copy link
Contributor

@3flex 3flex commented Dec 10, 2014

Improves the way packages are handled by the module and cleans up the code significantly. No features are removed except with good reason, and it should be almost completely compatible with existing code (except for the package resource now always being called "nginx", and removing a couple of resources that were only for internal use).

  • Cleanup
    • Removed a bunch of redundant code in manifests and specs
  • New features & fixes
    • No longer install an upstream Nginx package on Amazon Linux. Upstream doesn't provide a build for Amazon Linux.
    • The package resource is now always titled "nginx" even when package name to install is something else.
    • Instead of failing compilation, install the "nginx" package by default when the OS isn't recognized. This will provide broader OS compatibility without having to add specific OS support.
    • Removed a warning for Fedora 18 and below. Those versions no longer supported by the Fedora Project.
    • Differentiate between upstream's RedHat and CentOS packages. Even if they're currently identical they may diverge in future.
    • Only set manage_repo => true when appropriate (i.e. upstream provides a package for it)
    • Fail on Solaris when $package_name not set. The comments say this must be set on that OS so the failure makes that explicit.
    • Don't ensure existence of the yum repo file. This could be in one of several places and it's not up to the module to check for it - assume Puppet's yumrepo resource will do the right thing.
    • Update the puppetlabs-apt integration to use more of that module's features rather than rolling our own support for forcing updates after adding an apt::source.
    • Add support for installing mainline packages (closes package: support the nginx mainline repo #518, closes Add support for using mainline nginx packages on RHEL/CentOS/Debian #456, closes Add support for mainline version #450)
    • Install "ca-certificates" package before adding the Passenger apt::source. This is required according to the Passenger documentation.
    • Warn when user doesn't set package name correctly when using Passenger.

Matthew Haughton added 3 commits December 9, 2014 19:47
* Removed some tests that no longer apply and/or are redundant
* Only set OS facts when testing OS-specific behaviors. This simplifies the
  facts that must be set in the specs and saves running the same tests
  several times when the results wouldn't differ by OS anyway.
Upstream doesn't provide a build of Nginx for Amazon Linux.
@jfryman
Copy link
Contributor

jfryman commented Dec 10, 2014

687474703a2f2f692e696d6775722e636f6d2f6c513155354d392e676966

default: {
fail("Module ${module_name} is not supported on ${::operatingsystem}")
}
package { $package_name:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, missed this during a rebase - I need to change this to package { 'nginx':

I'll fix tonight, so don't merge just yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries. This was a big one, and I figured you'll merge when you're ready. Good 👀

@lattwood
Copy link

As the author of #456, I concur with @jfryman .

Matthew Haughton and others added 11 commits December 10, 2014 21:23
This will provide broader OS compatibility without having to manually add
support for specific OSes.
Those versions no longer supported by the Fedora Project.
Even if they're currently identical they may diverge in future.
i.e. upstream provides a package for it
The comments say this must be set on that OS so the failure makes that
explicit.
The file wouldn't necessarily be at that location. According to Puppet it's installed in the first matching location:
* Custom directory specified by the ‘/etc/yum.conf’ reposdir property
* ‘/etc/yum/repos.d’
* ‘/etc/yum.repos.d’
* If none of these locations match, section will be created in ‘/etc/yum.conf’
* puppetlabs-apt does an APT update after every apt::source is added, so no
  need to do it again in this module.
* Use the 'required_packages' feature of apt::source instead of
  ensure_resources
Required per the Passenger install guide
According to Passenger docs:

"You should install nginx-extras even if you have already installed an Nginx package from the
official Debian/Ubuntu repository. This is because the Nginx binary that our packages supply
is compiled with the Passenger module."
@3flex
Copy link
Contributor Author

3flex commented Dec 11, 2014

I'll treasure that GIF forever :)

I'll let this sit until the end of the weekend, barring any negative feedback or comments I'll merge then.

3flex added a commit that referenced this pull request Dec 15, 2014
Clean up package classes, allow installing mainline upstream packages
@3flex 3flex merged commit bbbb1ca into voxpupuli:master Dec 15, 2014
@3flex 3flex deleted the refactor-packages branch December 15, 2014 02:25
cegeka-jenkins pushed a commit to cegeka/puppet-nginx that referenced this pull request Oct 23, 2017
Clean up package classes, allow installing mainline upstream packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for mainline version
3 participants