Skip to content

Instantly share code, notes, and snippets.

log.console = file
log.console.level = info
log.console.file = $(platform_log_dir)/console.log
log.error.file = $(platform_log_dir)/error.log
log.syslog = off
log.crash = on
log.crash.file = $(platform_log_dir)/crash.log
log.crash.maximum_message_size = 64KB
log.crash.size = 10MB
log.crash.rotation = $D0
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
{
"variables": {
"ami_id": "",
"private_subnet_id": "",
"security_group_id": "",
"packer_build_number": "",
},
"description": "ElasticSearch Image",
"builders": [
{
# Run Elasticsearch as this user ID and group ID
#ES_USER=elasticsearch
{% if es_default_es_user is defined %}ES_USER={{ es_default_es_user }}{% endif %}
#ES_GROUP=elasticsearch
{% if es_default_es_group is defined %}ES_GROUP={{ es_default_es_group }}{% endif %}
# Heap Size (defaults to 256m min, 1g max)
#ES_HEAP_SIZE=2g
{% if es_default_es_heap_size is defined %}ES_HEAP_SIZE={{ es_default_es_heap_size }}{% endif %}
var https = require('https');
var util = require('util');
exports.handler = function(event, context) {
try {
var message = JSON.parse(event.Records[0].Sns.Message);
var eventType = message.Event;
var autoScaleGroupName = message.AutoScalingGroupName;
var description = message.Description;
opts := &glacier.SetVaultNotificationsInput{
VaultName: aws.String(d.Id()),
VaultNotificationConfig: &glacier.VaultNotificationConfig{
SNSTopic: aws.String(sns_topic),
Events: aws.StringSlice(events),
},
}
#!/usr/bin/python
try:
import boto.ec2
import re
except ImportError, e:
print "failed=True msg='failed to import python module: %s'" % e
sys.exit(1)
ec2_availability_zone_uri = "http://169.254.169.254/latest/meta-data/placement/availability-zone/"
{
"transport": {
"name": "redis"
},
"redis": {
"host": "myhost"
"port": 6379
}
}
file { '/etc/nginx/sites-available/default':
ensure => file,
mode => '0755',
content => template('roles/nodejs-sample.erb')
}
/roles/templates/nodejs-sample.erb
upstream nodejs-sample {
server 127.0.0.1:5000;
class nagios_server {
#Other Puppet configuration goes here
Nagios_host<<||>>
Nagios_service<<||>>
}