Skip to content

Instantly share code, notes, and snippets.

View johnfitzpatrick's full-sized avatar

John Fitzpatrick johnfitzpatrick

  • Kong
  • Belfast, Northern Ireland
View GitHub Profile
ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 60
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 8
ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 60
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 8
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
---
driver:
name: docker
provisioner:
name: chef_zero
driver_config:
forward:
- 8080:80
package "haproxy"
action :install
end
template "/etc/haproxy/haproxy.conf" do
source "haproxy.conf.erb"
owner "root"
group "root"
mode "0644"
variables :pool_members => pool_members
name 'chef-client'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache 2.0'
description 'Manages client.rb configuration and chef-client service'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '4.3.1'
recipe 'chef-client', 'Includes the service recipe by default.'
recipe 'chef-client::bluepill_service', 'Configures chef-client as a service under Bluepill'
recipe 'chef-client::bsd_service', 'Configures chef-client as a service on *BSD'
package 'haproxy' do
action :install
end
pool_members = search("node","role:webserver")
template "/etc/haproxy/haproxy.cfg" do
source "haproxy.cfg.erb"
owner "root"
group "root"
mydirectory = "/Users/YOU/training/chef-repo"
git "previous-repo" do
destination "#{mydirectory}"
repository "git://github.com/johnfitzpatrick/cheffundamentals3.git"
reference "v1"
action :export
end
execute "chown -R YOU #{mydirectory}" do
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
user haproxy
group haproxy
stats socket /var/run/haproxy.sock user haproxy group haproxy
defaults
<h1>Hello, <%= node["myapache"]["greeting"] %></h1>
<p>
This is a <%= node["platform"] %> <%= node["platform_version"] %> server with <%= node["memory"]["total"] %> RAM.
<br><br>
The CentOS servers in your organization have the following FQDN/IP Addresses:-
<ul>
<% @nodes.each do |node| %>
<li><%= node['fqdn'] %> / <%= node['cloud']['public_ipv4'] %></li>
<% end %>