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
service_link 'apache' do | |
version [node[:apache][:version], node[:apache][:worker]].join('-') | |
end | |
directory "/etc/httpd" do | |
owner "root" | |
group "root" | |
mode 0755 | |
action :create | |
not_if { File.exists?('/etc/httpd') } |
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
# Source accepts the protocol s3:// with the host as the bucket | |
# access_key_id and secret_access_key are just that | |
s3_file "/var/bulk/the_file.tar.gz" do | |
source "s3://your.bucket/the_file.tar.gz" | |
access_key_id your_key | |
secret_access_key your_secret | |
owner "root" | |
group "root" | |
mode 0644 | |
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
# This is the entire preseed config file used on an example Lucid system. See the preseed | |
# documentation for more information on the options here. This will use US English by default. | |
# | |
# https://help.ubuntu.com/10.04/installation-guide/amd64/preseed-contents.html | |
# | |
# This preseed will automatically install Ubuntu 10.04 with default options. Understand what | |
# it is doing before you use it. | |
# | |
# Boot Options line: | |
# |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""pycache -- cache a python package from PyPI on S3. | |
A simple script to collect a cache of packages locally and sync them up to an S3 bucket, using directories as namespaces so that different projects can have different dependencies. | |
This is just about the simplest thing that could possibly work. | |
""" | |
import warnings | |
warnings.filterwarnings('ignore') |
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
class Chef | |
class Provider | |
class RemoteS3File < Chef::Provider::RemoteFile | |
def load_current_resource | |
super | |
%w{bucket object_name aws_access_key_id aws_secret_access_key}.map do |attribute| | |
Chef::Application.fatal! "remote_s3_file: required attr: #{attribute} is nil", -92 if | |
@new_resource.send(attribute.to_sym).nil? | |
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
# -*- ruby -*- | |
# Needs following parameters configured in rake.rb: | |
# DNS_DOMAIN: domain for which to set entries, including trailing dot | |
# (e.g. "example.com.") | |
# DNS_ATTRIBUTE: attribute containing hostname to CNAME to, defaults | |
# to 'fqdn'; for EC2, use "ec2.public_hostname" | |
# DNS_ENTRIES: hash mapping hostname to node search query, | |
# e.g. {'buildbot' => 'recipes:buildbot', 'monitoring' => | |
# 'roles:monitoring'} |
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 Opscode::Aws::Ec2 | |
#Auto locates and attached ebs devices based on the data bag they reside in. The following test cases need to be performed | |
# Create multiple resources with new node: PASS | |
# | |
# Re-attach multiple resources after a reboot: PASS | |
# | |
# Create resources across 2 runs. First run creates first raid set, second run re-attaches then creates: PASS | |
# |
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 Chef::Mixin::Command | |
action :create do | |
size = new_resource.size | |
volumes = new_resource.volumes.times.map{|i| (i == 0 ? "/dev/sdf" : "/dev/sdf#{i}") } | |
setra = new_resource.blockdev_setra | |
volume_group = new_resource.volume_group | |
logical_volume = new_resource.name | |
mdadm_device = new_resource.mdadm_device | |
mount_point = new_resource.mount_point |
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
## Knife plugin to set node environment | |
# See http://wiki.opscode.com/display/chef/Environments | |
# | |
## Install | |
# Place in .chef/plugins/knife/set_environment.rb | |
# | |
## Usage | |
# Nick-Stielaus-MacBook-Pro:chef-repo nstielau$ knife node set_environment mynode.net my_env | |
# Looking for mynode.net | |
# Setting environment to my_env |
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
def unpack_ip(packed_ip) | |
octets = [] | |
4.times do | |
octet = packed_ip & 0xFF | |
octets.unshift(octet.to_s) | |
packed_ip = packed_ip >> 8 | |
end | |
ip = octets.join('.') | |
end |
OlderNewer