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
node nonrootuser { | |
file { 'C:\Users\nonrootuser\Desktop\nonroot_Puppet_Agent_run_30m.xml': | |
ensure => file, | |
} | |
exec { 'myscript': | |
command => 'C:\Windows\System32\schtasks.exe /Create /XML C:\Users\nonrootuser\Desktop\nonroot_Puppet_Agent_run_30m.xml /RU WINDOWS\nonrootuser /RP Pupp3t! /tn nonroot_puppet_agent_run', | |
unless => 'C:\Windows\System32\schtasks.exe /Query /TN nonroot_puppet_agent_run', |
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
class nonpriv_setup { | |
define nonpriv_pe_user ( | |
$password, | |
$nonpriv_user=$name, | |
$ensure='present', # 'present' or 'absent' | |
$certname=$nonpriv_user, | |
$server='puppet', # puppet master | |
$enable_sched_task=true, # true or false | |
$run_interval_mins='30', # in minutes, one of 5, 10, 15, 30, 60 |
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
# /opt/puppet/lib/ruby/site_ruby/1.9.1/puppet/reports/http.rb | |
# http://devsops.blogspot.com/2013/04/3.html | |
def process | |
raw_urls = Puppet[:reporturl] | |
url_array = raw_urls.gsub!(/\s+/, "").split(',') | |
url_array.each do |url| | |
#url = URI.parse(Puppet[:reporturl]) | |
body = self.to_yaml | |
headers = { "Content-Type" => "application/x-yaml" } |
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
git push origin --delete dev | |
git branch -d dev | |
git branch -D dev |
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
1) Put these files on the master and the staging server which has PE installed (2 files on 2 servers) | |
2) `service pe-mcollective restart` on the master and staging server | |
3) try it! mco rpc stageit run manifest="ZmlsZSB7ICcvdG1wL2Zvbyc6CiAgZW5zdXJlID0+IGRpcmVjdG9yeSwKfQoK" -I centos65a | |
# /opt/puppet/libexec/mcollective/mcollective/agent/stageit.rb on Linux | |
module MCollective | |
module Agent | |
class Stageit<RPC::Agent | |
activate_when do |
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
cd REPONAME | |
git init | |
git add . | |
git commit -m 'initial commit' -a | |
git remote add origin git@YOUR_SERVER_HOSTNAME:REPONAME | |
git push origin master:refs/heads/master |
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
puppet master --compile master --debug |less -R | |
--- | |
test::ipaddress: "%{hiera('ipaddress')}" |
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
#!/bin/bash | |
MANIFEST=$(cat) | |
echo class $1 { | |
echo "$MANIFEST" | sed 's/^/ /' | |
echo } |
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
<enforce> | |
<a></a> | |
<b></b> | |
</enforce> | |
<simulate> | |
<a></a> | |
<b></b> | |
</simulate> |
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
class mydb { | |
class { 'mysql::server': | |
root_password => 'Pupp3tlabs!', | |
override_options => { | |
'mysqld' => { 'datadir' => '/tmp/lib/mysql', 'log-error' => '/tmp/log/jeremysql.log' }, | |
}, | |
} | |
mysql::db { 'mydb': | |
user => 'myuser', |
OlderNewer