This file contains 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
------------------macauth.pp----------------------- | |
#!/usr/bin/env puppet | |
macauthorization { 'system.device.dvd.setregion.initial': | |
auth_class => 'user', | |
comment => 'Changed by Puppet - Used by DVD Player for Region Code', | |
group => 'staff', | |
shared => 'true', | |
This file contains 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 facts--------- | |
facter | |
domain => local | |
facterversion => 1.5.8 | |
fqdn => malone-shawstudents-shel.local | |
hardwaremodel => Power Macintosh | |
hostname => malone-shawstudents-shel | |
interfaces => lo0,gif0,stf0,en0,fw1 | |
ipaddress => 10.13.0.151 |
This file contains 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
# | |
# This script captures the Applecare Coverage End Date of an Apple Computer | |
# | |
# | |
require 'facter' | |
# First grab the serial number from Facter. | |
$sn = Facter.value(:sp_serial_number) |
This file contains 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
[main] | |
external_nodes = /usr/bin/rubyexternalnode.rb | |
node_terminus = exec | |
pluginsync = true | |
libdir = $vardir/lib | |
[master] | |
ssl_client_header = SSL_CLIENT_S_DN | |
ssl_client_verify_header = SSL_CLIENT_VERIFY | |
reports = http |
This file contains 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
# main config | |
topicprefix = /topic/mcollective | |
libdir = /Library/Ruby/Site/1.8/mcollective | |
logfile = /var/log/mcollective.log | |
daemonize = 1 | |
keeplogs = 1 | |
max_log_size = 10240 | |
loglevel = debug | |
identity = fqdn | |
registerinterval = 300 |
This file contains 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
-------Server.cfg and Angelia Plugin--------- | |
bash-3.2# cat /etc/mcollective/server.cfg | |
# main config | |
topicprefix = /topic/mcollective | |
libdir = /etc/mcollective/plugins | |
logfile = /var/log/mcollective.log | |
daemonize = 1 | |
keeplogs = 1 | |
max_log_size = 10240 |
This file contains 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
##Getting Errors Like This | |
Nov 22 09:47:17 lagando-shawstaff-shel com.apple.launchd[1] (com.huronhs.mcollective): Throttling respawn: Will start in 10 seconds | |
Nov 22 09:47:17 lagando-shawstaff-shel com.apple.launchd[1] (0x1004015a0.anonymous.ruby[1644]): Failed to add kevent for PID 1644. Will unload at MIG return | |
Nov 22 09:47:27 lagando-shawstaff-shel com.apple.launchd[1] (com.huronhs.mcollective): Throttling respawn: Will start in 10 seconds | |
Nov 22 09:47:47: --- last message repeated 2 times --- | |
Nov 22 09:47:47 lagando-shawstaff-shel com.apple.launchd[1] (0x100406640.anonymous.ruby[1663]): Failed to add kevent for PID 1663. Will unload at MIG return | |
## Here's the plist |
This file contains 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
### Module | |
module MCollective | |
module Agent | |
# A simpleRPC Agent that replies with each active config setting. | |
# | |
class Confignotify<RPC::Agent | |
action get_config | |
config = Config.instance |
This file contains 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
## The /etc/mcollective/facts.yaml File | |
bash-3.2# cat /etc/mcollective/facts.yaml | |
--- | |
sp_number_processors: "2" | |
kernelmajversion: "10.5" | |
clientversion: &id001 2.6.2 | |
macosx_productversion_major: "10.6" | |
sp_machine_name: MacBook Pro | |
fcupdate: firstclass10.013.dmg |
This file contains 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 'facter' | |
if Facter.value('kernel') == 'Darwin' | |
# First grab the serial number. For some reason I can't get it from Facter | |
sn = %x{ioreg -l | grep IOPlatformSerialNumber | sed -e s/\\"//g}.chomp.split{"="}[-1].chomp | |
url = "https://selfsolve.apple.com/Warranty.do?serialNumber=#{sn}&country=USA&fullCountryName=United%20States" | |
# Next fetch warranty information from Apple, convert the resulting json to a hash | |
warranty_info = eval %x{curl -k -s "#{url}"}.split(',').each { |element| | |
element.sub! ':', ' => ' |