This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r = aug_match(aug, "/augeas/files/etc/yum.repos.d/new.repo/path", NULL); | |
CuAssertIntEquals(tc, 0, r); | |
r = aug_set(aug, "/files/etc/yum.repos.d/new.repo/newrepo/baseurl", | |
"http://foo.com/"); | |
CuAssertIntEquals(tc, 0, r); | |
r = aug_save(aug); | |
CuAssertIntEquals(tc, 0, r); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exec {'Avoid multiple mcollectived': | |
path => '/usr/bin:/usr/sbin:/bin', | |
command => 'pkill -f mcollectived', | |
onlyif => 'test `pgrep -f mcollectived | wc -l` -gt 1', | |
notify => Service['mcollective'], | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_mco() | |
{ | |
local cur cmd agents | |
COMPREPLY=() | |
cur=${COMP_WORDS[COMP_CWORD]} | |
prev=${COMP_WORDS[COMP_CWORD-1]} | |
cmd=${COMP_WORDS[0]} | |
if [ $COMP_CWORD -eq 1 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mco augeas match /augeas//error -t 10 | grep '/augeas' | sort | uniq -c | sort -nr | |
32 /augeas/files/etc/nagios3/resource.cfg/error = parse_failed | |
31 /augeas/files/etc/nagios3/commands.cfg/error = parse_failed | |
26 /augeas/files/etc/modprobe.d/aliases.conf/error = parse_failed | |
22 /augeas/files/etc/default/dhcpcd/error = parse_failed | |
16 /augeas/files/etc/nagios3/cgi.cfg/error = parse_failed | |
6 /augeas/files/etc/apt/preferences/error = parse_failed | |
5 /augeas/files/etc/apt/apt.conf.d/01proxy/error = parse_failed | |
1 /augeas/files/etc/postgresql/9.0/main/pg_hba.conf/error = parse_failed | |
1 /augeas/files/etc/default/varnish/error = parse_failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NODESDIR="${1:-${HOME}/puppetmaster/manifests/nodes}" | |
ret=0 | |
mcofqdn=$(mco facts fqdn | sed -n 's@found@ found@p') # circumvent bug in mco | |
morethanonce=$(grep ' [0-9]*[^1] times' <<<"$mcofqdn") | |
[[ -n $morethanonce ]] \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MCollective::Application::Healthcheck<MCollective::Application | |
description "Compare nodes in puppet and mcollective" | |
usage "Usage: healthcheck [OPTIONS]" | |
option :nodesdir, | |
:description => "The directory where .pp node files are stored", | |
:arguments => ["--nodesdir <NODESDIR>"] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Facter.add("public_ip") do | |
setcode do | |
Facter::Util::Resolution.exec('/usr/bin/curl -s http://ifconfig.me/ip') | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class foo::config { | |
resource {'baz': | |
param => somevalue | |
} | |
} | |
class foo::master { | |
include foo::config | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"icon" : "http://nominatim.openstreetmap.org/images/mapicons/poi_boundary_administrative.p.20.png", | |
"boundingbox" : [ | |
"45.3524627685547", | |
"45.9385185241699", | |
"5.62203693389893", | |
"6.298264503479" | |
], | |
"licence" : "Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ augcheck test.xml Xml | |
Test result: /tmp/augcheck.C6ia30/parse_file.aug:3.0-.47: | |
{ "str" | |
{ "#attribute" | |
{ "name" = "masterUrl" } | |
} | |
{ "#text" = "http://MY_SOLR_MASTER:8085/solr/files3/replication" } | |
} |
OlderNewer