github.com/msfernandes
matheus.souza.fernandes@gmail.com
$ cd ~
$ curl -L https://www.opscode.com/chef/install.sh | bash
Thank you for installing Chef!
$ chef-solo -v
Chef: 12.2.1
$ chef-solo -c solo.rb -j atributos.json{
"nginx": {
"version": "1.6.0",
"install_method": "source",
"default_site_enabled": true,
"source": {
"modules": ["nginx::http_gzip_static_module", "nginx::http_ssl_module"]
}
},
"run_list": [
"recipe[nginx]"
]
}directory "repo_dir" do
owner "vagrant"
group "vagrant"
path "#{REPO_DIR}"
recursive true
action :create
endpackage "libmysqlclient-dev"
execute "create_database" do
command "mysqladmin create gestorpsi -u root"
not_if "mysql -u root -e 'use gestorpsi;'"
endtemplate "#{HOME}/.bashrc" do
owner "vagrant"
group "vagrant"
source "bashrc.erb"
variables({
:venv_dir => "#{VENV_DIR}",
:shared_dir => "#{SHARED_DIR}/repo",
:repo_dir => "#{REPO_DIR}"
})
endupstream colab {
server 127.0.0.1:8001 fail_timeout=10s;
}
server {
listen *:80;
server_name <%= node['config']['external_hostname'] %>;
access_log /var/log/nginx/colab.access.log;
error_log /var/log/nginx/colab.error.log;
location ~ ^/static/img/logo\.[^.]+\.svg$ {
alias /var/lib/colab-assets/spb/logo.svg;
}
...include_recipe "python"
python_virtualenv "#{VENV_DIR}" do
owner "vagrant"
group "vagrant"
action :create
end
python_pip "" do
virtualenv "#{VENV_DIR}"
options "-r #{REPO_DIR}/requirements.txt"
endinclude_recipe "git"
git "#{REPO_DIR}" do
repository "repo_url"
reference "branch"
action :sync
end
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 8000, host: 8080
config.vm.provision "chef_solo" do |chef|
chef.add_recipe "gestorpsi::development"
chef.json = {
"mariadb" => {
"db_name" => "gestorpsi",
"user" => "root",
"server_root_password" => "",
"install" => {
"version" => "5.5"
}
}
}
end
endmatheus.souza.fernandes@gmail.com