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: badrefresh | |
| # | |
| # This module manages badrefresh | |
| # | |
| # Parameters: | |
| # | |
| # Actions: | |
| # | |
| # Requires: | |
| # |
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(:noop) do | |
| confine :kernel => :linux | |
| result = false | |
| setcode do | |
| unless Facter.value(:environment).match(/^(test|dev|qa)$/) | |
| result = true unless Time.now.utc.hour.between?(1, 10) | |
| 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
| ┌(10007) [gary@Garys-MBP] [puppet: 2.7.12] [ ] | |
| └(~)▷ irb | |
| >> require 'pp' | |
| => true | |
| >> bighash = { 'gary' => { 'URL' => 'http://www.google.com', 'tag' => '#puppet' }, 'tj' => { 'URL' => 'http://www.yahoo.com', 'tag' => '#ipad' } } | |
| => {"tj"=>{"tag"=>"#ipad", "URL"=>"http://www.yahoo.com"}, "gary"=>{"tag"=>"#puppet", "URL"=>"http://www.google.com"}} | |
| >> pp bighash | |
| {"tj"=>{"tag"=>"#ipad", "URL"=>"http://www.yahoo.com"}, | |
| "gary"=>{"tag"=>"#puppet", "URL"=>"http://www.google.com"}} | |
| => nil |
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
| ┌(10006) [gary@Garys-MBP] [puppet: 2.7.12] [ ] | |
| └(~)▷ irb | |
| >> hash = { 'gary' => 'portland', 'tj' => 'huron' } | |
| => {"tj"=>"huron", "gary"=>"portland"} | |
| >> hash['gary'] | |
| => "portland" | |
| >> hash['tj'] = 'lorain' | |
| => "lorain" | |
| >> hash['tj'] | |
| => "lorain" |
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
| >> puts (33..126).map{|x| ('a'..'z').include?(x.chr.downcase) ? | |
| ?> (0..9).to_a.shuffle[0].to_s + x.chr : | |
| ?> x.chr}.uniq.shuffle[0..42].join[0..42] | |
| 6N0g?2j^5q13O5H3Z6p"0K;5@9h!&>0r8:7n3D9u[}+ | |
| => nil |
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
| ┌(10424) [gary@Garys-MBP] [puppet: 2.7.10] [ pe-centos5.vmx ] | |
| └(~)▷ puppet help help help help help | |
| %%%% | |
| %%%%-( | |
| _%%%%%_/ \ ' / | |
| _%%%%%%%% - (_) - | |
| _%%%%%%%/ \% / , \ | |
| %%%%%%%%%\\ \_ | |
| %%%%%% \ \\ |
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
| Say the folder you want to package, Apache Tomcat, looks like this: | |
| apache-tomcat-7.0.25 | |
| |-- LICENSE | |
| |-- NOTICE | |
| |-- RELEASE-NOTES | |
| |-- RUNNING.txt | |
| |-- bin | |
| | |-- bootstrap.jar |
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
| RPM and FPM | |
| Install rpm-build via yum (from CentOS Updates and Base) | |
| Install fpm via rubygems (requires json gem) | |
| Creating an RPM from the apache-tomcat-7.0.25 directory and installing to /opt/tomcat/${Packagestuff} | |
| fpm -s dir -t rpm -n tomcat -v 7.0.25 --prefix /opt/tomcat -C apache-tomcat-7.0.25 | |
| Creating a Puppet Module | |
| fpm -s dir -t puppet -n tomcat -v 7.0.25 -C apache-tomcat-7.0.25 |
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/ruby | |
| #require 'parser-emit' | |
| #require 'puppet::parser' | |
| require 'puppet' | |
| class Puppet::Parser::AST::Definition | |
| attr_accessor :name | |
| end | |
| class Manifest |
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
| ## Service statuses | |
| service { 'apache2': | |
| ensure => 'running', | |
| enable => 'true', | |
| } | |
| service { 'apparmor': | |
| ensure => 'stopped', | |
| enable => 'true', | |
| } |