Skip to content

Instantly share code, notes, and snippets.

{"@source":"file://logstashbox.local/root/log/MachineA/access_log","@tags":[],"@fields":{"clientip":["127.0.0.1"],"ident":["-"],"auth":["-"],"timestamp":["05/Dec/2012:21:11:01 +0000"],"verb":["GET"],"request":["/someplace"],"httpversion":["1.0"],"response":["200"],"bytes":["597096"],"referrer":["\"-\""],"agent":["\"Wget/1.11.4 Red Hat modified\""]},"@timestamp":"2012-12-07T18:21:13.581Z","@source_host":"logstashbox.local","@source_path":"/root/log/MachineA/access_log","@message":"127.0.0.1 - - [05/Dec/2012:21:11:01 +0000] \"GET /someplace HTTP/1.0\" 200 597096 \"-\" \"Wget/1.11.4 Red Hat modified\" \"-\"","@type":"apache-access"}
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error Psych::SyntaxError: (/etc/puppet/hiera.yaml): found character that cannot start any token while scanning for the next token at line 8 column 5 at /etc/puppet/environments/production/manifests/nodes/mymachine.pp:5 on node mymachine.mycompany.local
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
#!/bin/bash
#curl -XPUT 'http://logmon.myworkplace.local:9200/_template/template_logstash/' -d '
curl -XPUT 'http://localhost:9200/_template/template_logstash/' -d '
{
"template": "logstash-*",
"settings" : {
"index" : {
"query" : { "default_field" : "@message" },
[root@puppet modules]# puppet module --debug --environment development install puppetlabs/firewall
Notice: Preparing to install into /etc/puppet/environments/development/modules ...
Notice: Downloading from https://forge.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
Debug: Executing 'tar xzf /var/lib/puppet/puppet-module/cache/https_forge_puppetlabs_com-ed3a0e51b3c1d8d395ffb1d12c849e3f50d35a10/puppetlabs-firewall-0.4.1.tar.gz --no-same-permissions --no-same-owner -C /var/lib/puppet/puppet-module/cache/tmp-unpacker-905e121ba23b6f260f48b911790776d6fff2eea2'
Debug: Executing 'find /var/lib/puppet/puppet-module/cache/tmp-unpacker-905e121ba23b6f260f48b911790776d6fff2eea2 -type d -exec chmod 755 {} +'
Debug: Executing 'find /var/lib/puppet/puppet-module/cache/tmp-unpacker-905e121ba23b6f260f48b911790776d6fff2eea2 -type f -exec chmod 644 {} +'
Debug: Executing 'chown -R 0:52 /var/lib/puppet/puppet-module/cache/tmp-unpacker-905e121ba23b6f260f48b911790776d6fff2eea2'
Error: No such file or directory - /e
@frozenfoxx
frozenfoxx / gist:6600914
Created September 17, 2013 21:29
PuppetDB logrotate script
/var/log/puppetdb/puppetdb.log {
weekly
missingok
rotate 12
compress
copytruncate
notifempty
create 640 puppetdb puppetdb
}
[root@puppet 1.8]# facter
/usr/lib/ruby/site_ruby/1.8/facter/util/config.rb:1:in `require': no such file to load -- rbconfig (LoadError)
from /usr/lib/ruby/site_ruby/1.8/facter/util/config.rb:1
from /usr/lib/ruby/site_ruby/1.8/facter/util/resolution.rb:7:in `require'
from /usr/lib/ruby/site_ruby/1.8/facter/util/resolution.rb:7
from /usr/lib/ruby/site_ruby/1.8/facter/util/fact.rb:2:in `require'
from /usr/lib/ruby/site_ruby/1.8/facter/util/fact.rb:2
from /usr/lib/ruby/site_ruby/1.8/facter.rb:23:in `require'
from /usr/lib/ruby/site_ruby/1.8/facter.rb:23
from /usr/lib/ruby/site_ruby/1.8/facter/application.rb:21:in `require'
Tue Sep 24 11:12:54 -0500 2013 Puppet (notice): Not Acceptable: No supported formats are acceptable (Accept: yaml, b64_zlib_yaml, raw)
@frozenfoxx
frozenfoxx / gist:6721658
Created September 26, 2013 22:47
Example repo.yaml for puppet-repo
---
repositories:
EPEL_6:
url: 'http://download.fedoraproject.org/pub/epel/6/$basearch'
descr: 'Extra Packages for Enterprise Linux 6 - $basearch'
status: 1
yourrepo:
url: 'http://repo.company.net/pub/company/$basearch'
descr: 'Custom packages for company.net'
status: 1
@frozenfoxx
frozenfoxx / gist:6769230
Last active December 24, 2015 08:18
Dysfunctional Puppet code for doing a hiera lookup and realize.
# Puppet Master
node "puppet.somecompany.local" inherits default {
notice ( "Notice from puppetmaster" )
$repositories = hiera_hash('centos5repositories')
create_resources('yumrepo', $repositories)
class { 'hosts': hostClass => 'somelocation' }
class { 'ntp': ntpClass => 'client' }
class { 'sudo': sudoUsers => [user1,user2,user3] }
# PuppetDB
node "puppetdb.somecompany.local" inherits default {
class { 'puppetdb::database::postgresql':
listen_addresses => 'puppetdb.somecompany.local',
}
class { 'puppetdb::server':
database_host => 'puppetdb.somecompany.local',
database => 'postgres',
database_username => 'puppetdb',
database_password => 'somepass',