Skip to content

Instantly share code, notes, and snippets.

@ryandotclair
ryandotclair / Vagrantfile
Created October 26, 2015 02:58
Simple Vagrantfile
Vagrant.configure(2) do |config|
config.vm.box = "bento/centos-6.7”
config.vm.network "forwarded_port", guest: 80, host: 6080
config.vm.network "forwarded_port", guest: 443, host: 6081
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "1024"
end
end
@ryandotclair
ryandotclair / default.rb
Created October 26, 2015 03:00
Chef example recipe
package "httpd" do
action :install
end
service "httpd" do
action [:enable, :start]
end
template "/var/www/html/index.html" do
source "index.html.erb"
@ryandotclair
ryandotclair / index.html.erb
Created October 26, 2015 03:00
Example Chef index.html.erb
<h1>Hello World!</h1>
<p>My IP address is <%= node['ipaddress'] %></p>
@ryandotclair
ryandotclair / default.rb
Created October 26, 2015 03:01
Example Chef Attribute
default['apache']['greeting'] = "Earth"
@ryandotclair
ryandotclair / index.html.erb
Created October 26, 2015 03:02
Chef Example#2 index.html.erb
<h1>Hello <%= node['apache']['greeting'] %>!</h1>
<p>My IP address is <%= node['ipaddress'] %></p>
@ryandotclair
ryandotclair / webserver.json
Created October 26, 2015 03:03
Example Chef Role
{
"name" : "webserver",
"default_attributes": {
"apache" : {
"greeting" : "Person"
}
},
"run_list" : [
"recipe[apache]"
]
@ryandotclair
ryandotclair / Vagrantfile
Created October 26, 2015 16:18
Chef Simple Vagrantfile
Vagrant.configure(2) do |config|
config.vm.box = "centos_6.7"
config.vm.box_url = "bento/centos-6.7"
config.vm.network "forwarded_port", guest: 80, host: 6080
config.vm.network "forwarded_port", guest: 443, host: 6081
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "1024"
end
end
@ryandotclair
ryandotclair / default.rb
Created October 26, 2015 16:19
Chef Example Recipe
package "httpd" do
action :install
end
service "httpd" do
action [:enable, :start]
end
template "/var/www/html/index.html" do
source "index.html.erb"
@ryandotclair
ryandotclair / index.html.erb
Created October 26, 2015 16:20
Chef example index.html.erb
<h1>Hello World!</h1>
<p>My IP address is <%= node['ipaddress'] %></p>
@ryandotclair
ryandotclair / default.rb
Created October 26, 2015 16:22
Chef example attribute
default['apache']['greeting'] = "Earth"