Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| 2017/09/22 09:48:59 [DEBUG] (logging) enabling syslog on LOCAL5 | |
| 2017/09/22 09:48:59.105623 [INFO] consul-template v0.19.3 (ebf2d3d) | |
| 2017/09/22 09:48:59.105670 [INFO] (runner) creating new runner (dry: false, once: false) | |
| 2017/09/22 09:48:59.106014 [DEBUG] (runner) final config: {"Consul":{"Address":"","Auth":{"Enabled":false,"Username":"","Password":""},"Retry":{"Attempts":12,"Backoff":250000000,"MaxBackoff":60000000000,"Enabled":true},"SSL":{"CaCert":"","CaPath":"","Cert":"","Enabled":false,"Key":"","ServerName":"","Verify":true},"Token":"","Transport":{"DialKeepAlive":30000000000,"DialTimeout":30000000000,"DisableKeepAlives":false,"IdleConnTimeout":90000000000,"MaxIdleConns":100,"MaxIdleConnsPerHost":17,"TLSHandshakeTimeout":10000000000}},"Dedup":{"Enabled":false,"MaxStale":2000000000,"Prefix":"consul-template/dedup/","TTL":15000000000},"Exec":{"Command":"","Enabled":false,"Env":{"Blacklist":[],"Custom":[],"Pristine":false,"Whitelist":[]},"KillSignal":2,"KillTimeout":30000000000,"ReloadSignal":null,"Splay": |
| curl -o /tmp/sumo.sh https://collectors.sumologic.com/rest/download/linux/64 | |
| sh /tmp/sumo.sh -q -dir "/usr/local/SumoCollector" | |
| /etc/init.d/collector stop | |
| cat > /usr/local/SumoCollector/config/custom_sources.json << END | |
| { | |
| "api.version": "v1", | |
| "sources": [ | |
| { | |
| "sourceType": "LocalFile", | |
| "name": "LocalAuth", |
| reservations = ec2.get_all_instances(filters={"tag:Purpose": "Web"}) | |
| for res in reservations: | |
| for inst in res.instances: | |
| if inst.private_ip_address: | |
| if inst.state == 'running': | |
| print inst.private_ip_address |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| # Every Vagrant virtual environment requires a box to build off of. | |
| # Named boxes, like this one, don't need a URL, since the are looked up |
This uses terraform's template_file resource to generate a yaml properties file for serverspec to use.
spec directory and put spec_helper.rb in ittemplates/properties.tmpl.yml fileserverspec.tfterraform applyTests will be matched based on roles defined for a given node.
| require 'rake' | |
| require 'rspec/core/rake_task' | |
| require 'yaml' | |
| require 'highline/import' | |
| properties = YAML.load_file('properties.yaml') | |
| ENV['SSH_USER'] = ask("Enter ssh user: ") { |q| q.echo = true } | |
| ENV['SSH_PASSWORD'] = ask("Enter ssh password: ") { |q| q.echo = false } |
| #!/usr/bin/env python | |
| """ | |
| ec2-autoscale-instance.py | |
| Read Autoscale DNS from AWS | |
| Sample config file, | |
| { | |
| "access_key": "key", |
| global | |
| maxconn 4096 # Total Max Connections. This is dependent on ulimit | |
| nbproc 2 | |
| log 127.0.0.1 local1 notice | |
| defaults | |
| mode http | |
| log global | |
| frontend all 0.0.0.0:80 |
| #!/bin/bash | |
| apt-get install -y curl unzip | |
| mkdir -p /var/lib/consul | |
| mkdir -p /usr/share/consul | |
| mkdir -p /etc/consul/conf.d | |
| curl -OL https://dl.bintray.com/mitchellh/consul/0.3.1_linux_amd64.zip | |
| unzip 0.3.1_linux_amd64.zip | |
| mv consul /usr/local/bin/consul |