Skip to content

Instantly share code, notes, and snippets.

View hagzag's full-sized avatar

Haggai Philip Zagury hagzag

View GitHub Profile
@hagzag
hagzag / gist:4461919
Created January 5, 2013 14:56
using the chef-server-install
git clone https://github.com/tikalk/chef-server-install.git
cd ./chef-server-install && setup.sh all
# common tomcat attributes ::
default["tomcat"]["port"] = 8080
default["tomcat"]["ssl_port"] = 8443
default["tomcat"]["ajp_port"] = 8009
default["tomcat"]["java_options"] = "-Xmx128M -Djava.awt.headless=true"
default["tomcat"]["use_security_manager"] = false
default["tomcat"]["authbind"] = "no"
template "/etc/tomcat6/tomcat-users.xml" do
source "tomcat-users.xml.erb"
owner "root"
group "root"
mode "0644"
variables(
:users => TomcatCookbook.users,
:roles => TomcatCookbook.roles
)
notifies :restart, resources(:service => "tomcat")
<tomcat-users>
<% @roles.each do |role| -%>
<role rolename="<%= role %>" />
<% end -%>
<% @users.each do |user| -%>
<user username="<%= user['id'] %>" password="<%= user['password'] %>" roles="<%= user['roles'].join(', ') %>" />
<% end -%>
</tomcat-users>
@hagzag
hagzag / gist:5396510
Last active December 16, 2015 07:09
I'm not sure how useful this would be for you but here is another great thing you can do with Git. See readme.md @ https://github.com/hagzag/files_repo/blob/master/README.md BTW why rsync data to a git aware dir ? - just wanted to keep my files dir clean from the .git and it wasn't a matter of disk space, you could use the FILE_DIR and init git …
#!/bin/bash
ACTION=${1:-execute}
FILES_DIR=${2:-/opt/data}
MY_GIT_REPO=${3:-/opt/git-repo}
GIT_REMOTE=${4:-git@github.com:${USER}/files_repo.git}
syncfilesdir() {
src_dir=${1}
dst_dir=${2}
"builders": [
{
"boot_command": [
"<esc>",
"<wait>linux ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/anaconda-ks.cfg<enter>"
],
"boot_wait": "5s",
"disk_size": 40000,
"guest_os_type": "RedHat_64",
"headless": true,
require 'chef/provider/lwrp_base'
require 'shellwords'
require_relative 'helpers'
extend Opscode::Mysql::Helpers
class Chef
class Provider
class MysqlService
class Rhel < Chef::Provider::MysqlService
require 'chef/provider/lwrp_base'
class Chef
class Provider
class MysqlClient
class Suse < Chef::Provider::MysqlClient
use_inline_resources if defined?(use_inline_resources)
def whyrun_supported?
true
time="2015-12-10T23:38:23Z" level=debug msg="Initializing discovery service" name=consul uri="192.168.107:8500"
time="2015-12-10T23:38:23Z" level=debug msg="Initializing discovery without TLS"
time="2015-12-10T23:38:23Z" level=debug msg="Initializing strategy" name=spread
time="2015-12-10T23:38:23Z" level=debug msg="Initializing filter" name=health
time="2015-12-10T23:38:23Z" level=debug msg="Initializing filter" name=port
time="2015-12-10T23:38:23Z" level=debug msg="Initializing filter" name=dependency
time="2015-12-10T23:38:23Z" level=debug msg="Initializing filter" name=affinity
time="2015-12-10T23:38:23Z" level=debug msg="Initializing filter" name=constraint
time="2015-12-10T23:38:23Z" level=debug msg="Initializing cluster" name=swarm
time="2015-12-10T23:38:23Z" level=debug msg="Registering HTTP route" method=POST route="/images/create"
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets"
],
"Resource": "*"
},