Skip to content

Instantly share code, notes, and snippets.

@hesco
hesco / gist:5479049
Created April 29, 2013 00:40
How do I map a particular puppet agent to the right manifest on the puppet master?
I built this manifest using vagrant, and its
essentially working now on my local sandbox.
Now I'm trying to move it to my puppet server.
/etc/puppet/manifests/nodes.pp --
node git {
include ntp
include drush
include pythonsetuptools
@hesco
hesco / gist:5479261
Created April 29, 2013 01:46
Still trying to map node to its manifest --
/etc/puppet/manifests/site.pp --
# (sanitized, samora's FQDN is routable in DNS)
import 'nodes/*.pp'
node 'samora002' { include samora_init }
node 'samora002.example.com' { include samora_init }
------------
# Puppet initial manifest
@hesco
hesco / gist:5532514
Created May 7, 2013 13:23
Blowing up with: Invalid parameter system at /tmp/vagrant-puppet/manifests/pinto.pp:16 on node vagrant-debian-squeeze.vagrantup.com
user { pinto:
home => "/opt/local/pinto",
shell => "/bin/false",
ensure => present,
system => true,
managehome => true,
groups => 'pinto',
}
# comment => "pintod-perl-repo-curator",
# require => [ Group['pinto'] ],
@hesco
hesco / gist:5541611
Last active December 17, 2015 03:09
looks like build is broken again
12:20:38 ~$ rm -rf opt/local/pinto/ ; curl -L http://getpinto.stratopan.com | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4963 100 4963 0 0 9598 0 --:--:-- --:--:-- --:--:-- 9598
Installing pinto into /home/hesco/opt/local/pinto
Successfully installed JSON-PP-2.27202
Successfully installed CPAN-Meta-YAML-0.008
Successfully installed Parse-CPAN-Meta-1.4404 (upgraded from 1.39)
! Installing version failed. See /home/hesco/.cpanm/build.log for details.
! Bailing out the installation for Module-Metadata-1.000011. Retry with --prompt or --force.
@hesco
hesco / build.log
Created July 21, 2013 06:48
I have encountered some module installation errors I do not understand. /root/.cpanm/build.log pasted below. I see no failing installations of dependencies, but it reports: FAIL Installing the dependencies failed: Module 'WWW::DreamHost::API' is not installed Can someone please offer a clue as to why?
cpanm (App::cpanminus) 1.6920 on perl 5.014002 built for x86_64-linux-gnu-thread-multi
Work directory is /root/.cpanm/work/1374385783.12220
You have make /usr/bin/make
You have /usr/bin/wget
You have /bin/tar: tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
@hesco
hesco / -
Last active December 20, 2015 01:48
Error: Failed to apply catalog: Could not find dependency File[/etc/iptables.rules] for File[/etc/network/if-pre-up.d/iptables]
# Puppet iptables manifest
class iptables {
notice("Installing iptables for $fqdn ")
package { "iptables":
ensure => present,
}
if $fqdn == 'git.yourmessagedelivered.com' {
@hesco
hesco / gist:f3757e8acee55a332c01
Created September 7, 2014 13:52
Latest changes to join() function break puppetlabs-postgresql module.
The https://github.com/puppetlabs/puppetlabs-postgresql does not seem to accept bug reports filed by the public. │
In the latest catalogue run on this node I see:
Notice: /File[/var/lib/puppet/lib/puppet/parser/functions/join.rb]/content:
content changed '{md5}a285a05c015ae278608f6454aef211ea' to '{md5}ad3be01a800e9db75f9f0b8db1c2
followed immediately by:
Error 400 on SERVER: join() needs two arguments at /etc/puppet/modules/postgresql/manifests/validate_db_connection.pp:43
which I surmise to mean that the latest changes to the puppet parser's join function broke the postgresql module where it used a legacy interface to that function. Any chance that the authors of either of those modules might be accessible here this Sunday morning?
diff --git a/TODO b/TODO
index e69de29..25850e8 100644
--- a/TODO
+++ b/TODO
@@ -0,0 +1,6 @@
+
+In lib/puppet/provider/vcsrepo/git.rb
+need to provide an unless attribute, like so:
+
+ unless => "/usr/bin/test `/usr/bin/git describe --tags | /bin/grep $DEPLOY_REVISION | /usr/bin/wc -l` -eq 1 ",
require 'facter'
Facter.add(:system_env) do
setcode do
hostname = Facter::Util::Resolution.exec('hostname -s')
if hostname[4] == "p"
env = "prod"
elsif hostname[4] == "d"
env = "dev"
elsif hostname[4] == "u"
env = "uat"
@hesco
hesco / drupal_perms
Created March 3, 2015 15:22
drupal permissions
adduser www-data drupal
cd $DRUPAL_ROOT
chown -R drupal: .
find . -type d -exec chmod u=rwx,g=rx,o= {} \;
find . -type f -exec chmod u=rw,g=r,o= {} \;