Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sawanoboly committed Mar 23, 2015
0 parents commit d3c39c6
Show file tree
Hide file tree
Showing 8 changed files with 283 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Created by http://www.gitignore.io

### Vagrant ###
.vagrant/


### Ruby ###
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/test/tmp/
/test/version_tmp/
/tmp/

## Specific to RubyMotion:
.dat*
.repl_history
build/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalisation:
/.bundle/
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc


### Packer ###
# Cache objects
packer_cache/

# For built boxes
*.box


### vim ###
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~

## manual add
/files/archives/*.zip
/cookbooks/
/.envrc
9 changes: 9 additions & 0 deletions Cheffile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env ruby
#^syntax detection

site 'http://community.opscode.com/api/v1'

cookbook 'ark'

# development
cookbook 'simplelog_handler'
17 changes: 17 additions & 0 deletions Cheffile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SITE
remote: http://community.opscode.com/api/v1
specs:
7-zip (1.0.2)
windows (>= 1.2.2)
ark (0.9.0)
7-zip (>= 0.0.0)
windows (>= 0.0.0)
chef_handler (1.1.6)
simplelog_handler (1.0.0)
windows (1.36.6)
chef_handler (>= 0.0.0)

DEPENDENCIES
ark (>= 0)
simplelog_handler (>= 0)

4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# A sample Gemfile
source "https://rubygems.org"

gem 'librarian-chef'
128 changes: 128 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
GEM
remote: https://rubygems.org/
specs:
builder (3.2.2)
chef (12.1.1)
chef-zero (~> 4.0)
diff-lcs (~> 1.2, >= 1.2.4)
erubis (~> 2.7)
ffi-yajl (~> 1.2)
highline (~> 1.6, >= 1.6.9)
mixlib-authentication (~> 1.3)
mixlib-cli (~> 1.4)
mixlib-config (~> 2.0)
mixlib-log (~> 1.3)
mixlib-shellout (>= 2.0.0.rc.0, < 3.0)
net-ssh (~> 2.6)
net-ssh-multi (~> 1.1)
ohai (~> 8.0)
plist (~> 3.1.0)
pry (~> 0.9)
rspec-core (~> 3.2)
rspec-expectations (~> 3.2)
rspec-mocks (~> 3.2)
rspec_junit_formatter (~> 0.2.0)
serverspec (~> 2.7)
specinfra (~> 2.10)
chef-zero (4.0)
ffi-yajl (~> 1.1)
hashie (~> 2.0)
mixlib-log (~> 1.3)
rack
uuidtools (~> 2.1)
coderay (1.1.0)
diff-lcs (1.2.5)
erubis (2.7.0)
ffi (1.9.8)
ffi-yajl (1.4.0)
ffi (~> 1.5)
libyajl2 (~> 1.2)
hashie (2.1.2)
highline (1.7.1)
ipaddress (0.8.0)
librarian (0.1.2)
highline
thor (~> 0.15)
librarian-chef (0.0.4)
chef (>= 0.10)
librarian (~> 0.1.0)
minitar (>= 0.5.2)
libyajl2 (1.2.0)
method_source (0.8.2)
mime-types (2.4.3)
minitar (0.5.4)
mixlib-authentication (1.3.0)
mixlib-log
mixlib-cli (1.5.0)
mixlib-config (2.1.0)
mixlib-log (1.6.0)
mixlib-shellout (2.0.1)
multi_json (1.11.0)
net-dhcp (1.3.2)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (2.9.2)
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
net-ssh-multi (1.2.0)
net-ssh (>= 2.6.5)
net-ssh-gateway (>= 1.2.0)
ohai (8.1.1)
ffi (~> 1.9)
ffi-yajl (~> 1.1)
ipaddress
mime-types (~> 2.0)
mixlib-cli
mixlib-config (~> 2.0)
mixlib-log
mixlib-shellout (~> 2.0)
net-dhcp
rake (~> 10.1)
systemu (~> 2.6.4)
wmi-lite (~> 1.0)
plist (3.1.0)
pry (0.10.1)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (1.6.0)
rake (10.4.2)
rspec (3.2.0)
rspec-core (~> 3.2.0)
rspec-expectations (~> 3.2.0)
rspec-mocks (~> 3.2.0)
rspec-core (3.2.2)
rspec-support (~> 3.2.0)
rspec-expectations (3.2.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
rspec-its (1.2.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.2.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
rspec-support (3.2.2)
rspec_junit_formatter (0.2.0)
builder (< 4)
rspec (>= 2, < 4)
rspec-core (!= 2.12.0)
serverspec (2.12.0)
multi_json
rspec (~> 3.0)
rspec-its
specinfra (~> 2.23)
slop (3.6.0)
specinfra (2.24.2)
net-scp
net-ssh
systemu (2.6.5)
thor (0.19.1)
uuidtools (2.1.5)
wmi-lite (1.0.0)

PLATFORMS
ruby

DEPENDENCIES
librarian-chef
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# LW1 Moodle
54 changes: 54 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# -*- 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|
config.vm.box = "dummy"
config.omnibus.chef_version = :latest

config.vm.synced_folder ".", "/vagrant", type: "rsync",
rsync__exclude: [
'.vagrant/',
'.git/',
'tmp/',
'packer_cache/'
]

## AWS
config.vm.provider :aws do |aws, override|
aws.access_key_id = ENV['AWS_ACCESS_KEY']
aws.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
aws.keypair_name = ENV['AWS_EC2_KEYPAIR']
aws.user_data = "#!/bin/bash\nsed -i -e 's/^Defaults.*requiretty/# Defaults requiretty/g' /etc/sudoers"

aws.region = ENV['AWS_REGION']
aws.instance_type = 'c3.large'
case ENV['AWS_REGION']
when 'ap-northeast-1'
aws.ami = 'ami-18869819' # Amazon Linux AMI 2014.09.2 (HVM)
when 'us-east-1'
aws.ami = 'ami-146e2a7c' # Amazon Linux AMI 2014.09.2 (HVM)
else
raise "Unsupported region #{ENV['AWS_REGION']}"
end

aws.tags = {
'Name' => 'Moodle 2.8.5 (Develop)'
}
override.ssh.username = "ec2-user"
override.ssh.private_key_path = ENV['AWS_EC2_KEYPASS']
end

config.ssh.pty = true

## Sction Provisioning
config.vm.provision :shell, :path => "bootstrap.sh"
# config.vm.provision :chef_solo do |chef|
# chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
# chef.add_recipe 'simplelog_handler::default'
# chef.add_recipe 'lw1_moodle::default'
# end

end
7 changes: 7 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#/usr/bin/env bash

sudo yum update -y
sudo mkdir -p /etc/chef/ohai/hints/
sudo touch /etc/chef/ohai/hints/ec2.json
echo '{}' > ./ec2.json
sudo mv ./ec2.json /etc/chef/ohai/hints/ec2.json

0 comments on commit d3c39c6

Please sign in to comment.