Skip to content

Instantly share code, notes, and snippets.

@rdark
rdark / gist:90cbfc2d539638d66cc9
Created May 14, 2015 16:03
vpce endpoint s3 bucket policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Get-Access-from-UACT-VPCE-only",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject",
"s3:GetBucketLocation"
[Unit]
Description=Runs cloud-init URLs in leui of support in oem-cloudinit
After=oem-cloudinit.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/bash -c '/usr/bin/coreos-cloudinit -from-url "https://example-cloudinit-includes.s3.amazonaws.com/coreos/common/my-ca-cert.yaml"'
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/",
"Mappings" : {
"RegionMap" : {
"ap-northeast-1" : {
"AMI" : "ami-19fba518"
},
@rdark
rdark / gist:4406c0cee74339c3db7f
Created November 11, 2014 17:11
connect timeout
Nov 11 17:00:56 ip-10-35-165-195 yum[1007]: Installed: 1:facter-2.3.0-1.el6.x86_64
Nov 11 17:01:00 ip-10-35-165-195 yum[1007]: Installed: puppet-3.6.2-1.el6.noarch
Nov 11 17:02:26 ip-10-35-165-195 puppet-agent[1069]: Error connecting to mgmt-pupt-prod-002.eu-west-1.aws.compute.telnic.net:8140: Connection timed out - connect(2)
Nov 11 17:02:26 ip-10-35-165-195 puppet-agent[1069]: Could not request certificate: getaddrinfo: Name or service not known
@rdark
rdark / gist:93ae34b3617b71bbe16d
Created November 7, 2014 08:13
function (three arguments)
Rake spec:
$ rake spec
function_name
example at ./spec/functions/function_name_spec.rb:40 (FAILED - 1)
Failures:
@rdark
rdark / gist:a69290a2cf352160db5e
Created November 5, 2014 14:54
Augeas XML arrays
# What I get
<configuration>
<foo>
<nodes>
<node>
<domainname>puppet-foobar.vm:7310</domainname>
</node>
<node>
<domainname>d1.mynode.example.com</domainname>
</node>
@rdark
rdark / gist:c70791321e9800cb816f
Created October 24, 2014 13:59
delete_nested_subkeys
#
# delete_child_subkey.rb
#
# === Author
#
# Richard Clark <[email protected]>
#
module Puppet::Parser::Functions
newfunction(:delete_child_subkey, :type => :rvalue, :doc => <<-EOS
Given a hash containing nested hashes, a single or array of regular
@rdark
rdark / gist:9a6ac449c3e72c494602
Created October 24, 2014 13:37
hiera() lookup function
pakrat::ldap_exclude_hosts: "%{hiera('trusted_hosts')}"
trusted_hosts:
- '127.0.0.1/8'
- '192.168.1.1/32'
Error: "127.0.0.1/8192.168.1.1/32" is not an Array. It looks to be a String at /tmp/vagrant-puppet-1/modules-0/pakrat/manifests/init.pp:109 on node puppet.vm
Error: "127.0.0.1/8192.168.1.1/32" is not an Array. It looks to be a String at /tmp/vagrant-puppet-1/modules-0/pakrat/manifests/init.pp:109 on node puppet.vm
Configuration:
Libraries:
intel mic . . . . . . no (MicAccessApi not found)
libaquaero5 . . . . . no (libaquaero5.h not found)
libcurl . . . . . . . yes
libdbi . . . . . . . yes
libcredis . . . . . . no
libesmtp . . . . . . yes
libganglia . . . . . yes
libgcrypt . . . . . . yes
%global __requires_exclude %{?__requires_exclude}|perl\\(VMS::Filespec\\)
Error: Package: perl516-perl-DynaLoader-Functions-0.002-5.el6.noarch (external-rhscl-perl516)
Requires: perl516-perl(VMS::Filespec)