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
version: "3.1"
services:
puppet:
build: .
image: camptocamp/puppetserver:arbitrary_user
hostname: puppet.camptocamp.com
user: "12345678"
volumes:
- ./code:/etc/puppetlabs/code:ro
- puppetca:/etc/puppetlabs/puppet/ssl/ca:rw
---
version: '2.0'
services:
showoff:
image: binford2k/showoff:0.19.6
ports:
- "9090:9090"
volumes:
- ".:/var/cache/showoff"
command: showoff serve -f ${PROJECT}.json
$foo = Deferred('augeas::get', ["/files/etc/default/toto/FOO"])
augeas { 'add to FOO':
context => '/files/etc/default/toto',
changes => Deferred('sprintf', ["set FOO '%s,bar'", $foo])
}
@raphink
raphink / hiera.yaml
Last active September 20, 2018 11:44
hierarchies:
- name: "Hostgroups"
mapped_paths: [hostgroup_list, hg, "hostgroups/%{hg}.yaml"]
###############################################
# This file is managed in puppetmaster-common #
# Do not edit locally #
###############################################
<%= require 'augeas'
basedir = File.expand_path('..', File.dirname(__FILE__))
base_pf = File.expand_path(File.join(basedir, 'Puppetfile'))
base_pf_content = File.read(base_pf)
lens_dir = File.expand_path(File.join(basedir, 'lenses'))
#!/usr/bin/env ruby
require 'csv'
FILE1, FILE2, FILE3 = ARGV
HEADER = [ 'RSID', 'CHROMOSOME' , 'POSITION' , 'RESULT' ]
def phase(file1, file2)
csv1 = CSV.read(file1)[1..-1]
@raphink
raphink / upgrade.md
Last active July 24, 2018 11:51
Postgresql cluster version upgrade in Rancher
  • Stop postgres cluster stack
  • Launch Docker-postgresl-upgrade container (global) pointing to pgdata and pgdata96 volumes
  • Start new postgres stack pointing to pgdata96
Resolving settings from section 'agent' in environment 'production'
Resolving settings from section 'agent' in environment 'production'
Resolving settings from section 'agent' in environment 'production'
Resolving settings from section 'agent' in environment 'production'
Resolving settings from section 'agent' in environment 'production'
Warning: Downgrading to PSON for future requests
Error: Could not request certificate: The CSR retrieved from the master does not match the agent's public key.
CSR fingerprint: 4B:3A:9F:EA:63:3D:44:93:2F:D1:67:C6:72:FC:24:A6:48:BB:69:50:51:EB:D3:9C:60:78:EC:09:DE:D7:AD:B4
CSR public key: Public-Key: (4096 bit)
Modulus:
require 'augeas'
aug = Augeas.open(nil, nil, Augeas::NO_MODL_AUTOLOAD)
file = '/tmp/somexml.xml'
aug.transform(
:lens => 'Xml.lns',
:name => 'Xml',
:incl => file,
class hosts {
$hosts = query_facts('Class[Settings]', ['fqdn', 'ipaddress', 'hostname'])
create_resources('hosts::host', $hosts)
}
define hosts::host (
$fqdn,
$ipaddress,
$hostname,
) {