This is a quick post about how to add validation of your Puppetfile, primarily if you are using the control-repo and r10k for deploying Puppet environments. This came about because I found myself entering incorrect syntax into this file on more than a one occasion. Additionally, there are no indications of any problem, even when importing environments in Foreman, so the only way to find out is by manually running r10k from the command line on the Puppet Server. This assumes you are familiar with and already have puppet-rspec testing setup. If not, please see Unit testing with rspec-puppet — for beginners to get started. Here are the steps to get the validation going: Add gem 'r10k', '>= 2.5.5' to your Gemfile. Note: I had to use version 2.5.5 or else I would encounter Issue #659 when running the tests in Travis CI or GitLab CI, » Read more

 Jake Spain        

This is just a quick note for anyone else out there who recently ran brew update && brew upgrade and then found that Python no longer worked as expected. Here are the important points: The issue is that Homebrew introduced a breaking change and did a crappy job of documenting it. The fix is to prefix your path with /usr/local/opt/python/libexec/bin More details can be found at https://github.com/Homebrew/homebrew-core/issues/15746 For me, the fix was to add this to my .zshrc file: export PATH="/usr/local/opt/python/libexec/bin:$PATH" » Read more

 genebean        

Today I successfully upgraded our Puppet Master from Puppet 4.x (puppetserver 2.7.2) to Puppet 5 (puppetserver 5.0.0). It was wildly helpful to go through the entire upgrade process and perform LOTS of testing and troubleshooting with the Vagrant Puppet Environmet, which is basically an exact replica of my production environment. This is an all-in-one Open Source Puppet setup and, once the next release is out, I would highly recommend for testing! The problems I had below were no fault of the Puppet upgrade itself, but actually by module(s) not yet adapted for 5.x. We use a combination of theforeman and puppetlabs modules to manage the installation of puppetserver, puppetdb, and the agent. Problem #1 My first issue was a classic case of RTFM. As the doc clearly states Postgres 9.6 required. It turns out that 9.4 != 9.6. I received an » Read more

 Jake Spain        

I've been using GoAccess to look at my logs for a while now. The other day I decided I wanted be able to look at these stats for the different sites on my web server in a variety of ways including: all data from all sites combined all data on a per-site basis daily stats from each site kept for a week The thing with wanting daily stats is it helps if they are created in a way that only covers that day. That sounds simple, but the logrotate generally runs around around 3am. So what's the solution? Cron. To be more exact, run logrotate from cron and generate stats while you're at it. # Puppet Name: rotate nginx logs 0 0 * * * /root/updatestats.sh Now, if you are going to run logrotate from cron you'd better turn of the original one. Here's how I did that: $ cat /etc/logrotate.d/ » Read more

 genebean        

Don't you just love it when package maintainers break you blog? Yeah, me too. Tonight I went to post an article (no, not this one) and found my site to be down. When I went to start it back up I got this: [ghost ~]$ /usr/bin/npm start --production node: error while loading shared libraries: libhttp_parser.so.2: cannot open shared object file: No such file or directory As it turns out, the maintainer of the nodejs-6.10.3-1.el7.x86_64 package added this to their changelog: * Wed May 10 2017 Stephen Gallagher <sgallagh@redhat.com> - 1:6.10.3-1 - Update to 6.10.3 (LTS) - https://nodejs.org/en/blog/release/v6.10.3/ - Stop using the bundled http-parser now that there is an upstream release with a new-enough version. What they didn't do was update the their dependancies to pull » Read more

 genebean