Skip to content

Instantly share code, notes, and snippets.

View raphink's full-sized avatar
🐝
eBPF everything!

Raphaël Pinson raphink

🐝
eBPF everything!
View GitHub Profile
<script src="https://gist.github.com/mcanevet/ee4a4f20becd0bcdad41.js?file=setup1.sh"></script>
<script src="https://gist.github.com/mcanevet/ee4a4f20becd0bcdad41.js?file=metadata.json"></script>
<script src="https://gist.github.com/mcanevet/ee4a4f20becd0bcdad41.js?file=Gemfile1.rb"></script>
<script src="https://gist.github.com/mcanevet/ee4a4f20becd0bcdad41.js?file=bundle_install.sh"></script>
<script src="https://gist.github.com/mcanevet/ee4a4f20becd0bcdad41.js?file=setup2.sh"></script>
<script src="https://gist.github.com/mcanevet/ee4a4f20becd0bcdad41.js?file=centos-7-x86_64-vagrant.yml"></script>
<script src="https://gist.github.com/mcanevet/ee4a4f20becd0bcdad41.js?file=debian-7-x86_64-vagrant.yml"></script>
<script src="https://gist.github.com/mcanevet/ee4a4f20becd0bcdad41.js?file=spec_helper_acceptance.rb"></script>
<script src="https://gist.github.com/mcanevet/ee4a4f20becd0bcdad41.js?file=Gemfile2.rb"></script>
<script src="https://gist.github.com/mcanevet/ee4a4f20becd0bcdad41.js?file=.fixtures.yml"></
@raphink
raphink / file.txt
Created March 12, 2015 12:52
test embedded
boo
Puppet::Type.type(:package).provide :puppetserver_gem, :parent => :gem do
desc "Puppet Server Ruby Gem support. If a URL is passed via `source`, then
that URL is used as the remote gem repository; if a source is present but is
not a valid URL, it will be interpreted as the path to a local gem file. If
source is not present at all, the gem will be installed from the default gem
repositories."
has_feature :versionable
def self.command(name)
@raphink
raphink / augeas_spec.rb
Last active December 18, 2015 11:56
Augeas serverspec resource type, using PoC at https://github.com/raphink/serverspec/compare/dev/augeas
describe augeas('/files/etc/fstab/*[file="/"]/vfstype') do
it { should match 1 }
its(:value) { should eq 'ext4' }
it { should have_node('../dump') }
end
EnglishFrench
You call me out upon the waters
The great unknown where feet may fail
And there I find You in the mystery
In oceans deep
My faith will stand

File Manipulation Approaches

Full configurations

Static content

  • Software/script => have you considered packaging it?
  • binary/large data file => add metadata (git + vcsrepo type, maybe even git-annex or git-lfs?)
  • Puppet >= 3.7:
#!/bin/sh
IP="192.168.0.1"
HOST="myhost.mydomain"
ALIAS="myhost"
augtool -sAt "Hosts.lns incl /etc/hosts" << EOC
# \$noentry will match /files/etc/hosts if the entry isn't there yet
defvar noentry /files/etc/hosts[count(*[ipaddr="${IP}" or canonical="${HOST}"])=0]
$ beaker --host spec/acceptance/nodesets/default.yml --debug
{
"project": "Beaker",
"department": "rpinson",
"validate": true,
"jenkins_build_url": null,
"log_level": "debug",
"trace_limit": 10,
"master-start-curl-retries": 120,
"options_file": null,
E, [2014-10-21T14:30:21.029321 #6483] ERROR -- : agent.rb:108:in `handlemsg' package#status failed: Puppet::Error: Could not autoload puppet/type/package: no 'environments' in {:root_environment=>#<Puppet::Node::Environment:0x7f47193774b0 @watching=true, @config_version=nil, @manifest="/tmp", @name=:"*root*", @modulepath=[]>, :current_environment=>#<Puppet::Node::Environment:0x7f47193774b0 @watching=true, @config_version=nil, @manifest="/tmp", @name=:"*root*", @modulepath=[]>} at top of [[0, nil, nil]]
E, [2014-10-21T14:30:21.029446 #6483] ERROR -- : agent.rb:109:in `handlemsg' /usr/lib/ruby/site_ruby/1.8/puppet/context.rb:54:in `lookup'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:226:in `lookup'
/usr/lib/ruby/site_ruby/1.8/puppet/util/autoload.rb:131:in `module_directories'
/usr/lib/ruby/site_ruby/1.8/puppet/util/autoload.rb:160:in `search_directories'
/usr/lib/ruby/site_ruby/1.8/puppet/util/autoload.rb:94:in `files_to_load'
/usr/lib/ruby/site_ruby/1.8/puppet/util/autoload.rb:75:in `loadall'
/usr/lib/ruby/si
@raphink
raphink / gist:bc4f43353c20417871cb
Last active October 19, 2019 05:21
Puppet Proxy setup for the Puppet Server
<VirtualHost *:8140>
ServerName puppet-proxy
ServerAlias puppet-proxy.example.com
## SSL directives
SSLEngine on
SSLCertificateFile "/etc/puppet/ssl/certs/puppet-proxy.example.com.pem"
SSLCertificateKeyFile "/etc/puppet/ssl/private_keys/puppet-proxy.example.com.pem"
SSLCertificateChainFile "/etc/puppet/ssl/ca/ca_crt.pem"
SSLCACertificatePath "/etc/ssl/certs"