This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## mysql::master | |
ruby_block "store_mysql_master_status" do | |
block do | |
node.set[:mysql][:master] = true | |
m = Mysql.new("localhost", "root", node[:mysql][:server_root_password]) | |
m.query("show master status") do |row| | |
row.each_hash do |h| | |
node.set[:mysql][:master_file] = h['File'] | |
node.set[:mysql][:master_position] = h['Position'] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Rakefile for Chef Server Repository | |
# | |
# Author:: Adam Jacob (<adam@opscode.com>) | |
# Copyright:: Copyright (c) 2008 Opscode, Inc. | |
# License:: Apache License, Version 2.0 | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
activate :deploy do |deploy| | |
deploy.build_before = true | |
deploy.method = :rsync | |
deploy.host = "hostname.com" | |
deploy.path = "/opt/sites/hostname.com" | |
deploy.user = "deploy" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"run_list": [ | |
"role[hostname-setup]" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name sitename.com; | |
access_log /var/log/nginx/sitename.access.log; | |
root /opt/sites/sitename.com; | |
index index.html index.htm; | |
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf)$ { | |
expires max; | |
access_log off; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
directory "/opt/sites" do | |
owner "deploy" | |
group "deploy" | |
mode 00755 | |
action :create | |
end | |
directory "/opt/sites/sitename.com" do | |
owner "deploy" | |
group "deploy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "deploy", | |
"comment": "Deploy User", | |
"groups": ["sysadmin","devops","developers"], | |
"email": "email of user", | |
"shell": "\/bin\/zsh", | |
"home": "\/home\/deploy", | |
"ssh_keys": ["public ssh key"], | |
"ssh_keygen": false, | |
"dotfiles": "https://github.com/username/dotfiles.git" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include_recipe "git" | |
search( :users, "dotfiles:*" ).each do |u| | |
user_id = u["id"] | |
directory "/home/#{user_id}/bin" do | |
owner user_id | |
group user_id | |
mode "0755" | |
action :create | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name "base" | |
description "base role" | |
run_list [ | |
"recipe[chef-solo-search]", | |
"recipe[apt]", | |
"recipe[apt-update]", | |
"recipe[ntp]", | |
"recipe[git]", | |
"recipe[zsh]", | |
"recipe[tmux]", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newpost() { | |
middleman article $1 | |
vim `gsts |awk '{print \$2}'` | |
} | |