Skip to content

Instantly share code, notes, and snippets.

View ryanycoleman's full-sized avatar

Ryan Coleman ryanycoleman

  • Stackery
  • Portland, OR
View GitHub Profile
@mazgi
mazgi / console.log.md
Last active March 18, 2024 17:18
LDAP Auth for SSSD, SSH, SUDO
# uname -a
Linux base 4.0.5-gentoo #1 SMP Wed Jul 1 02:23:16 JST 2015 x86_64 Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz GenuineIntel GNU/Linux

Packages

# emerge -pvq openldap openssh sssd sudo
[ebuild R ] net-nds/openldap-2.4.38-r2 USE="berkdb crypt gnutls ipv6 minimal sasl ssl syslog tcpd -cxx -debug -experimental -icu -iodbc -kerberos -odbc -overlays -perl -samba (-selinux) -slp -smbkrb5passwd" ABI_X86="(64) -32 (-x32)" 
@hlindberg
hlindberg / gist:ef417f3fb8778740f2a2
Last active August 29, 2015 14:24
Load balancer in Honeydew - $ for variables, no $ for queues

Load Balancer Example (puppetized)

The first part - ChangeRequest is a generic plan that holds on to a set of values of type T (given when plan is instantiated), and emits the changed set whenever it changes.

type AddRemove = Enum['add', 'remove']
type ChangeRequest[T] = Struct[{'kind' => AddRemove, 'value' => T }]
@adamcrews
adamcrews / README.md
Last active August 29, 2015 14:02
GCE setup

The pe-easy-agent.sh script mentioned in the instance_defaults hash is available at pe-easy-agent.sh

@ahpook
ahpook / gist:4127992
Created November 21, 2012 21:40
How can I troubleshoot problems with Puppet's SSL layer?

I feel your pain. SSL is tough and is probably the number one stumbling block for new users getting Puppet working in their environment. Hopefully this answer helps reduce frustration and get you up and running. The good news is, once it's set up right, you won't have to fiddle with it any more.

First, make sure the problem you're having is actually an SSL problem. Almost all of the SSL-related error messages on the client start with the string SSL_connect and then the error raised up by the underlying crypto libraries. General networking errors will not have this string, so normal network troubleshooting methodology applies; specifically, Connection refused - connect(2) means a TCP connection attempt got a RST packet indicating a firewall or puppet master not running, and getaddrinfo: nodename nor servname provided, or not known means the server's hostname (the value of puppet agent --configprint server) was not resolvable in DNS/hosts.

Next, assuming you do have an SSL_connect style error, it

# Generates facts of the version pkg_foo => 'version'
begin
require 'puppet'
pkgs = Puppet::Type.type(:package).instances
pkgs.each do |pkg|
Facter.add("pkg_#{pkg[:name]}") do
value = pkg.provider.properties[:ensure]
if value != :absent
@glarizza
glarizza / gist:1614020
Created January 15, 2012 02:43
Launching an instance in EC2 with Cloud Provisioner
## Launching an instance in EC2
└(~)▷ irb
>> require 'puppet/face'
=> true
>> arguments = { 'image' => 'ami-1bd68a5e', 'keyname' => 'gary_test', 'type' => 't1.micro', 'region' => 'us-west-1' }
=> {"region"=>"us-west-1", "keyname"=>"gary_test", "type"=>"t1.micro", "image"=>"ami-1bd68a5e"}
>> ec2_ip = Puppet::Face[:node_aws, :current].create(arguments)
#######################
=> "ec2-184-72-21-49.us-west-1.compute.amazonaws.com"