This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" AutoAlign: ftplugin support for Puppet | |
" Author: Nan Liu | |
" Date: Feb 23, 2011 | |
" Version: 1 | |
" --------------------------------------------------------------------- | |
let b:loaded_autoalign_puppet = "v1" | |
" overloading '=>' to keep things lined up {{{1 | |
ino <silent> => =><c-r>=AutoAlign(1)<cr> | |
let b:autoalign_reqdpat1 = '=>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'parser-emit' | |
class Puppet::Parser::AST::Definition | |
attr_accessor :name | |
end | |
class Manifest | |
class << self | |
#include Enumerable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class a { | |
$var = '' | |
} | |
class c { | |
include a | |
notice ($a::var) | |
} | |
class b { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define mytype { | |
# resource type that I don't want file to purge: | |
# vhost { $name: ... } | |
file { "/tmp/www/${name}": | |
} | |
} | |
file { '/tmp/www': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-key adv --recv-key --keyserver pool.sks-keyservers.net 4BD6EC30 | |
apt-get update | |
apt-get -y install lsb-release | |
distro=$(lsb_release -i | cut -f 2 | tr "[:upper:]" "[:lower:]") | |
release=$(lsb_release -c | cut -f 2) | |
cat > /etc/apt/sources.list.d/puppetlabs.list <<EOFAPTREPO | |
deb http://apt.puppetlabs.com/${distro}/ ${release} main | |
EOFAPTREPO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is intended to be used with the install action | |
# of puppet-cloudpack | |
set -u | |
set -e | |
function fedora_repo() { | |
cat >/etc/yum.repos.d/puppet.repo <<'EOFYUMREPO' | |
[puppetlabs] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f5_key { 'puppet.key': | |
ensure => 'present', | |
content => file("${settings::ssldir}/ca/ca_key.pem"), | |
mode => 'MANAGEMENT_MODE_DEFAULT', | |
} | |
f5_profileclientssl { 'puppetmaster': | |
ensure => present, | |
certificate_file => 'puppet.crt', | |
key_file => 'puppet.key', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Puppet::Parser::Functions::newfunction(:module_file, :type => :rvalue, :doc => " | |
Function module_file: | |
load file from relative or absolute path, relative path will search puppet modules files directory. | |
") do |args| | |
raise Puppet::ParseError, "module_file(): wrong number of arguments #{args.length}, expecting (filename)." if args.length != 1 | |
raise Puppet::ParseError, "module_file(): does not accept empty file path." unless args[0] | |
file = args[0] | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$data = ['1', '2', '3', '4'] | |
define loop ( | |
$data | |
) { | |
$var = parsejson(inline_template("<%= (data.collect{|x| name+'/'+x}).to_pson %>")) | |
hack { $var: | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define dot::file { | |
file { "${my_homedir}/.${name}": | |
ensure => link, | |
mode => '0644', | |
target => "${my_sourcedir}/dotfiles/${name}", | |
require => Repository["${my_sourcedir}/dotfiles"], | |
} | |
} | |
dot::file { |
OlderNewer