Skip to content

Instantly share code, notes, and snippets.

View roidelapluie's full-sized avatar
🔥

Julien roidelapluie

🔥
  • O11y
View GitHub Profile
sdfsdfqfds
TMPFILE=$(mktemp)
cat << EOM >$TMPFILE
node testnode {
class {
'sshd':
rootlogin => 'without-password'
}
}
EOM
$ puppet-lint $TMPFILE
define timeperiod{
name be-holidays
timeperiod_name be-holidays
alias Belgian holidays
january 1 00:00-00:00 ; New Year
may 1 00:00-00:00 ; Labour Day
july 21 00:00-00:00 ; National holiday
august 15 00:00-00:00 ; Assumption of Mary
november 1 00:00-00:00 ; All Saints
exec {
"Clean repo for $package_name":
command => "yum clean all --disablerepo='*' --enablerepo='$repository'",
path => '/usr/bin',
}
package{
"$package_name":
ensure => latest,
require => Exec["Clean repo for $package_name"]
file {
'initial-config':
path => "${config_file}.bak",
source => "${config_file}",
replace => no,
}
exec {
'rm config':
command => "rm ${initial-config}",
subscribe => File['initial-config'],
@roidelapluie
roidelapluie / fix-dashboard-config.py
Created July 1, 2013 09:39
In the jenkins configuration /var/lib/jenkins/config.xml, in the dashboard views, you must pass the jobs in alphabetical order. But if you manipulate the file externally and you alter the jobs list, the jobs that are not in alphabetical order won't appear in the view. This script reorders them.
#!/usr/bin/python
# This script will re-order the scripts the the jenkins dashboard views
# If the jobs are sorted alphabetically, all the jobs do not appear
# inside the view.
# This script fixes this issues.
# USAGE: fix-dashboard-config.py /var/lib/jenkins/config.xml
import sys
try:
from lxml import etree
except ImportError:
x=['x']
for i in x:
x.append('x')
print len(x)
@roidelapluie
roidelapluie / site.pp
Created September 3, 2014 08:27
Allow virtual workaround
if $::puppetversion =~ /^3.6.[12]/ {
Package {
allow_virtual => true,
}
}
### Keybase proof
I hereby claim:
* I am roidelapluie on github.
* I am roidelapluie (https://keybase.io/roidelapluie) on keybase.
* I have a public key whose fingerprint is 19E6 703D 4113 236A 4C1F B492 9ADD 8741 5AA3 2256
To claim this, I am signing this object:
class {
'foo':
service_ensure => 'running',
}
assertion { 'the service runs':
subject => Service['foo'],
attribute => 'ensure',