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
| # crm_support: true/nil | |
| # Whether there is Pacemaker installed | |
| Facter.add('crm_support') do | |
| confine :kernel => :linux | |
| setcode do | |
| not Facter::Util::Resolution.exec('which crm_resource').empty? | |
| 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
| export GH_USER="raphink" | |
| ## Github helpers | |
| function gh_exists_remote { | |
| local repo="$1" | |
| git remote | grep -q "^${repo}$" \ | |
| && return 0 || return 1 | |
| } |
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
| 1.9.2-p320 :001 > require 'puppet/file_serving/metadata' | |
| => true | |
| 1.9.2-p320 :002 > metadata = Puppet::FileServing::Metadata.new('/etc/passwd', :path => '/etc/passwd') | |
| => #<Puppet::FileServing::Metadata:0x00000003ec5538 @owner=nil, @group=nil, @mode=nil, @checksum_type="md5", @ftype=nil, @destination=nil, @path="/etc/passwd", @links=:manage> | |
| 1.9.2-p320 :003 > metadata.collect | |
| => "{md5}dddc7650ed8195d4c3738c4bbe1beebd" |
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
| $ augtool -I lenses/ --transform "Desktop.lns incl /usr/share/app-install/desktop/vagalume:vagalume.desktop" print /files/usr/share/app-install/desktop/vagalume:vagalume.desktop/files/usr/share/app-install/desktop/vagalume:vagalume.desktop | |
| /files/usr/share/app-install/desktop/vagalume:vagalume.desktop/Desktop Entry | |
| /files/usr/share/app-install/desktop/vagalume:vagalume.desktop/Desktop Entry/X-AppInstall-Package = "vagalume" | |
| /files/usr/share/app-install/desktop/vagalume:vagalume.desktop/Desktop Entry/X-AppInstall-Popcon = "41" | |
| /files/usr/share/app-install/desktop/vagalume:vagalume.desktop/Desktop Entry/X-AppInstall-Section = "universe" | |
| /files/usr/share/app-install/desktop/vagalume:vagalume.desktop/Desktop Entry/Version = "1.0" | |
| /files/usr/share/app-install/desktop/vagalume:vagalume.desktop/Desktop Entry/Type = "Application" | |
| /files/usr/share/app-install/desktop/vagalume:vagalume.desktop/Desktop Entry/Categories = "Audio;AudioVideo;GNOME;GTK;Application;Player;" | |
| /files/usr/share/app-install/desktop/vagalume:vagal |
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
| require 'mcollective' | |
| include MCollective::RPC | |
| c = rpcclient("rpcutil") | |
| c.discovery_method="mc" | |
| all_nodes = c.discover.clone | |
| all_nodes.in_groups_of(5) do |nodes| |
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
| #!/usr/bin/env ruby | |
| require 'mcollective' | |
| include MCollective::RPC | |
| mc = rpcclient('fsfreeze') | |
| mc.discovery_method = 'mc' | |
| all_nodes = mc.discover.clone |
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 | |
| URL=$1 | |
| # ugly parsing | |
| IFS='/' read prot empty serv user mod tarball <<<"$URL" | |
| mkdir -p "$user/$mod" | |
| wget "$URL" -O "$user/$mod/$user-$mod-$tarball" |
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
| Augeas.open do |aug| | |
| aug.match('/files/etc/default//#comment').each_with_index do |p, i| | |
| aug.set("/comments/raw/#{i}", "#{aug.get(p)}\n") | |
| aug.text_store('Shellvars.lns', "/comments/raw/#{i}", "/comments/tree/#{i}") | |
| 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
| <augeas match="/files/etc/fstab"> | |
| <node label="fstab" file="/etc/fstab" span_label_start="0" span_label_end="0" span_value_start="0" span_value_end="0" span_span_start="0" span_span_end="692" path="/files/etc/fstab"> | |
| <node label="#comment" file="/etc/fstab" span_label_start="0" span_label_end="0" span_value_start="2" span_value_end="45" span_span_start="0" span_span_end="46"> | |
| <value>/etc/fstab: static file system information.</value> | |
| </node> | |
| <node label="#comment" file="/etc/fstab" span_label_start="0" span_label_end="0" span_value_start="50" span_value_end="121" span_span_start="48" span_span_end="122"> | |
| <value>Use 'blkid -o value -s UUID' to print the universally unique identifier</value> | |
| </node> | |
| <node label="#comment" file="/etc/fstab" span_label_start="0" span_label_end="0" span_value_start="124" span_value_end="194" span_span_start="122" span_span_end="195"> | |
| <value>for a device; this may be used with UUID= as a more robust way to name</value> |
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
| define sudo::defaults::env_keep { | |
| augeas { "set env_keep defaults for ${name}": | |
| context => '/files/etc/sudoers', | |
| changes => [ | |
| "defnode s Defaults[env_keep/var='${name}']/env_keep[var='${name}']/append 'blah'", | |
| 'clear $s', | |
| "set \$s/../var[.='${name}'] '${name}'", | |
| ], | |
| } | |
| } |