Skip to content

Instantly share code, notes, and snippets.

View roidelapluie's full-sized avatar
🔥

Julien roidelapluie

🔥
  • O11y
View GitHub Profile
@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:
file {
'initial-config':
path => "${config_file}.bak",
source => "${config_file}",
replace => no,
}
exec {
'rm config':
command => "rm ${initial-config}",
subscribe => File['initial-config'],
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"]
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
TMPFILE=$(mktemp)
cat << EOM >$TMPFILE
node testnode {
class {
'sshd':
rootlogin => 'without-password'
}
}
EOM
$ puppet-lint $TMPFILE
sdfsdfqfds