bootstrap files borrowed (stolen) from this tutorial
Chef Solo tutorial
Chef Berkshelf tutorial
Gusteau.gs - Vagrant + Chef-Solo integration
rove.io
If you are using this and you would like features added, create an issue or pull request (preferrably on a topic branch you have created in your fork)
-
think about using variable to switch between vagrant/veewee or strato/hosteurope build
-
rbenv and ruby 1.9.3+
-
zsh, maybe with my .oh-my-zsh repo
##nodes
- infrastructure
- app server
##roles
- ldap
- apache2 / nginx
- development -> nexus, jenkins, sonar?
- appserver
- database
servers:
infrastructure: mail (dovecot) ldap master apache2 (replace with nginx) nexus jenkins sonar?
production login with ldap jboss eap 6.1
ports:
25 (SMTP), 80 (HTTP), 110 (POP3), 143 (IMAP), 443 (HTTPS), 465 (SMTPS), 993 (IMAPS), and 995 (POP3S).
http://learnchef.getharvest.com/
Environments -> group of Nodes, has attributes Nodes -> one or more Roles, has attributes Roles -> one or more Cookbooks, has attributes Cookbooks -> one or more Recipes, Templates, Files..., has attributes
environments:
development staging production
{ "name": "production_rackspace", "description": "Rackspace Servers", "json_class": "Chef::Environment", "chef_type": "environment", "override_attributes": { "datacenter": "rackspace" } }
ohai - attributes like ip, processors, os etc. -> http://wiki.opscode.com/display/chef/Ohai
cpu_cores = node[:cpu][:total]
package "libpcre3-dev" do unless node[:ec2] action :upgrade end end
ebooks:
http://geek-book.org/book/instant-osgi-starter http://geek-book.org/book/data-analytics-models-and-algorithms-for-intelligent-data-analysis http://geek-book.org/book/soa-made-simple http://geek-book.org/book/continuous-delivery-and-devops-a-quickstart-guide http://geek-book.org/book/test-driven-infrastructure-with-chef http://geek-book.org/book/akka-essentials http://geek-book.org/book/instant-sublime-text-starter http://geek-book.org/book/apache-tomcat-7-essentials
#bootstrap development env
- git
- virtualbox
- rvm/rbenv
- ruby
- berkshelf
- (foodcritic)
- vagrant
- vagrant berkshelf plugin #chef-solo
#check for running in vagrant if node[:instance_role] == 'vagrant'
end
#speed up downloads in vagrant boxes config.vm.provision :shell, :inline => "sed -i 's/us.archive/de.archive/g' /etc/apt/sources.list"
LOLWAT
- A working linux box
- Java JDK 1.6.0_xx
- JBoss 5.x.x
- Jenkins with Yale-Maven-Application-Installer
-
JBoss: -- Installed JBOSS_HOME=/usr/local/jboss-eap-..... -- Apps/Nodes = /usr/local/jboss-apps -- Init script, per app = /etc/init.d/jboss_nodeXX -- Config for node = /etc/sysconfig/jboss_nodeXX -- From outside the VM: http://localhost:8080
-
Jenkins: -- Installed in /usr/local/jenkins -- JENKINS_HOME=/usr/local/jenkins/JENKINS_HOME -- Init script = /etc/init.d/jenkins -- Basic Config in /etc/sysconfig/jenkins -- No jobs currently setup... to be conntinued -- From outside the VM: http://localhost:8888
-- Install Virtualbox https://www.virtualbox.org/wiki/Downloads
-- Install a git client if you don't have one
-- Install Vagrant http://vagrantup.com/
-- Setup box cd ~/tmp/vagrant_projects git clone git://gist.github.com/2997552.git jboss512-vagrant cd jboss512-vagrant
-- Setup some shared folders mkdir -p jboss/jboss-apps jboss/jboss-logs jboss/jboss-deploy
-- get a copy of my chef cookbooks git clone git://github.com/fishnix/chef-repo-yu.git -b vagrant-cookbooks
-- Fire and go vagrant up
###################
Vagrant::Config.run do |config|
config.vm.box = "centos62min" config.vm.box_url = "http://leleupi.its.yale.edu:8181/PKG/centos62min.box" config.vm.customize ["modifyvm", :id, "--memory", "1024"]
config.vm.forward_port 8080, 8080 # HTTP config.vm.forward_port 8440, 8440 # HTTPS config.vm.forward_port 8780, 8780 # DEBUG
config.vm.forward_port 8180, 8180 # HTTP config.vm.forward_port 8441, 8441 # HTTPS config.vm.forward_port 8781, 8781 # DEBUG
config.vm.forward_port 8888, 8888
config.vm.forward_port 22, 2222
config.vm.provision :chef_solo do |chef| chef.cookbooks_path = "chef-repo-yu/cookbooks" chef.roles_path = "chef-repo-yu/roles"
chef.add_role "jboss-vagrant"
# You may also specify custom JSON attributes:
chef.json.merge!({
:misc => { :hostname => "vagrant-centos-62" },
:java => {
:tmpdir => "/vagrant/src",
:jdk_url => 'http://leleupi.its.yale.edu:8181/PKG/jdk1.6.0_33.tar.gz',
:jdk_file => 'jdk1.6.0_33.tar.gz',
:java_home => '/usr/local/jdk1.6.0_33'
},
:jenkins => { :user => "vagrant" },
:jboss => {
:tmpdir => "/vagrant/src",
:keystore_url => "http://leleupi.its.yale.edu:8181/PKG/server.keystore",
:jboss_url => 'http://leleupi.its.yale.edu:8181/PKG/jboss-eap-5.1.2.tar.gz',
:jboss_file => 'jboss-eap-5.1.2.tar.gz',
:jboss_home => '/usr/local/jboss-eap-5.1/jboss-as',
:nodes => { :node00 => {
:user => "vagrant",
:additional_jboss_opts => [ '-Djboss.proxyname=localhost','-Djboss.proxyport=8440'],
:additional_java_opts => [ '-Xdebug',
'-Xrunjdwp:transport=dt_socket,address=8780,server=y,suspend=n' ]
},
:node01 => {
:user => "vagrant",
:additional_jboss_opts => [ '-Djboss.proxyname=localhost','-Djboss.proxyport=8441'],
:additional_java_opts => [ '-Xdebug',
'-Xrunjdwp:transport=dt_socket,address=8781,server=y,suspend=n' ]
}
}
}
})
end
config.vm.share_folder "jboss-apps", "/usr/local/jboss-apps", "./jboss/jboss-apps" config.vm.share_folder "jboss-logs", "/var/log/jboss", "./jboss/jboss-logs" config.vm.share_folder "jboss-deploy", "/usr/local/jboss-deploy", "./jboss/jboss-deploy"
end
#######################################################
#interesting links http://scriptogr.am/cbednarski/post/chef-berkshelf http://misheska.com/ https://gist.github.com/wilmoore/1615295#file_install_virtualbox_latest_ubuntu.sh https://github.com/fesplugas/rbenv-installer/blob/master/bin/rbenv-installer http://vialstudios.com/guide-authoring-cookbooks.html
http://docs.opscode.com/essentials_cookbooks.html#Cookbooks-SiteSpecificCookbooks
http://ed.victavision.co.uk/blog/post/4-8-2012-chef-solo-encrypted-data-bags http://ed.victavision.co.uk/blog/post/21-7-2012-chef-solo-data-bags http://docs.opscode.com/essentials_data_bags_encrypt.html http://docs.opscode.com/essentials_data_bags.html https://gist.github.com/aaronjensen/4123044
https://gist.github.com/jedi4ever https://github.com/jimdo/veewee-definitions
Required for backend:
JBoss EAP 6.1.x HA ActiveMQ / JBoss A-MQ HA MongoDB 2.4.6 HA Elasticsearch 0.90.5 HA
Required for frontend:
nginx
Required for monitoring:
newrelic-sysmond -> server monitoring (JBoss, AMQ, ES?) newrelic-platform? -> application monitoring, nginx hawtio -> camel? 10gen-mms for mongodb papertrail for log parsing... maybe use logstash + kibana + es ES monitoring?
Overall:
git ntp openssh - setup with keys and passphrase fail2ban
Required for developing the chef provisioned vagrant vm:
virtualbox ruby + gems berkshelf bundler vagrant + plugins
Write idempotent scripts, so we do not reinstall anything if it is already present