Skip to content

Instantly share code, notes, and snippets.

View riton's full-sized avatar

Rémi Ferrand riton

View GitHub Profile
@riton
riton / myfunction.pp
Created July 4, 2017 13:44
rspec-puppet-function
# functions/myfunction.pp
function mymodule::myfunction(Array[String] $domains) >> Array {
$result = $domains.map |$domain| {
{
"${domain}/.../*" => { 'include' => true }
}
}
$result
@riton
riton / webserver.conf
Created August 22, 2017 11:34
PuppetServer WebServer configuration
webserver: {
port: 8080
[... other SSL related options ...]
}
@riton
riton / random_uuid.go
Created September 19, 2017 10:06
Go test question
package uuidutils
import (
"fmt"
"github.com/google/uuid"
)
// GetNewRandomUUID Generate a new random uuid
func GetNewRandomUUID() (nuuid string, err error) {
@riton
riton / ssh.rb.diff
Created October 10, 2017 21:21
bolt ssh GSS-API hack
diff --git a/.bundle/ruby/2.3.0/gems/bolt-0.5.0/lib/bolt/node/ssh.rb b/.bundle/ruby/2.3.0/gems/bolt-0.5.0/lib/bolt/node/ssh.rb
index d4b33ea..ffd7168 100644
--- a/.bundle/ruby/2.3.0/gems/bolt-0.5.0/lib/bolt/node/ssh.rb
+++ b/.bundle/ruby/2.3.0/gems/bolt-0.5.0/lib/bolt/node/ssh.rb
@@ -1,4 +1,5 @@
require 'net/ssh'
+require 'net/ssh/krb'
require 'net/sftp'
require 'json'
require 'bolt/node/result'
@riton
riton / hiera.yaml
Created February 27, 2018 13:20
hiera-eyaml-gpg gpg_gnupghome configuration
version: 5
defaults:
data_hash: 'yaml_data'
hierarchy:
- name: "EYAML backend"
lookup_key: 'eyaml_lookup_key'
paths:
- "default.yaml"
@riton
riton / v1.0.0-init.pp
Last active June 29, 2018 13:36
Upgrading types and introducing new parameters
class mymodule {
mytype { "title":
param1 => "FOO"
}
}
@riton
riton / test.rb
Created July 5, 2018 14:05
ruby dynamically add path to gem load path
#!/usr/bin/env ruby
ENV['GEM_PATH'] = "/path/to/directory"
require 'mygem'
if __FILE__ == $0
end
@riton
riton / naemon_servicedependency.conf
Last active April 8, 2019 09:11
Naemon servicedependency using comas - Full configuration at https://github.com/riton/naemon_servicedependencies_irc
define servicedependency {
hostgroup_name httpd_worker,httpd_proxy
service_description check httpd proc
dependent_host_name http-client
dependent_service_description check get http app health,check get http app statistics
execution_failure_criteria w,u,c
notification_failure_criteria w,u,c
}
@riton
riton / puppet-modules-update-dephell-01.pp
Last active November 22, 2019 18:16
puppet-modules-update-dephell-01
# Install and configure Apache HTTP server with default values
include apache
@riton
riton / puppet-modules-update-dephell-02.pp
Last active November 22, 2019 18:20
puppet-modules-update-dephell-02
include apache
# Configure a virtual host to use SSL and specific SSL certificates
apache::vhost { 'cert.example.com':
port => '443',
docroot => '/var/www/cert',
ssl => true,
ssl_cert => '/etc/ssl/fourth.example.com.cert',
ssl_key => '/etc/ssl/fourth.example.com.key',
}