Skip to content

Instantly share code, notes, and snippets.

View jpadams's full-sized avatar

Jeremy Adams jpadams

View GitHub Profile
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
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
puppet master --compile master --debug |less -R
---
test::ipaddress: "%{hiera('ipaddress')}"
#!/bin/bash
MANIFEST=$(cat)
echo class $1 {
echo "$MANIFEST" | sed 's/^/ /'
echo }
<enforce>
<a></a>
<b></b>
</enforce>
<simulate>
<a></a>
<b></b>
</simulate>
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',
#!/opt/puppet/bin/ruby
require 'yaml'
require 'base64'
runlist = YAML.load_file(ARGV[0])
runlist.each do |manifest, node|
text = File.read(manifest)
encoded = Base64.strict_encode64(text)
puts "applying #{manifest} on #{node}"
#!/opt/puppet/bin/ruby
require 'yaml'
require 'base64'
runlist = YAML.load_file(ARGV[0])
runlist.each do |manifest, node|
text = File.read(manifest)
encoded = Base64.strict_encode64(text)
puts "applying #{manifest} on #{node}"
curl --cacert `puppet agent --configprint localcacert` --cert `puppet agent --configprint hostcert` --key `puppet agent --configprint hostprivkey` --insecure https://localhost:4433/classifier-api/v1/environments
curl --cacert `puppet agent --configprint localcacert` --cert `puppet agent --configprint hostcert` --key `puppet agent --configprint hostprivkey` --insecure https://localhost:4433/classifier-api/v1/nodes
curl --cacert `puppet agent --configprint localcacert` --cert `puppet agent --configprint hostcert` --key `puppet agent --configprint hostprivkey` --insecure https://localhost:4433/classifier-api/v1/groups
curl --cacert `puppet agent --configprint localcacert` --cert `puppet agent --configprint hostcert` --key `puppet agent --configprint hostprivkey` --insecure https://localhost:4433/classifier-api/v1/classes
curl --cacert `puppet agent --configprint localcacert` --cert `puppet agent --configprint hostcert` --key `puppet agent --configprint hostprivkey` --insecure https://localhost:4433/classifie
#! /bin/bash
PUPPET='/opt/puppet/bin/puppet'
$PUPPET module install stahnma-epel --version '0.0.6'
$PUPPET module install elasticsearch-elasticsearch --version '0.3.2'
$PUPPET module install gini-archive --version '0.2.0'
$PUPPET module install dwerder-graphite --version '5.3.3'
cd `$PUPPET config print modulepath | cut -d: -f1`