├── VERSION ├── data_bags ├── .gitkeep └── users │ └── deploy.json.example ├── nodes ├── .gitkeep ├── 139.162.229.194.json.old ├── rails_postgres_redis.json.example └── rails-postgres-redis1.json ├── roles ├── .gitkeep ├── memcached-server.json ├── redis-server.json ├── postgres-server.json ├── nginx-server.json ├── rails-app.json └── server.json ├── environments ├── .gitkeep └── production.json ├── site-cookbooks ├── .gitkeep ├── rdr_nginx_wrapper │ ├── README.md │ ├── CHANGELOG.md │ ├── .gitignore │ ├── Policyfile.rb │ ├── recipes │ │ └── default.rb │ ├── metadata.rb │ ├── LICENSE │ ├── .delivery │ │ └── project.toml │ ├── templates │ │ └── nginx.conf.erb │ └── chefignore ├── rdr_sudo_wrapper │ ├── LICENSE │ ├── README.md │ ├── recipes │ │ └── default.rb │ ├── CHANGELOG.md │ ├── .gitignore │ ├── Policyfile.rb │ ├── metadata.rb │ ├── kitchen.yml │ ├── .delivery │ │ └── project.toml │ └── chefignore ├── rdr_users_wrapper │ ├── README.md │ ├── recipes │ │ └── default.rb │ ├── CHANGELOG.md │ ├── .gitignore │ ├── Policyfile.rb │ ├── metadata.rb │ ├── kitchen.yml │ ├── LICENSE │ ├── .delivery │ │ └── project.toml │ └── chefignore ├── rdr_redisio_wrapper │ ├── README.md │ ├── attributes │ │ └── default.rb │ ├── CHANGELOG.md │ ├── recipes │ │ └── default.rb │ ├── .gitignore │ ├── Policyfile.rb │ ├── metadata.rb │ ├── LICENSE │ ├── .delivery │ │ └── project.toml │ └── chefignore ├── rdr_memcached_wrapper │ ├── README.md │ ├── CHANGELOG.md │ ├── recipes │ │ └── default.rb │ ├── .gitignore │ ├── Policyfile.rb │ ├── metadata.rb │ ├── LICENSE │ ├── .delivery │ │ └── project.toml │ └── chefignore ├── rdr_postgresql_wrapper │ ├── README.md │ ├── CHANGELOG.md │ ├── .gitignore │ ├── Policyfile.rb │ ├── metadata.rb │ ├── recipes │ │ └── default.rb │ ├── LICENSE │ ├── .delivery │ │ └── project.toml │ └── chefignore └── rdr_ruby_rbenv_wrapper │ ├── README.md │ ├── CHANGELOG.md │ ├── .gitignore │ ├── recipes │ └── default.rb │ ├── Policyfile.rb │ ├── metadata.rb │ ├── LICENSE │ ├── .delivery │ └── project.toml │ └── chefignore ├── .chef ├── local-mode-cache │ └── cache │ │ ├── chef-client-running.pid │ │ └── chef-stacktrace.out └── knife.rb ├── test └── clean-ssh.sh ├── .gitignore ├── knife.rb ├── clients ├── demo-server-2.json ├── demo-server-3.json └── ubuntu.members.linode.com.json ├── Berksfile ├── Readme.md ├── LICENSE ├── Changelog.md ├── Berksfile.lock └── Vagrantfile /VERSION: -------------------------------------------------------------------------------- 1 | 5.0.1 2 | -------------------------------------------------------------------------------- /data_bags/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /nodes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /roles/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /environments/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site-cookbooks/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.chef/local-mode-cache/cache/chef-client-running.pid: -------------------------------------------------------------------------------- 1 | 38295 -------------------------------------------------------------------------------- /site-cookbooks/rdr_nginx_wrapper/README.md: -------------------------------------------------------------------------------- 1 | # nginx_wrapper 2 | 3 | TODO: Enter the cookbook description here. 4 | 5 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_sudo_wrapper/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 The Authors 2 | 3 | All rights reserved, do not redistribute. 4 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_sudo_wrapper/README.md: -------------------------------------------------------------------------------- 1 | # rdr_sudo_wrapper 2 | 3 | TODO: Enter the cookbook description here. 4 | 5 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_users_wrapper/README.md: -------------------------------------------------------------------------------- 1 | # users_wrapper 2 | 3 | TODO: Enter the cookbook description here. 4 | 5 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_redisio_wrapper/README.md: -------------------------------------------------------------------------------- 1 | # rdr_redisio_wrapper 2 | 3 | TODO: Enter the cookbook description here. 4 | 5 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_memcached_wrapper/README.md: -------------------------------------------------------------------------------- 1 | # rdr_memcached_wrapper 2 | 3 | TODO: Enter the cookbook description here. 4 | 5 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_postgresql_wrapper/README.md: -------------------------------------------------------------------------------- 1 | # postgresql_wrapper 2 | 3 | TODO: Enter the cookbook description here. 4 | 5 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_ruby_rbenv_wrapper/README.md: -------------------------------------------------------------------------------- 1 | # ruby_rbenv_wrapper 2 | 3 | TODO: Enter the cookbook description here. 4 | 5 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_users_wrapper/recipes/default.rb: -------------------------------------------------------------------------------- 1 | users_manage "sysadmin" do 2 | group_id 2300 3 | action [ :create ] 4 | end -------------------------------------------------------------------------------- /site-cookbooks/rdr_redisio_wrapper/attributes/default.rb: -------------------------------------------------------------------------------- 1 | default['redisio']['package_install'] = true 2 | default['redisio']['version'] = nil -------------------------------------------------------------------------------- /test/clean-ssh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | SERVER_IP=$1 3 | echo "Cleaning SSH Config for: $SERVER_IP" 4 | 5 | ssh-keygen -R $SERVER_IP 6 | ssh-copy-id root@$SERVER_IP 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | data_bags/users/*.json 2 | cookbooks/**/* 3 | .ruby-version 4 | .ruby-gemset 5 | .vagrant 6 | berks-cookbooks/ 7 | nodes/test* 8 | clients/*.json 9 | .chef -------------------------------------------------------------------------------- /environments/production.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "production", 3 | "default_attributes": { 4 | }, 5 | "json_class":"Chef::Environment", 6 | "chef_type":"environment" 7 | } 8 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_sudo_wrapper/recipes/default.rb: -------------------------------------------------------------------------------- 1 | sudo "sysadmin" do 2 | group node["authorization"]["sudo"]["groups"] 3 | user node["authorization"]["sudo"]["users"] 4 | nopasswd node["authorization"]["sudo"]["passwordless"] 5 | end -------------------------------------------------------------------------------- /site-cookbooks/rdr_nginx_wrapper/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # nginx_wrapper CHANGELOG 2 | 3 | This file is used to list changes made in each version of the nginx_wrapper cookbook. 4 | 5 | ## 0.1.0 6 | 7 | Initial release. 8 | 9 | - change 0 10 | - change 1 11 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_users_wrapper/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # users_wrapper CHANGELOG 2 | 3 | This file is used to list changes made in each version of the users_wrapper cookbook. 4 | 5 | ## 0.1.0 6 | 7 | Initial release. 8 | 9 | - change 0 10 | - change 1 11 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_sudo_wrapper/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # rdr_sudo_wrapper CHANGELOG 2 | 3 | This file is used to list changes made in each version of the rdr_sudo_wrapper cookbook. 4 | 5 | ## 0.1.0 6 | 7 | Initial release. 8 | 9 | - change 0 10 | - change 1 11 | -------------------------------------------------------------------------------- /.chef/knife.rb: -------------------------------------------------------------------------------- 1 | cookbook_path ["cookbooks", "site-cookbooks"] 2 | node_path "nodes" 3 | role_path "roles" 4 | data_bag_path "data_bags" 5 | environment_path "environments" 6 | #encrypted_data_bag_secret "data_bag_key" 7 | 8 | knife[:berkshelf_path] = "cookbooks" 9 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_postgresql_wrapper/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # postgresql_wrapper CHANGELOG 2 | 3 | This file is used to list changes made in each version of the postgresql_wrapper cookbook. 4 | 5 | ## 0.1.0 6 | 7 | Initial release. 8 | 9 | - change 0 10 | - change 1 11 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_redisio_wrapper/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # rdr_redisio_wrapper CHANGELOG 2 | 3 | This file is used to list changes made in each version of the rdr_redisio_wrapper cookbook. 4 | 5 | ## 0.1.0 6 | 7 | Initial release. 8 | 9 | - change 0 10 | - change 1 11 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_ruby_rbenv_wrapper/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # ruby_rbenv_wrapper CHANGELOG 2 | 3 | This file is used to list changes made in each version of the ruby_rbenv_wrapper cookbook. 4 | 5 | ## 0.1.0 6 | 7 | Initial release. 8 | 9 | - change 0 10 | - change 1 11 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_memcached_wrapper/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # rdr_memcached_wrapper CHANGELOG 2 | 3 | This file is used to list changes made in each version of the rdr_memcached_wrapper cookbook. 4 | 5 | ## 0.1.0 6 | 7 | Initial release. 8 | 9 | - change 0 10 | - change 1 11 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_memcached_wrapper/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook:: rdr_memcached_wrapper 3 | # Recipe:: default 4 | # 5 | # Copyright:: 2021, The Authors, All Rights Reserved. 6 | 7 | memcached_instance 'memcached' do 8 | extra_cli_options ['-P /var/run/memcached/memcached.pid'] 9 | user 'memcache' 10 | end -------------------------------------------------------------------------------- /site-cookbooks/rdr_redisio_wrapper/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook:: rdr_redisio_wrapper 3 | # Recipe:: default 4 | # 5 | # Copyright:: 2021, The Authors, All Rights Reserved. 6 | 7 | apt_repository 'redis' do 8 | uri 'ppa:redislabs/redis' 9 | end 10 | 11 | apt_update 'update' 12 | 13 | redisio_install "redis" do 14 | end -------------------------------------------------------------------------------- /site-cookbooks/rdr_nginx_wrapper/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | *~ 3 | *# 4 | .#* 5 | \#*# 6 | .*.sw[a-z] 7 | *.un~ 8 | 9 | # Bundler 10 | Gemfile.lock 11 | gems.locked 12 | bin/* 13 | .bundle/* 14 | 15 | # test kitchen 16 | .kitchen/ 17 | kitchen.local.yml 18 | 19 | # Chef Infra 20 | Berksfile.lock 21 | .zero-knife.rb 22 | Policyfile.lock.json 23 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_users_wrapper/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | *~ 3 | *# 4 | .#* 5 | \#*# 6 | .*.sw[a-z] 7 | *.un~ 8 | 9 | # Bundler 10 | Gemfile.lock 11 | gems.locked 12 | bin/* 13 | .bundle/* 14 | 15 | # test kitchen 16 | .kitchen/ 17 | kitchen.local.yml 18 | 19 | # Chef Infra 20 | Berksfile.lock 21 | .zero-knife.rb 22 | Policyfile.lock.json 23 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_postgresql_wrapper/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | *~ 3 | *# 4 | .#* 5 | \#*# 6 | .*.sw[a-z] 7 | *.un~ 8 | 9 | # Bundler 10 | Gemfile.lock 11 | gems.locked 12 | bin/* 13 | .bundle/* 14 | 15 | # test kitchen 16 | .kitchen/ 17 | kitchen.local.yml 18 | 19 | # Chef Infra 20 | Berksfile.lock 21 | .zero-knife.rb 22 | Policyfile.lock.json 23 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_ruby_rbenv_wrapper/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | *~ 3 | *# 4 | .#* 5 | \#*# 6 | .*.sw[a-z] 7 | *.un~ 8 | 9 | # Bundler 10 | Gemfile.lock 11 | gems.locked 12 | bin/* 13 | .bundle/* 14 | 15 | # test kitchen 16 | .kitchen/ 17 | kitchen.local.yml 18 | 19 | # Chef Infra 20 | Berksfile.lock 21 | .zero-knife.rb 22 | Policyfile.lock.json 23 | -------------------------------------------------------------------------------- /data_bags/users/deploy.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "id": "deploy", 3 | // generate this with: openssl passwd -1 "plaintextpassword" 4 | "password": "REPLACE", 5 | // the below should contain a list of ssh public keys which should 6 | // be able to login as deploy 7 | "ssh_keys": [ 8 | ], 9 | "groups": [ "sysadmin"], 10 | "shell": "\/bin\/bash" 11 | } 12 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_redisio_wrapper/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | *~ 3 | *# 4 | .#* 5 | \#*# 6 | .*.sw[a-z] 7 | *.un~ 8 | 9 | # Bundler 10 | Gemfile.lock 11 | gems.locked 12 | bin/* 13 | .bundle/* 14 | 15 | # test kitchen 16 | .kitchen/ 17 | kitchen.local.yml 18 | 19 | # Chef Infra 20 | Berksfile.lock 21 | .zero-knife.rb 22 | Policyfile.lock.json 23 | 24 | .idea/ 25 | 26 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_sudo_wrapper/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | *~ 3 | *# 4 | .#* 5 | \#*# 6 | .*.sw[a-z] 7 | *.un~ 8 | 9 | # Bundler 10 | Gemfile.lock 11 | gems.locked 12 | bin/* 13 | .bundle/* 14 | 15 | # test kitchen 16 | .kitchen/ 17 | kitchen.local.yml 18 | 19 | # Chef Infra 20 | Berksfile.lock 21 | .zero-knife.rb 22 | Policyfile.lock.json 23 | 24 | .idea/ 25 | 26 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_memcached_wrapper/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | *~ 3 | *# 4 | .#* 5 | \#*# 6 | .*.sw[a-z] 7 | *.un~ 8 | 9 | # Bundler 10 | Gemfile.lock 11 | gems.locked 12 | bin/* 13 | .bundle/* 14 | 15 | # test kitchen 16 | .kitchen/ 17 | kitchen.local.yml 18 | 19 | # Chef Infra 20 | Berksfile.lock 21 | .zero-knife.rb 22 | Policyfile.lock.json 23 | 24 | .idea/ 25 | 26 | -------------------------------------------------------------------------------- /roles/memcached-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "memcached-server", 3 | "description": "Memcached server", 4 | "default_attributes": { 5 | 6 | }, 7 | "json_class": "Chef::Role", 8 | "run_list": [ 9 | "role[server]", 10 | "recipe[rdr_memcached_wrapper::default]", 11 | "recipe[monit_configs-tlq::memcached]" 12 | ], 13 | "chef_type": "role" 14 | } 15 | -------------------------------------------------------------------------------- /knife.rb: -------------------------------------------------------------------------------- 1 | local_mode true 2 | chef_repo_path File.expand_path('../' , __FILE__) 3 | cookbook_path ["cookbooks", "berks-cookbooks", "site-cookbooks"] 4 | 5 | knife[:ssh_attribute] = "knife_zero.host" 6 | knife[:use_sudo] = true 7 | knife[:editor] = 'vim' 8 | knife[:before_bootstrap] = "rm -rf ./berks-cookboks/* && berks vendor" 9 | knife[:before_converge] = "rm -rf ./berks-cookboks/* && berks vendor" 10 | -------------------------------------------------------------------------------- /roles/redis-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "redis-server", 3 | "description": "A Redis server", 4 | "default_attributes": { 5 | "redis-server": { 6 | } 7 | }, 8 | "json_class": "Chef::Role", 9 | "run_list": [ 10 | "role[server]", 11 | "recipe[rdr_redisio_wrapper::default]", 12 | "recipe[monit_configs-tlq::redis-server]" 13 | ], 14 | "chef_type": "role" 15 | } 16 | -------------------------------------------------------------------------------- /roles/postgres-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "postgres-server", 3 | "description": "A Postgres database server", 4 | "default_attributes": { 5 | "postgresql" : { 6 | "version" : "13" 7 | } 8 | }, 9 | "json_class": "Chef::Role", 10 | "run_list": [ 11 | "role[server]", 12 | "recipe[rdr_postgresql_wrapper::default]", 13 | "recipe[monit_configs-tlq::postgres]" 14 | ], 15 | "chef_type": "role" 16 | } 17 | -------------------------------------------------------------------------------- /clients/demo-server-2.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-server-2", 3 | "public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyFSZh0b9j46Y8hBu9zfG\nfV6MmUlDSdXgwZvxBtU3XKhtG/cJSDV/wQCLhCpTYicbYNtuWi7xDltUL6VUfgzp\nfB4FkChLqYYLFOeiysXl3xJnq++v5cVnGwN3ZXs8hMUoClDu3uhO4YM/1LKbZ5rR\nMtocWNgf9Hc9QfQ84Ql79WKh0VTmnVhMErQL3/wK5MN5BTZVJkQ5oExnrR+sTqCy\nHEP2q4gljOfny0yoU/lMICVsuQ4QEKQJ0GUoBTT/i+ATSrw4nrZlnof6sJYO2hXU\nT+C8AkEc1xaJ+yyisF5Kv9M+wEENqiQnO/FBN1xCZnTEtz1LuAJZfk88Q+X5ANk9\nuQIDAQAB\n-----END PUBLIC KEY-----\n" 4 | } -------------------------------------------------------------------------------- /clients/demo-server-3.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-server-3", 3 | "public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArWiDkBdwwqQPtHudgVEr\n4/otToyDDLEaovFpgP2mRk3gBSaXwhyLDIImlq04ulFAVw5q+ITIFF1TpHHV9Ybo\nNHknI7JSBd1Ku9G3XrtRwryYwDEeg1/ANEsuy/1zeJtQVaSEPrEiiuH2v4Pnjpub\n9tzsV2ed0EwUVSyaQ1/TADIiN8/e29DXogsD2danIdWSzNsLlfHDxOyNNJYJbRCn\nSBKCyHcf4CkLbLim3AfTuYDUPR5kPBbT3K+jaJlg8vKBTfW7UW3nFI+1zlE84Odj\ntB81NR3ShLDQ/uqOq2ThlqGZLRg9k/8d7OiNACGhO96qn6uCFHyow8TEfZ5icQtT\n9QIDAQAB\n-----END PUBLIC KEY-----\n" 4 | } -------------------------------------------------------------------------------- /site-cookbooks/rdr_ruby_rbenv_wrapper/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook:: ruby_rbenv_wrapper 3 | # Recipe:: default 4 | # 5 | # Copyright:: 2020, The Authors, All Rights Reserved. 6 | 7 | rbenv_system_install 'system' 8 | 9 | node['rbenv']['rubies'].each do |ruby| 10 | rbenv_ruby ruby 11 | end 12 | 13 | node['rbenv']['gems'].each do |version, gems| 14 | gems.each do |the_gem| 15 | rbenv_gem the_gem['name'] do 16 | rbenv_version version 17 | end 18 | end 19 | end 20 | 21 | rbenv_global node['rbenv']['rubies'].first -------------------------------------------------------------------------------- /clients/ubuntu.members.linode.com.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ubuntu.members.linode.com", 3 | "public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoU4J4OMvnIRl2CMcFVa1\n+ejlMI9eatmzx6ZdAdxaBpvr57r/yWghbWhVQLhShSiBKk9d5fjwNV+VvLeAeLC1\nV+YSVURIE5yfEXb9/+kdJTSwOYCNboDf7qDG9olaKt1ETiZXMQtP/hXmxk6wEpO9\n7DOe2rwEavhGG00vfARlwxm9JfFhFpXlHFf4LQMEY6aJ/hebyUY1AvWoH5Gn0NKD\nAM41YC+GAprrpL/Tf1p1lYrO+b6dk++wIpabRdgEqFCtCFQ1g/+arFj57cAVC6EB\nX3XPVAN+6XjOu9Vka/RzDZUgei246Qc1x0vdPa0n28suNZR8WTcSNN0PLZdEh/r/\nGwIDAQAB\n-----END PUBLIC KEY-----\n" 4 | } -------------------------------------------------------------------------------- /roles/nginx-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nginx-server", 3 | "description": "An Nginx server", 4 | "default_attributes": { 5 | "firewall" : { 6 | "rules" : [ 7 | {"allow http on port 80" : {"port" : 80}} 8 | ] 9 | }, 10 | "nginx" : { 11 | "default_site_enabled" : false 12 | } 13 | }, 14 | "json_class": "Chef::Role", 15 | "run_list": [ 16 | "role[server]", 17 | "recipe[rdr_nginx_wrapper::default]", 18 | "recipe[monit_configs-tlq::nginx]", 19 | "recipe[ufw::default]" 20 | ], 21 | "chef_type": "role" 22 | } 23 | -------------------------------------------------------------------------------- /roles/rails-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rails-app", 3 | "description": "A server which will be running Ruby on Rails applications", 4 | "default_attributes": { 5 | "rbenv":{ 6 | "rubies": [ 7 | "3.0.0" 8 | ], 9 | "global" : "3.0.0", 10 | "gems": { 11 | "3.0.0" : [ 12 | {"name":"bundler"} 13 | ] 14 | } 15 | } 16 | 17 | }, 18 | "json_class": "Chef::Role", 19 | "run_list": [ 20 | "recipe[rails_gem_dependencies-tlq::default]", 21 | "recipe[rdr_ruby_rbenv_wrapper::default]" 22 | ], 23 | "chef_type": "role", 24 | "override_attributes": { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_nginx_wrapper/Policyfile.rb: -------------------------------------------------------------------------------- 1 | # Policyfile.rb - Describe how you want Chef Infra Client to build your system. 2 | # 3 | # For more information on the Policyfile feature, visit 4 | # https://docs.chef.io/policyfile/ 5 | 6 | # A name that describes what the system you're building with Chef does. 7 | name 'rdr_nginx_wrapper' 8 | 9 | # Where to find external cookbooks: 10 | default_source :supermarket 11 | 12 | # run_list: chef-client will run these recipes in the order specified. 13 | run_list 'rdr_nginx_wrapper::default' 14 | 15 | # Specify a custom source for a single cookbook: 16 | cookbook 'rdr_nginx_wrapper', path: '.' 17 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_sudo_wrapper/Policyfile.rb: -------------------------------------------------------------------------------- 1 | # Policyfile.rb - Describe how you want Chef Infra Client to build your system. 2 | # 3 | # For more information on the Policyfile feature, visit 4 | # https://docs.chef.io/policyfile/ 5 | 6 | # A name that describes what the system you're building with Chef does. 7 | name 'rdr_sudo_wrapper' 8 | 9 | # Where to find external cookbooks: 10 | default_source :supermarket 11 | 12 | # run_list: chef-client will run these recipes in the order specified. 13 | run_list 'rdr_sudo_wrapper::default' 14 | 15 | # Specify a custom source for a single cookbook: 16 | cookbook 'rdr_sudo_wrapper', path: '.' 17 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_users_wrapper/Policyfile.rb: -------------------------------------------------------------------------------- 1 | # Policyfile.rb - Describe how you want Chef Infra Client to build your system. 2 | # 3 | # For more information on the Policyfile feature, visit 4 | # https://docs.chef.io/policyfile/ 5 | 6 | # A name that describes what the system you're building with Chef does. 7 | name 'rdr_users_wrapper' 8 | 9 | # Where to find external cookbooks: 10 | default_source :supermarket 11 | 12 | # run_list: chef-client will run these recipes in the order specified. 13 | run_list 'rdr_users_wrapper::default' 14 | 15 | # Specify a custom source for a single cookbook: 16 | cookbook 'rdr_users_wrapper', path: '.' 17 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_redisio_wrapper/Policyfile.rb: -------------------------------------------------------------------------------- 1 | # Policyfile.rb - Describe how you want Chef Infra Client to build your system. 2 | # 3 | # For more information on the Policyfile feature, visit 4 | # https://docs.chef.io/policyfile/ 5 | 6 | # A name that describes what the system you're building with Chef does. 7 | name 'rdr_redisio_wrapper' 8 | 9 | # Where to find external cookbooks: 10 | default_source :supermarket 11 | 12 | # run_list: chef-client will run these recipes in the order specified. 13 | run_list 'rdr_redisio_wrapper::default' 14 | 15 | # Specify a custom source for a single cookbook: 16 | cookbook 'rdr_redisio_wrapper', path: '.' 17 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_memcached_wrapper/Policyfile.rb: -------------------------------------------------------------------------------- 1 | # Policyfile.rb - Describe how you want Chef Infra Client to build your system. 2 | # 3 | # For more information on the Policyfile feature, visit 4 | # https://docs.chef.io/policyfile/ 5 | 6 | # A name that describes what the system you're building with Chef does. 7 | name 'rdr_memcached_wrapper' 8 | 9 | # Where to find external cookbooks: 10 | default_source :supermarket 11 | 12 | # run_list: chef-client will run these recipes in the order specified. 13 | run_list 'rdr_memcached_wrapper::default' 14 | 15 | # Specify a custom source for a single cookbook: 16 | cookbook 'rdr_memcached_wrapper', path: '.' 17 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_postgresql_wrapper/Policyfile.rb: -------------------------------------------------------------------------------- 1 | # Policyfile.rb - Describe how you want Chef Infra Client to build your system. 2 | # 3 | # For more information on the Policyfile feature, visit 4 | # https://docs.chef.io/policyfile/ 5 | 6 | # A name that describes what the system you're building with Chef does. 7 | name 'rdr_postgresql_wrapper' 8 | 9 | # Where to find external cookbooks: 10 | default_source :supermarket 11 | 12 | # run_list: chef-client will run these recipes in the order specified. 13 | run_list 'rdr_postgresql_wrapper::default' 14 | 15 | # Specify a custom source for a single cookbook: 16 | cookbook 'rdr_postgresql_wrapper', path: '.' 17 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_ruby_rbenv_wrapper/Policyfile.rb: -------------------------------------------------------------------------------- 1 | # Policyfile.rb - Describe how you want Chef Infra Client to build your system. 2 | # 3 | # For more information on the Policyfile feature, visit 4 | # https://docs.chef.io/policyfile/ 5 | 6 | # A name that describes what the system you're building with Chef does. 7 | name 'rdr_ruby_rbenv_wrapper' 8 | 9 | # Where to find external cookbooks: 10 | default_source :supermarket 11 | 12 | # run_list: chef-client will run these recipes in the order specified. 13 | run_list 'rdr_ruby_rbenv_wrapper::default' 14 | 15 | # Specify a custom source for a single cookbook: 16 | cookbook 'rdr_ruby_rbenv_wrapper', path: '.' 17 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_nginx_wrapper/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook:: nginx_wrapper 3 | # Recipe:: default 4 | # 5 | # Copyright:: 2020, The Authors, All Rights Reserved. 6 | 7 | nginx_install 'default' do 8 | source 'repo' 9 | end 10 | 11 | nginx_service 'nginx' do 12 | config_test true 13 | action :enable 14 | delayed_action :start 15 | end 16 | 17 | nginx_config 'nginx' do 18 | action :create 19 | conf_cookbook 'rdr_nginx_wrapper' 20 | conf_template 'nginx.conf.erb' 21 | default_site_enabled true 22 | notifies :reload, 'nginx_service[nginx]', :delayed 23 | end 24 | 25 | directory '/etc/nginx/sites-available/' do 26 | action :create 27 | end 28 | 29 | directory '/etc/nginx/sites-enabled/' do 30 | action :create 31 | end 32 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_sudo_wrapper/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'rdr_sudo_wrapper' 2 | maintainer 'The Authors' 3 | maintainer_email 'you@example.com' 4 | license 'All Rights Reserved' 5 | description 'Installs/Configures rdr_sudo_wrapper' 6 | version '0.1.0' 7 | chef_version '>= 15.0' 8 | 9 | # The `issues_url` points to the location where issues for this cookbook are 10 | # tracked. A `View Issues` link will be displayed on this cookbook's page when 11 | # uploaded to a Supermarket. 12 | # 13 | # issues_url 'https://github.com//rdr_sudo_wrapper/issues' 14 | 15 | # The `source_url` points to the development repository for this cookbook. A 16 | # `View Source` link will be displayed on this cookbook's page when uploaded to 17 | # a Supermarket. 18 | # 19 | # source_url 'https://github.com//rdr_sudo_wrapper' 20 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_nginx_wrapper/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'rdr_nginx_wrapper' 2 | maintainer 'Ben Dixon' 3 | maintainer_email 'ben@talkingquickly.co.uk' 4 | license 'MIT License' 5 | description 'A lightweight wrapper around the community Nginx Cookbook' 6 | version '0.1.0' 7 | chef_version '>= 15.0' 8 | depends 'nginx' 9 | 10 | # The `issues_url` points to the location where issues for this cookbook are 11 | # tracked. A `View Issues` link will be displayed on this cookbook's page when 12 | # uploaded to a Supermarket. 13 | # 14 | # issues_url 'https://github.com//nginx_wrapper/issues' 15 | 16 | # The `source_url` points to the development repository for this cookbook. A 17 | # `View Source` link will be displayed on this cookbook's page when uploaded to 18 | # a Supermarket. 19 | # 20 | # source_url 'https://github.com//nginx_wrapper' 21 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_memcached_wrapper/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'rdr_memcached_wrapper' 2 | maintainer 'The Authors' 3 | maintainer_email 'you@example.com' 4 | license 'All Rights Reserved' 5 | description 'Installs/Configures rdr_memcached_wrapper' 6 | version '0.1.0' 7 | chef_version '>= 15.0' 8 | depends 'memcached' 9 | 10 | # The `issues_url` points to the location where issues for this cookbook are 11 | # tracked. A `View Issues` link will be displayed on this cookbook's page when 12 | # uploaded to a Supermarket. 13 | # 14 | # issues_url 'https://github.com//rdr_memcached_wrapper/issues' 15 | 16 | # The `source_url` points to the development repository for this cookbook. A 17 | # `View Source` link will be displayed on this cookbook's page when uploaded to 18 | # a Supermarket. 19 | # 20 | # source_url 'https://github.com//rdr_memcached_wrapper' 21 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_postgresql_wrapper/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'rdr_postgresql_wrapper' 2 | maintainer 'Ben Dixon' 3 | maintainer_email 'ben@talkingquickly.co.uk' 4 | license 'MIT License' 5 | description 'Installs PostgreSQL Client, Server and Development Headers' 6 | version '0.1.0' 7 | chef_version '>= 15.0' 8 | depends 'postgresql' 9 | 10 | # The `issues_url` points to the location where issues for this cookbook are 11 | # tracked. A `View Issues` link will be displayed on this cookbook's page when 12 | # uploaded to a Supermarket. 13 | # 14 | # issues_url 'https://github.com//postgresql_wrapper/issues' 15 | 16 | # The `source_url` points to the development repository for this cookbook. A 17 | # `View Source` link will be displayed on this cookbook's page when uploaded to 18 | # a Supermarket. 19 | # 20 | # source_url 'https://github.com//postgresql_wrapper' 21 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_ruby_rbenv_wrapper/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'rdr_ruby_rbenv_wrapper' 2 | maintainer 'Ben Dixon' 3 | maintainer_email 'ben@talkingquickly.co.uk' 4 | license 'MIT License' 5 | description 'Installs/Configures RBenv and one or more ruby versions + default gems' 6 | version '0.1.0' 7 | chef_version '>= 15.0' 8 | depends 'ruby_rbenv' 9 | 10 | # The `issues_url` points to the location where issues for this cookbook are 11 | # tracked. A `View Issues` link will be displayed on this cookbook's page when 12 | # uploaded to a Supermarket. 13 | # 14 | # issues_url 'https://github.com//ruby_rbenv_wrapper/issues' 15 | 16 | # The `source_url` points to the development repository for this cookbook. A 17 | # `View Source` link will be displayed on this cookbook's page when uploaded to 18 | # a Supermarket. 19 | # 20 | # source_url 'https://github.com//ruby_rbenv_wrapper' 21 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_redisio_wrapper/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'rdr_redisio_wrapper' 2 | maintainer 'Ben Dixon' 3 | maintainer_email 'ben@talkingquickly.co.uk' 4 | license 'MIT License' 5 | description 'A lightweight wrapper around the community redisio LWRP\'s for installing Redis server' 6 | version '0.1.0' 7 | chef_version '>= 15.0' 8 | depends 'redisio' 9 | 10 | # The `issues_url` points to the location where issues for this cookbook are 11 | # tracked. A `View Issues` link will be displayed on this cookbook's page when 12 | # uploaded to a Supermarket. 13 | # 14 | # issues_url 'https://github.com//rdr_redisio_wrapper/issues' 15 | 16 | # The `source_url` points to the development repository for this cookbook. A 17 | # `View Source` link will be displayed on this cookbook's page when uploaded to 18 | # a Supermarket. 19 | # 20 | # source_url 'https://github.com//rdr_redisio_wrapper' 21 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_sudo_wrapper/kitchen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | driver: 3 | name: vagrant 4 | 5 | ## The forwarded_port port feature lets you connect to ports on the VM guest via 6 | ## localhost on the host. 7 | ## see also: https://www.vagrantup.com/docs/networking/forwarded_ports 8 | 9 | # network: 10 | # - ["forwarded_port", {guest: 80, host: 8080}] 11 | 12 | provisioner: 13 | name: chef_zero 14 | 15 | ## product_name and product_version specifies a specific Chef product and version to install. 16 | ## see the Chef documentation for more details: https://docs.chef.io/workstation/config_yml_kitchen/ 17 | # product_name: chef 18 | # product_version: 16 19 | 20 | verifier: 21 | name: inspec 22 | 23 | platforms: 24 | - name: ubuntu-20.04 25 | - name: centos-8 26 | 27 | suites: 28 | - name: default 29 | verifier: 30 | inspec_tests: 31 | - test/integration/default 32 | attributes: 33 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_users_wrapper/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'rdr_users_wrapper' 2 | maintainer 'Ben Dixon' 3 | maintainer_email 'ben@talkingquickqly.co.uk' 4 | license 'MIT License' 5 | description 'Wrapper cookbook around; https://github.com/sous-chefs/users which will add the users defined in the users data bag' 6 | version '0.1.0' 7 | chef_version '>= 15.0' 8 | depends 'users' 9 | 10 | # The `issues_url` points to the location where issues for this cookbook are 11 | # tracked. A `View Issues` link will be displayed on this cookbook's page when 12 | # uploaded to a Supermarket. 13 | # 14 | # issues_url 'https://github.com//users_wrapper/issues' 15 | 16 | # The `source_url` points to the development repository for this cookbook. A 17 | # `View Source` link will be displayed on this cookbook's page when uploaded to 18 | # a Supermarket. 19 | # 20 | # source_url 'https://github.com//users_wrapper' 21 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_users_wrapper/kitchen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | driver: 3 | name: vagrant 4 | 5 | ## The forwarded_port port feature lets you connect to ports on the VM guest via 6 | ## localhost on the host. 7 | ## see also: https://www.vagrantup.com/docs/networking/forwarded_ports.html 8 | 9 | # network: 10 | # - ["forwarded_port", {guest: 80, host: 8080}] 11 | 12 | provisioner: 13 | name: chef_zero 14 | 15 | ## product_name and product_version specifies a specific Chef product and version to install. 16 | ## see the Chef documentation for more details: https://docs.chef.io/workstation/config_yml_kitchen/ 17 | # product_name: chef 18 | # product_version: 16 19 | 20 | verifier: 21 | name: inspec 22 | 23 | platforms: 24 | - name: ubuntu-20.04 25 | - name: centos-8 26 | 27 | suites: 28 | - name: default 29 | verifier: 30 | inspec_tests: 31 | - test/integration/default 32 | attributes: 33 | -------------------------------------------------------------------------------- /Berksfile: -------------------------------------------------------------------------------- 1 | source "https://api.berkshelf.com" 2 | 3 | cookbook 'apt', '~> 7.4.0' 4 | 5 | cookbook 'fail2ban', '~> 6.3.2' 6 | 7 | cookbook 'hostnames', '= 0.3.1' 8 | 9 | cookbook 'locale', '~> 1.1.0' 10 | 11 | cookbook 'memcached', '~> 6.1.0' 12 | 13 | cookbook 'mysql', '~> 5.6.3' 14 | 15 | cookbook 'ntp', '~> 3.7.0' 16 | 17 | cookbook 'openssh', '~> 2.9.0' 18 | 19 | cookbook 'postgresql', '~> 8.2.1' 20 | 21 | cookbook 'sudo', '~> 5.4.6' 22 | 23 | cookbook 'ufw', '~> 3.2.1' 24 | 25 | cookbook 'nginx', '~> 11.4.0' 26 | 27 | cookbook 'users', '~> 5.5.0' 28 | 29 | cookbook 'ruby_build', '~> 2.1.1' 30 | cookbook 'ruby_rbenv', github: 'sous-chefs/ruby_rbenv' 31 | 32 | cookbook 'rails_gem_dependencies-tlq', github: 'TalkingQuickly/rails_gem_dependencies-tlq', tag: '1.0.0' 33 | cookbook 'redisio', '~> 4.2.0' 34 | cookbook 'monit-tlq', github: 'TalkingQuickly/monit-tlq', tag: '0.5.0' 35 | cookbook 'monit_configs-tlq', github: 'TalkingQuickly/monit_configs-tlq', tag: '1.0.0' 36 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Rails Server Template 2 | 3 | ## Overview 4 | 5 | This is a template chef structure for deploying Rails applications. The example template and Vagrantfile provide a single VM configuration which works out of the box and can be used to deploy any Rails 4.x, 5.x or 6.x application. It can be used as a drop in replacement for platforms like Heroku or Elastic Beanstalk. 6 | 7 | The configuration is also flexible enough to be adapted to multi machine setups. 8 | 9 | ## Documentation 10 | 11 | This is the example code which section one of the book "Reliably Deploying Rails Applications" available from leanpub here is based. 12 | 13 | If you run into any issues using the template provided here, please open a Github issue, I actively monitor these and will respond as quickly as possible. 14 | 15 | ## Requirements 16 | 17 | This template is designed to work on Ubuntu 20.04 (the current LTS) and is tested regularly against Digital Ocean and Linode. 18 | 19 | When opening an issue, please include the Ubuntu version and provider the issue was encountered on. 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 Ben Dixon 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /site-cookbooks/rdr_postgresql_wrapper/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook:: postgresql_wrapper 3 | # Recipe:: default 4 | # 5 | # Copyright:: 2020, The Authors, All Rights Reserved. 6 | 7 | postgresql_client_install 'PostgreSQL Client' do 8 | setup_repo true 9 | version node['postgresql']['version'] 10 | end 11 | 12 | postgresql_server_install 'Install PostgreSQL Server' do 13 | action :install 14 | version node['postgresql']['version'] 15 | setup_repo true 16 | end 17 | 18 | postgresql_server_install 'Setup PostgreSQL Server' do 19 | action :create 20 | version node['postgresql']['version'] 21 | password node['postgresql']['password']['postgres'] 22 | end 23 | 24 | package 'libpq-dev' 25 | 26 | find_resource(:service, 'postgresql') do 27 | extend PostgresqlCookbook::Helpers 28 | service_name(lazy { platform_service_name }) 29 | supports restart: true, status: true, reload: true 30 | action [:enable, :start] 31 | version node['postgresql']['version'] 32 | end 33 | 34 | postgresql_server_conf 'PostgreSQL Config' do 35 | version node['postgresql']['version'] 36 | notifies :reload, 'service[postgresql]' 37 | end -------------------------------------------------------------------------------- /site-cookbooks/rdr_memcached_wrapper/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 Ben Dixon 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /site-cookbooks/rdr_nginx_wrapper/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 Ben Dixon 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /site-cookbooks/rdr_redisio_wrapper/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 Ben Dixon 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /site-cookbooks/rdr_users_wrapper/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 Ben Dixon 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /site-cookbooks/rdr_postgresql_wrapper/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 Ben Dixon 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /site-cookbooks/rdr_ruby_rbenv_wrapper/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 Ben Dixon 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /site-cookbooks/rdr_sudo_wrapper/.delivery/project.toml: -------------------------------------------------------------------------------- 1 | # Delivery for Local Phases Execution 2 | # 3 | # This file allows you to execute test phases locally on a workstation or 4 | # in a CI pipeline. The delivery-cli will read this file and execute the 5 | # command(s) that are configured for each phase. You can customize them 6 | # by just modifying the phase key on this file. 7 | # 8 | # By default these phases are configured for Cookbook Workflow only 9 | # 10 | 11 | [local_phases] 12 | unit = "chef exec rspec spec/" 13 | lint = "chef exec cookstyle" 14 | # foodcritic has been deprecated in favor of cookstyle so we skip the syntax 15 | # phase now. 16 | syntax = "echo skipping syntax phase. Use lint phase instead." 17 | provision = "chef exec kitchen create" 18 | deploy = "chef exec kitchen converge" 19 | smoke = "chef exec kitchen verify" 20 | # The functional phase is optional, you can define it by uncommenting 21 | # the line below and running the command: `delivery local functional` 22 | # functional = "" 23 | cleanup = "chef exec kitchen destroy" 24 | 25 | # Remote project.toml file 26 | # 27 | # Instead of the local phases above, you may specify a remote URI location for 28 | # the `project.toml` file. This is useful for teams that wish to centrally 29 | # manage the behavior of the `delivery local` command across many different 30 | # projects. 31 | # 32 | # remote_file = "https://url/project.toml" 33 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_memcached_wrapper/.delivery/project.toml: -------------------------------------------------------------------------------- 1 | # Delivery for Local Phases Execution 2 | # 3 | # This file allows you to execute test phases locally on a workstation or 4 | # in a CI pipeline. The delivery-cli will read this file and execute the 5 | # command(s) that are configured for each phase. You can customize them 6 | # by just modifying the phase key on this file. 7 | # 8 | # By default these phases are configured for Cookbook Workflow only 9 | # 10 | 11 | [local_phases] 12 | unit = "chef exec rspec spec/" 13 | lint = "chef exec cookstyle" 14 | # foodcritic has been deprecated in favor of cookstyle so we skip the syntax 15 | # phase now. 16 | syntax = "echo skipping syntax phase. Use lint phase instead." 17 | provision = "chef exec kitchen create" 18 | deploy = "chef exec kitchen converge" 19 | smoke = "chef exec kitchen verify" 20 | # The functional phase is optional, you can define it by uncommenting 21 | # the line below and running the command: `delivery local functional` 22 | # functional = "" 23 | cleanup = "chef exec kitchen destroy" 24 | 25 | # Remote project.toml file 26 | # 27 | # Instead of the local phases above, you may specify a remote URI location for 28 | # the `project.toml` file. This is useful for teams that wish to centrally 29 | # manage the behavior of the `delivery local` command across many different 30 | # projects. 31 | # 32 | # remote_file = "https://url/project.toml" 33 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_nginx_wrapper/.delivery/project.toml: -------------------------------------------------------------------------------- 1 | # Delivery for Local Phases Execution 2 | # 3 | # This file allows you to execute test phases locally on a workstation or 4 | # in a CI pipeline. The delivery-cli will read this file and execute the 5 | # command(s) that are configured for each phase. You can customize them 6 | # by just modifying the phase key on this file. 7 | # 8 | # By default these phases are configured for Cookbook Workflow only 9 | # 10 | 11 | [local_phases] 12 | unit = "chef exec rspec spec/" 13 | lint = "chef exec cookstyle" 14 | # foodcritic has been deprecated in favor of cookstyle so we skip the syntax 15 | # phase now. 16 | syntax = "echo skipping syntax phase. Use lint phase instead." 17 | provision = "chef exec kitchen create" 18 | deploy = "chef exec kitchen converge" 19 | smoke = "chef exec kitchen verify" 20 | # The functional phase is optional, you can define it by uncommenting 21 | # the line below and running the command: `delivery local functional` 22 | # functional = "" 23 | cleanup = "chef exec kitchen destroy" 24 | 25 | # Remote project.toml file 26 | # 27 | # Instead of the local phases above, you may specify a remote URI location for 28 | # the `project.toml` file. This is useful for teams that wish to centrally 29 | # manage the behavior of the `delivery local` command across many different 30 | # projects. 31 | # 32 | # remote_file = "https://url/project.toml" 33 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_redisio_wrapper/.delivery/project.toml: -------------------------------------------------------------------------------- 1 | # Delivery for Local Phases Execution 2 | # 3 | # This file allows you to execute test phases locally on a workstation or 4 | # in a CI pipeline. The delivery-cli will read this file and execute the 5 | # command(s) that are configured for each phase. You can customize them 6 | # by just modifying the phase key on this file. 7 | # 8 | # By default these phases are configured for Cookbook Workflow only 9 | # 10 | 11 | [local_phases] 12 | unit = "chef exec rspec spec/" 13 | lint = "chef exec cookstyle" 14 | # foodcritic has been deprecated in favor of cookstyle so we skip the syntax 15 | # phase now. 16 | syntax = "echo skipping syntax phase. Use lint phase instead." 17 | provision = "chef exec kitchen create" 18 | deploy = "chef exec kitchen converge" 19 | smoke = "chef exec kitchen verify" 20 | # The functional phase is optional, you can define it by uncommenting 21 | # the line below and running the command: `delivery local functional` 22 | # functional = "" 23 | cleanup = "chef exec kitchen destroy" 24 | 25 | # Remote project.toml file 26 | # 27 | # Instead of the local phases above, you may specify a remote URI location for 28 | # the `project.toml` file. This is useful for teams that wish to centrally 29 | # manage the behavior of the `delivery local` command across many different 30 | # projects. 31 | # 32 | # remote_file = "https://url/project.toml" 33 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_users_wrapper/.delivery/project.toml: -------------------------------------------------------------------------------- 1 | # Delivery for Local Phases Execution 2 | # 3 | # This file allows you to execute test phases locally on a workstation or 4 | # in a CI pipeline. The delivery-cli will read this file and execute the 5 | # command(s) that are configured for each phase. You can customize them 6 | # by just modifying the phase key on this file. 7 | # 8 | # By default these phases are configured for Cookbook Workflow only 9 | # 10 | 11 | [local_phases] 12 | unit = "chef exec rspec spec/" 13 | lint = "chef exec cookstyle" 14 | # foodcritic has been deprecated in favor of cookstyle so we skip the syntax 15 | # phase now. 16 | syntax = "echo skipping syntax phase. Use lint phase instead." 17 | provision = "chef exec kitchen create" 18 | deploy = "chef exec kitchen converge" 19 | smoke = "chef exec kitchen verify" 20 | # The functional phase is optional, you can define it by uncommenting 21 | # the line below and running the command: `delivery local functional` 22 | # functional = "" 23 | cleanup = "chef exec kitchen destroy" 24 | 25 | # Remote project.toml file 26 | # 27 | # Instead of the local phases above, you may specify a remote URI location for 28 | # the `project.toml` file. This is useful for teams that wish to centrally 29 | # manage the behavior of the `delivery local` command across many different 30 | # projects. 31 | # 32 | # remote_file = "https://url/project.toml" 33 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_postgresql_wrapper/.delivery/project.toml: -------------------------------------------------------------------------------- 1 | # Delivery for Local Phases Execution 2 | # 3 | # This file allows you to execute test phases locally on a workstation or 4 | # in a CI pipeline. The delivery-cli will read this file and execute the 5 | # command(s) that are configured for each phase. You can customize them 6 | # by just modifying the phase key on this file. 7 | # 8 | # By default these phases are configured for Cookbook Workflow only 9 | # 10 | 11 | [local_phases] 12 | unit = "chef exec rspec spec/" 13 | lint = "chef exec cookstyle" 14 | # foodcritic has been deprecated in favor of cookstyle so we skip the syntax 15 | # phase now. 16 | syntax = "echo skipping syntax phase. Use lint phase instead." 17 | provision = "chef exec kitchen create" 18 | deploy = "chef exec kitchen converge" 19 | smoke = "chef exec kitchen verify" 20 | # The functional phase is optional, you can define it by uncommenting 21 | # the line below and running the command: `delivery local functional` 22 | # functional = "" 23 | cleanup = "chef exec kitchen destroy" 24 | 25 | # Remote project.toml file 26 | # 27 | # Instead of the local phases above, you may specify a remote URI location for 28 | # the `project.toml` file. This is useful for teams that wish to centrally 29 | # manage the behavior of the `delivery local` command across many different 30 | # projects. 31 | # 32 | # remote_file = "https://url/project.toml" 33 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_ruby_rbenv_wrapper/.delivery/project.toml: -------------------------------------------------------------------------------- 1 | # Delivery for Local Phases Execution 2 | # 3 | # This file allows you to execute test phases locally on a workstation or 4 | # in a CI pipeline. The delivery-cli will read this file and execute the 5 | # command(s) that are configured for each phase. You can customize them 6 | # by just modifying the phase key on this file. 7 | # 8 | # By default these phases are configured for Cookbook Workflow only 9 | # 10 | 11 | [local_phases] 12 | unit = "chef exec rspec spec/" 13 | lint = "chef exec cookstyle" 14 | # foodcritic has been deprecated in favor of cookstyle so we skip the syntax 15 | # phase now. 16 | syntax = "echo skipping syntax phase. Use lint phase instead." 17 | provision = "chef exec kitchen create" 18 | deploy = "chef exec kitchen converge" 19 | smoke = "chef exec kitchen verify" 20 | # The functional phase is optional, you can define it by uncommenting 21 | # the line below and running the command: `delivery local functional` 22 | # functional = "" 23 | cleanup = "chef exec kitchen destroy" 24 | 25 | # Remote project.toml file 26 | # 27 | # Instead of the local phases above, you may specify a remote URI location for 28 | # the `project.toml` file. This is useful for teams that wish to centrally 29 | # manage the behavior of the `delivery local` command across many different 30 | # projects. 31 | # 32 | # remote_file = "https://url/project.toml" 33 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_nginx_wrapper/templates/nginx.conf.erb: -------------------------------------------------------------------------------- 1 | 2 | # Generated by Chef for <%= node['fqdn'] %> 3 | # Do NOT modify this file by hand. 4 | # 5 | 6 | user <%= @process_user %><% if @process_group != @process_user %> <%= @process_group %><% end %>; 7 | worker_processes <%= @worker_processes %>; 8 | error_log <%= @nginx_log_dir %>/error.log; 9 | pid <%= @pid %>; 10 | 11 | <% if (node['platform'] == 'debian' && node['platform_version'].to_i >= 9) || (node['platform'] == 'ubuntu' && node['platform_version'].to_i >= 18) %> 12 | include /etc/nginx/modules-enabled/*.conf; 13 | <% end -%> 14 | <% if %w(amazon centos fedora).include?(node['platform']) -%> 15 | include /usr/share/nginx/modules/*.conf; 16 | <% end -%> 17 | 18 | events { 19 | worker_connections <%= @worker_connections %>; 20 | } 21 | 22 | http { 23 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 24 | '$status $body_bytes_sent "$http_referer" ' 25 | '"$http_user_agent" "$http_x_forwarded_for"'; 26 | 27 | access_log <%= @nginx_log_dir %>/access.log main; 28 | 29 | sendfile <%= @sendfile %>; 30 | tcp_nopush <%= @tcp_nopush %>; 31 | tcp_nodelay <%= @tcp_nodelay %>; 32 | keepalive_timeout <%= @keepalive_timeout %>; 33 | types_hash_max_size <%= @types_hash_max_size %>; 34 | server_names_hash_bucket_size 128; # support for long hostnames 35 | 36 | include <%= @nginx_dir %>/mime.types; 37 | default_type application/octet-stream; 38 | 39 | include <%= @nginx_dir %>/conf.d/*.conf; 40 | include <%= @nginx_dir %>/conf.http.d/list*.conf; 41 | include <%= @nginx_dir %>/sites-enabled/*; 42 | } -------------------------------------------------------------------------------- /nodes/139.162.229.194.json.old: -------------------------------------------------------------------------------- 1 | { 2 | "environment":"production", 3 | "authorization": { 4 | "sudo": { 5 | // An array of users who should have access to sudo. 6 | // If you're using vagrant it's worth adding "vagrant" 7 | // to this array 8 | // The password for the deploy user is set in data_bags/users/deploy.json 9 | // and should be generated using: 10 | // openssl passwd -1 "plaintextpassword" 11 | "users": ["deploy"] 12 | } 13 | }, 14 | "monit": { 15 | "enable_emails" : false, 16 | "mailserver" : { 17 | // For example Mailgun or Sendgrid 18 | "host" : "REPLACE.example.com", 19 | "port" : "999", 20 | "username" : "REPLACE", 21 | "password" : "REPLACE", 22 | "hostname" : "REPLACE" 23 | }, 24 | "notify_emails" : ["REPLACE@example.com"], 25 | "web_interface" : { 26 | // the plaintext monit username and password 27 | "allow" : ["REPLACE(USERNAME)","REPLACE(PASSWORD)"] 28 | } 29 | }, 30 | "postgresql" : { 31 | "password" : { 32 | // this should be generated with: 33 | // openssl passwd -1 "plaintextpassword" 34 | "postgres" : "REPLACE" 35 | } 36 | }, 37 | "rbenv":{ 38 | "rubies": [ 39 | "2.3.1" 40 | ], 41 | "global" : "2.3.1", 42 | "gems": { 43 | "2.3.1" : [ 44 | {"name":"bundler"} 45 | ] 46 | } 47 | }, 48 | "vagrant" : { 49 | // See http://www.talkingquickly.co.uk/2014/08/auto-generate-vagrant-machines-from-chef-node-definitions/ for more on this 50 | "exclusions" : [], 51 | "ip" : "192.168.1.32", 52 | "name" : "rails-postgres-redis1" 53 | }, 54 | "run_list": 55 | [ 56 | "role[server]" 57 | //"role[nginx-server]", 58 | //"role[postgres-server]", 59 | //"role[rails-app]", 60 | //"role[redis-server]" 61 | ] 62 | } 63 | -------------------------------------------------------------------------------- /nodes/rails_postgres_redis.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "environment":"production", 3 | "authorization": { 4 | "sudo": { 5 | // An array of users who should have access to sudo. 6 | // If you're using vagrant it's worth adding "vagrant" 7 | // to this array 8 | // The password for the deploy user is set in data_bags/users/deploy.json 9 | // and should be generated using: 10 | // openssl passwd -1 "plaintextpassword" 11 | "users": ["deploy"] 12 | } 13 | }, 14 | "monit": { 15 | "enable_emails" : false, 16 | "mailserver" : { 17 | // For example Mailgun or Sendgrid 18 | "host" : "REPLACE.example.com", 19 | "port" : "999", 20 | "username" : "REPLACE", 21 | "password" : "REPLACE", 22 | "hostname" : "REPLACE" 23 | }, 24 | "notify_emails" : ["REPLACE@example.com"], 25 | "web_interface" : { 26 | // the plaintext monit username and password 27 | "allow" : ["REPLACE(USERNAME)","REPLACE(PASSWORD)"] 28 | } 29 | }, 30 | "postgresql" : { 31 | "password" : { 32 | // this should be generated with: 33 | // openssl passwd -1 "plaintextpassword" 34 | "postgres" : "REPLACE" 35 | } 36 | }, 37 | "rbenv":{ 38 | "rubies": [ 39 | "2.1.2" 40 | ], 41 | "global" : "2.1.2", 42 | "gems": { 43 | "2.1.2" : [ 44 | {"name":"bundler"} 45 | ] 46 | } 47 | }, 48 | "vagrant" : { 49 | // See http://www.talkingquickly.co.uk/2014/08/auto-generate-vagrant-machines-from-chef-node-definitions/ for more on this 50 | "exclusions" : [], 51 | "ip" : "192.168.1.32", 52 | "name" : "rails-postgres-redis1" 53 | }, 54 | "run_list": 55 | [ 56 | "role[server]", 57 | "role[nginx-server]", 58 | "role[postgres-server]", 59 | "role[rails-app]", 60 | "role[redis-server]" 61 | ] 62 | } 63 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_nginx_wrapper/chefignore: -------------------------------------------------------------------------------- 1 | # Put files/directories that should be ignored in this file when uploading 2 | # to a Chef Infra Server or Supermarket. 3 | # Lines that start with '# ' are comments. 4 | 5 | # OS generated files # 6 | ###################### 7 | .DS_Store 8 | ehthumbs.db 9 | Icon? 10 | nohup.out 11 | Thumbs.db 12 | .envrc 13 | 14 | # EDITORS # 15 | ########### 16 | .#* 17 | .project 18 | .settings 19 | *_flymake 20 | *_flymake.* 21 | *.bak 22 | *.sw[a-z] 23 | *.tmproj 24 | *~ 25 | \#* 26 | REVISION 27 | TAGS* 28 | tmtags 29 | .vscode 30 | .editorconfig 31 | 32 | ## COMPILED ## 33 | ############## 34 | *.class 35 | *.com 36 | *.dll 37 | *.exe 38 | *.o 39 | *.pyc 40 | *.so 41 | */rdoc/ 42 | a.out 43 | mkmf.log 44 | 45 | # Testing # 46 | ########### 47 | .circleci/* 48 | .codeclimate.yml 49 | .delivery/* 50 | .foodcritic 51 | .kitchen* 52 | .mdlrc 53 | .overcommit.yml 54 | .rspec 55 | .rubocop.yml 56 | .travis.yml 57 | .watchr 58 | .yamllint 59 | azure-pipelines.yml 60 | Dangerfile 61 | examples/* 62 | features/* 63 | Guardfile 64 | kitchen.yml* 65 | mlc_config.json 66 | Procfile 67 | Rakefile 68 | spec/* 69 | test/* 70 | 71 | # SCM # 72 | ####### 73 | .git 74 | .gitattributes 75 | .gitconfig 76 | .github/* 77 | .gitignore 78 | .gitkeep 79 | .gitmodules 80 | .svn 81 | */.bzr/* 82 | */.git 83 | */.hg/* 84 | */.svn/* 85 | 86 | # Berkshelf # 87 | ############# 88 | Berksfile 89 | Berksfile.lock 90 | cookbooks/* 91 | tmp 92 | 93 | # Bundler # 94 | ########### 95 | vendor/* 96 | Gemfile 97 | Gemfile.lock 98 | 99 | # Policyfile # 100 | ############## 101 | Policyfile.rb 102 | Policyfile.lock.json 103 | 104 | # Documentation # 105 | ############# 106 | CODE_OF_CONDUCT* 107 | CONTRIBUTING* 108 | documentation/* 109 | TESTING* 110 | UPGRADING* 111 | 112 | # Vagrant # 113 | ########### 114 | .vagrant 115 | Vagrantfile 116 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_sudo_wrapper/chefignore: -------------------------------------------------------------------------------- 1 | # Put files/directories that should be ignored in this file when uploading 2 | # to a Chef Infra Server or Supermarket. 3 | # Lines that start with '# ' are comments. 4 | 5 | # OS generated files # 6 | ###################### 7 | .DS_Store 8 | ehthumbs.db 9 | Icon? 10 | nohup.out 11 | Thumbs.db 12 | .envrc 13 | 14 | # EDITORS # 15 | ########### 16 | .#* 17 | .project 18 | .settings 19 | *_flymake 20 | *_flymake.* 21 | *.bak 22 | *.sw[a-z] 23 | *.tmproj 24 | *~ 25 | \#* 26 | REVISION 27 | TAGS* 28 | tmtags 29 | .vscode 30 | .editorconfig 31 | 32 | ## COMPILED ## 33 | ############## 34 | *.class 35 | *.com 36 | *.dll 37 | *.exe 38 | *.o 39 | *.pyc 40 | *.so 41 | */rdoc/ 42 | a.out 43 | mkmf.log 44 | 45 | # Testing # 46 | ########### 47 | .circleci/* 48 | .codeclimate.yml 49 | .delivery/* 50 | .foodcritic 51 | .kitchen* 52 | .mdlrc 53 | .overcommit.yml 54 | .rspec 55 | .rubocop.yml 56 | .travis.yml 57 | .watchr 58 | .yamllint 59 | azure-pipelines.yml 60 | Dangerfile 61 | examples/* 62 | features/* 63 | Guardfile 64 | kitchen.yml* 65 | mlc_config.json 66 | Procfile 67 | Rakefile 68 | spec/* 69 | test/* 70 | 71 | # SCM # 72 | ####### 73 | .git 74 | .gitattributes 75 | .gitconfig 76 | .github/* 77 | .gitignore 78 | .gitkeep 79 | .gitmodules 80 | .svn 81 | */.bzr/* 82 | */.git 83 | */.hg/* 84 | */.svn/* 85 | 86 | # Berkshelf # 87 | ############# 88 | Berksfile 89 | Berksfile.lock 90 | cookbooks/* 91 | tmp 92 | 93 | # Bundler # 94 | ########### 95 | vendor/* 96 | Gemfile 97 | Gemfile.lock 98 | 99 | # Policyfile # 100 | ############## 101 | Policyfile.rb 102 | Policyfile.lock.json 103 | 104 | # Documentation # 105 | ############# 106 | CODE_OF_CONDUCT* 107 | CONTRIBUTING* 108 | documentation/* 109 | TESTING* 110 | UPGRADING* 111 | 112 | # Vagrant # 113 | ########### 114 | .vagrant 115 | Vagrantfile 116 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_users_wrapper/chefignore: -------------------------------------------------------------------------------- 1 | # Put files/directories that should be ignored in this file when uploading 2 | # to a Chef Infra Server or Supermarket. 3 | # Lines that start with '# ' are comments. 4 | 5 | # OS generated files # 6 | ###################### 7 | .DS_Store 8 | ehthumbs.db 9 | Icon? 10 | nohup.out 11 | Thumbs.db 12 | .envrc 13 | 14 | # EDITORS # 15 | ########### 16 | .#* 17 | .project 18 | .settings 19 | *_flymake 20 | *_flymake.* 21 | *.bak 22 | *.sw[a-z] 23 | *.tmproj 24 | *~ 25 | \#* 26 | REVISION 27 | TAGS* 28 | tmtags 29 | .vscode 30 | .editorconfig 31 | 32 | ## COMPILED ## 33 | ############## 34 | *.class 35 | *.com 36 | *.dll 37 | *.exe 38 | *.o 39 | *.pyc 40 | *.so 41 | */rdoc/ 42 | a.out 43 | mkmf.log 44 | 45 | # Testing # 46 | ########### 47 | .circleci/* 48 | .codeclimate.yml 49 | .delivery/* 50 | .foodcritic 51 | .kitchen* 52 | .mdlrc 53 | .overcommit.yml 54 | .rspec 55 | .rubocop.yml 56 | .travis.yml 57 | .watchr 58 | .yamllint 59 | azure-pipelines.yml 60 | Dangerfile 61 | examples/* 62 | features/* 63 | Guardfile 64 | kitchen.yml* 65 | mlc_config.json 66 | Procfile 67 | Rakefile 68 | spec/* 69 | test/* 70 | 71 | # SCM # 72 | ####### 73 | .git 74 | .gitattributes 75 | .gitconfig 76 | .github/* 77 | .gitignore 78 | .gitkeep 79 | .gitmodules 80 | .svn 81 | */.bzr/* 82 | */.git 83 | */.hg/* 84 | */.svn/* 85 | 86 | # Berkshelf # 87 | ############# 88 | Berksfile 89 | Berksfile.lock 90 | cookbooks/* 91 | tmp 92 | 93 | # Bundler # 94 | ########### 95 | vendor/* 96 | Gemfile 97 | Gemfile.lock 98 | 99 | # Policyfile # 100 | ############## 101 | Policyfile.rb 102 | Policyfile.lock.json 103 | 104 | # Documentation # 105 | ############# 106 | CODE_OF_CONDUCT* 107 | CONTRIBUTING* 108 | documentation/* 109 | TESTING* 110 | UPGRADING* 111 | 112 | # Vagrant # 113 | ########### 114 | .vagrant 115 | Vagrantfile 116 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_memcached_wrapper/chefignore: -------------------------------------------------------------------------------- 1 | # Put files/directories that should be ignored in this file when uploading 2 | # to a Chef Infra Server or Supermarket. 3 | # Lines that start with '# ' are comments. 4 | 5 | # OS generated files # 6 | ###################### 7 | .DS_Store 8 | ehthumbs.db 9 | Icon? 10 | nohup.out 11 | Thumbs.db 12 | .envrc 13 | 14 | # EDITORS # 15 | ########### 16 | .#* 17 | .project 18 | .settings 19 | *_flymake 20 | *_flymake.* 21 | *.bak 22 | *.sw[a-z] 23 | *.tmproj 24 | *~ 25 | \#* 26 | REVISION 27 | TAGS* 28 | tmtags 29 | .vscode 30 | .editorconfig 31 | 32 | ## COMPILED ## 33 | ############## 34 | *.class 35 | *.com 36 | *.dll 37 | *.exe 38 | *.o 39 | *.pyc 40 | *.so 41 | */rdoc/ 42 | a.out 43 | mkmf.log 44 | 45 | # Testing # 46 | ########### 47 | .circleci/* 48 | .codeclimate.yml 49 | .delivery/* 50 | .foodcritic 51 | .kitchen* 52 | .mdlrc 53 | .overcommit.yml 54 | .rspec 55 | .rubocop.yml 56 | .travis.yml 57 | .watchr 58 | .yamllint 59 | azure-pipelines.yml 60 | Dangerfile 61 | examples/* 62 | features/* 63 | Guardfile 64 | kitchen.yml* 65 | mlc_config.json 66 | Procfile 67 | Rakefile 68 | spec/* 69 | test/* 70 | 71 | # SCM # 72 | ####### 73 | .git 74 | .gitattributes 75 | .gitconfig 76 | .github/* 77 | .gitignore 78 | .gitkeep 79 | .gitmodules 80 | .svn 81 | */.bzr/* 82 | */.git 83 | */.hg/* 84 | */.svn/* 85 | 86 | # Berkshelf # 87 | ############# 88 | Berksfile 89 | Berksfile.lock 90 | cookbooks/* 91 | tmp 92 | 93 | # Bundler # 94 | ########### 95 | vendor/* 96 | Gemfile 97 | Gemfile.lock 98 | 99 | # Policyfile # 100 | ############## 101 | Policyfile.rb 102 | Policyfile.lock.json 103 | 104 | # Documentation # 105 | ############# 106 | CODE_OF_CONDUCT* 107 | CONTRIBUTING* 108 | documentation/* 109 | TESTING* 110 | UPGRADING* 111 | 112 | # Vagrant # 113 | ########### 114 | .vagrant 115 | Vagrantfile 116 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_postgresql_wrapper/chefignore: -------------------------------------------------------------------------------- 1 | # Put files/directories that should be ignored in this file when uploading 2 | # to a Chef Infra Server or Supermarket. 3 | # Lines that start with '# ' are comments. 4 | 5 | # OS generated files # 6 | ###################### 7 | .DS_Store 8 | ehthumbs.db 9 | Icon? 10 | nohup.out 11 | Thumbs.db 12 | .envrc 13 | 14 | # EDITORS # 15 | ########### 16 | .#* 17 | .project 18 | .settings 19 | *_flymake 20 | *_flymake.* 21 | *.bak 22 | *.sw[a-z] 23 | *.tmproj 24 | *~ 25 | \#* 26 | REVISION 27 | TAGS* 28 | tmtags 29 | .vscode 30 | .editorconfig 31 | 32 | ## COMPILED ## 33 | ############## 34 | *.class 35 | *.com 36 | *.dll 37 | *.exe 38 | *.o 39 | *.pyc 40 | *.so 41 | */rdoc/ 42 | a.out 43 | mkmf.log 44 | 45 | # Testing # 46 | ########### 47 | .circleci/* 48 | .codeclimate.yml 49 | .delivery/* 50 | .foodcritic 51 | .kitchen* 52 | .mdlrc 53 | .overcommit.yml 54 | .rspec 55 | .rubocop.yml 56 | .travis.yml 57 | .watchr 58 | .yamllint 59 | azure-pipelines.yml 60 | Dangerfile 61 | examples/* 62 | features/* 63 | Guardfile 64 | kitchen.yml* 65 | mlc_config.json 66 | Procfile 67 | Rakefile 68 | spec/* 69 | test/* 70 | 71 | # SCM # 72 | ####### 73 | .git 74 | .gitattributes 75 | .gitconfig 76 | .github/* 77 | .gitignore 78 | .gitkeep 79 | .gitmodules 80 | .svn 81 | */.bzr/* 82 | */.git 83 | */.hg/* 84 | */.svn/* 85 | 86 | # Berkshelf # 87 | ############# 88 | Berksfile 89 | Berksfile.lock 90 | cookbooks/* 91 | tmp 92 | 93 | # Bundler # 94 | ########### 95 | vendor/* 96 | Gemfile 97 | Gemfile.lock 98 | 99 | # Policyfile # 100 | ############## 101 | Policyfile.rb 102 | Policyfile.lock.json 103 | 104 | # Documentation # 105 | ############# 106 | CODE_OF_CONDUCT* 107 | CONTRIBUTING* 108 | documentation/* 109 | TESTING* 110 | UPGRADING* 111 | 112 | # Vagrant # 113 | ########### 114 | .vagrant 115 | Vagrantfile 116 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_redisio_wrapper/chefignore: -------------------------------------------------------------------------------- 1 | # Put files/directories that should be ignored in this file when uploading 2 | # to a Chef Infra Server or Supermarket. 3 | # Lines that start with '# ' are comments. 4 | 5 | # OS generated files # 6 | ###################### 7 | .DS_Store 8 | ehthumbs.db 9 | Icon? 10 | nohup.out 11 | Thumbs.db 12 | .envrc 13 | 14 | # EDITORS # 15 | ########### 16 | .#* 17 | .project 18 | .settings 19 | *_flymake 20 | *_flymake.* 21 | *.bak 22 | *.sw[a-z] 23 | *.tmproj 24 | *~ 25 | \#* 26 | REVISION 27 | TAGS* 28 | tmtags 29 | .vscode 30 | .editorconfig 31 | 32 | ## COMPILED ## 33 | ############## 34 | *.class 35 | *.com 36 | *.dll 37 | *.exe 38 | *.o 39 | *.pyc 40 | *.so 41 | */rdoc/ 42 | a.out 43 | mkmf.log 44 | 45 | # Testing # 46 | ########### 47 | .circleci/* 48 | .codeclimate.yml 49 | .delivery/* 50 | .foodcritic 51 | .kitchen* 52 | .mdlrc 53 | .overcommit.yml 54 | .rspec 55 | .rubocop.yml 56 | .travis.yml 57 | .watchr 58 | .yamllint 59 | azure-pipelines.yml 60 | Dangerfile 61 | examples/* 62 | features/* 63 | Guardfile 64 | kitchen.yml* 65 | mlc_config.json 66 | Procfile 67 | Rakefile 68 | spec/* 69 | test/* 70 | 71 | # SCM # 72 | ####### 73 | .git 74 | .gitattributes 75 | .gitconfig 76 | .github/* 77 | .gitignore 78 | .gitkeep 79 | .gitmodules 80 | .svn 81 | */.bzr/* 82 | */.git 83 | */.hg/* 84 | */.svn/* 85 | 86 | # Berkshelf # 87 | ############# 88 | Berksfile 89 | Berksfile.lock 90 | cookbooks/* 91 | tmp 92 | 93 | # Bundler # 94 | ########### 95 | vendor/* 96 | Gemfile 97 | Gemfile.lock 98 | 99 | # Policyfile # 100 | ############## 101 | Policyfile.rb 102 | Policyfile.lock.json 103 | 104 | # Documentation # 105 | ############# 106 | CODE_OF_CONDUCT* 107 | CONTRIBUTING* 108 | documentation/* 109 | TESTING* 110 | UPGRADING* 111 | 112 | # Vagrant # 113 | ########### 114 | .vagrant 115 | Vagrantfile 116 | -------------------------------------------------------------------------------- /site-cookbooks/rdr_ruby_rbenv_wrapper/chefignore: -------------------------------------------------------------------------------- 1 | # Put files/directories that should be ignored in this file when uploading 2 | # to a Chef Infra Server or Supermarket. 3 | # Lines that start with '# ' are comments. 4 | 5 | # OS generated files # 6 | ###################### 7 | .DS_Store 8 | ehthumbs.db 9 | Icon? 10 | nohup.out 11 | Thumbs.db 12 | .envrc 13 | 14 | # EDITORS # 15 | ########### 16 | .#* 17 | .project 18 | .settings 19 | *_flymake 20 | *_flymake.* 21 | *.bak 22 | *.sw[a-z] 23 | *.tmproj 24 | *~ 25 | \#* 26 | REVISION 27 | TAGS* 28 | tmtags 29 | .vscode 30 | .editorconfig 31 | 32 | ## COMPILED ## 33 | ############## 34 | *.class 35 | *.com 36 | *.dll 37 | *.exe 38 | *.o 39 | *.pyc 40 | *.so 41 | */rdoc/ 42 | a.out 43 | mkmf.log 44 | 45 | # Testing # 46 | ########### 47 | .circleci/* 48 | .codeclimate.yml 49 | .delivery/* 50 | .foodcritic 51 | .kitchen* 52 | .mdlrc 53 | .overcommit.yml 54 | .rspec 55 | .rubocop.yml 56 | .travis.yml 57 | .watchr 58 | .yamllint 59 | azure-pipelines.yml 60 | Dangerfile 61 | examples/* 62 | features/* 63 | Guardfile 64 | kitchen.yml* 65 | mlc_config.json 66 | Procfile 67 | Rakefile 68 | spec/* 69 | test/* 70 | 71 | # SCM # 72 | ####### 73 | .git 74 | .gitattributes 75 | .gitconfig 76 | .github/* 77 | .gitignore 78 | .gitkeep 79 | .gitmodules 80 | .svn 81 | */.bzr/* 82 | */.git 83 | */.hg/* 84 | */.svn/* 85 | 86 | # Berkshelf # 87 | ############# 88 | Berksfile 89 | Berksfile.lock 90 | cookbooks/* 91 | tmp 92 | 93 | # Bundler # 94 | ########### 95 | vendor/* 96 | Gemfile 97 | Gemfile.lock 98 | 99 | # Policyfile # 100 | ############## 101 | Policyfile.rb 102 | Policyfile.lock.json 103 | 104 | # Documentation # 105 | ############# 106 | CODE_OF_CONDUCT* 107 | CONTRIBUTING* 108 | documentation/* 109 | TESTING* 110 | UPGRADING* 111 | 112 | # Vagrant # 113 | ########### 114 | .vagrant 115 | Vagrantfile 116 | -------------------------------------------------------------------------------- /Changelog.md: -------------------------------------------------------------------------------- 1 | ## 5.0.1 (22nd March 2021) 2 | * Upgrades sudo, ufw, apt and fail2ban cookbooks to latest versions 3 | * Fixes issue where sshd configuration wasn't in the default server role run list 4 | * Adds a wrapper cookbook for the current community sudo cookbook 5 | 6 | ## 5.0.0 (March 2021) 7 | 8 | * Updates to support latest Chef Workstation instead of legacy ChefDK 9 | * Updates for Ubuntu 20.04 (LTS) Compatibility 10 | * Migrates nginx, postgresql, memcached, redis and rbenv to use wrapper cookbooks around the primary open source cookbooks 11 | * Upgrades default Ruby version to 3.0.0 12 | * Upgrades default Postgres version to 13 13 | 14 | ## 4.0.0 15 | 16 | * Updates for Ubuntu 16.04 Compatibility 17 | * Moves from Chef Solo to Chef Zero 18 | 19 | ## 3.0.0 20 | 21 | * Replaces MongoDB cookbook with community cookbook 22 | * Replaces custom firewall management with community cookbook 23 | * Replaces custom Memcached cookbook with community cookbook 24 | * Replaces custom Nginx cookbook with community cookbook 25 | * Replaces custom Redis cookbook with the books example cookbook 26 | * Replaces custom fail2ban management with community cookbook 27 | * Replaces custom n2p management with community cookbook 28 | * Replaces custom automatic upgrade management with community cookbook 29 | * Replaces custom openssh management with community cookbook 30 | * Disables creation of Nginx defauly vhost 31 | * Adds kitchen sink example node definition to demonstrate how to use all roles and for testing -------------------------------------------------------------------------------- /nodes/rails-postgres-redis1.json: -------------------------------------------------------------------------------- 1 | { 2 | "environment":"production", 3 | "authorization": { 4 | "sudo": { 5 | // the deploy user specifically gets sudo rights 6 | // if you're using vagrant it's worth adding "vagrant" 7 | // to this array 8 | // The password for the deploy user is set in data_bags/users/deploy.json 9 | // and should be generated using: 10 | // openssl passwd -1 "plaintextpassword" 11 | "users": ["deploy", "vagrant"] 12 | } 13 | }, 14 | // See http://www.talkingquickly.co.uk/2014/08/auto-generate-vagrant-machines-from-chef-node-definitions/ for more on this 15 | "vagrant" : { 16 | "exclusions" : [], 17 | "name" : "rails-postgres-redis1", 18 | "ip" : "192.168.50.4" 19 | }, 20 | "rbenv":{ 21 | "rubies": [ 22 | "2.1.2" 23 | ], 24 | "global" : "2.1.2", 25 | "gems": { 26 | "2.1.2" : [ 27 | {"name":"bundler"} 28 | ] 29 | } 30 | }, 31 | "monit": { 32 | "notify_emails" : ["email@example.com"], 33 | "enable_emails" : false, 34 | "web_interface" : { 35 | // the plaintext monit username and password 36 | "allow" : ["your_username","your_password"] 37 | }, 38 | "mailserver" : { 39 | // the easiest option is to use something like 40 | // Mailgun or Sengrid 41 | "host" : "mailserver.example.com", 42 | "port" : "999", 43 | "username" : "your_username", 44 | "password" : "your_password", 45 | "hostname" : "the_hostname" 46 | } 47 | }, 48 | "postgresql" : { 49 | "password" : { 50 | // this should be generated with: 51 | // openssl passwd -1 "plaintextpassword" 52 | // currently test 53 | "postgres" : "$1$mMK9HNoN$r42n7Q8fKsZabbknlT1Zt1" 54 | } 55 | }, 56 | "run_list": 57 | [ 58 | "role[server]", 59 | "role[nginx-server]", 60 | "role[postgres-server]", 61 | "role[rails-app]", 62 | "role[redis-server]", 63 | "role[memcached-server]", 64 | "role[mysql-server]", 65 | "role[mongo-server]" 66 | ] 67 | } 68 | -------------------------------------------------------------------------------- /roles/server.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "description": "The basics to be applied to a server of any kind", 4 | "default_attributes": { 5 | "firewall" : { 6 | "allow_ssh" : true 7 | }, 8 | "apt" : { 9 | "unattended_upgrades" : { 10 | "enable" : true, 11 | "allowed_origins" : [ 12 | "${distro_id} stable", 13 | "${distro_id} ${distro_codename}-security" 14 | ], 15 | "automatic_reboot" : true, 16 | "auto_fix_interrupted_dpkg" : true 17 | } 18 | }, 19 | "authorization": { 20 | "sudo": { 21 | "groups": ["sysadmin"], 22 | "users": ["deploy"], 23 | "passwordless": true 24 | } 25 | }, 26 | "monit": { 27 | "notify_emails" : ["user@example.com"], 28 | "enable_emails" : false, 29 | "mailserver" : { 30 | "host" : "your-server", 31 | "port" : "587", 32 | "username" : "yourusername", 33 | "password" : "yourpassword", 34 | "hostname" : "yourhostname" 35 | }, 36 | "web_interface" : { 37 | "allow" : ["yourusername","yourpassword"] 38 | } 39 | }, 40 | "monit_address" : "monit.devops.local", 41 | "openssh" : { 42 | "server" : { 43 | "password_authentication" : "no", 44 | "challenge_response_authentication" : "no", 45 | "permit_empty_passwords" : "no", 46 | "use_pam" : "no", 47 | "x11_forwarding" : "no", 48 | "permit_root_login" : "yes" 49 | } 50 | } 51 | }, 52 | "json_class": "Chef::Role", 53 | "run_list": [ 54 | "recipe[apt::default]", 55 | "recipe[ufw::default]", 56 | "recipe[openssh::default]", 57 | "recipe[fail2ban::default]", 58 | "recipe[rdr_sudo_wrapper::default]", 59 | "recipe[rdr_users_wrapper::default]", 60 | "recipe[apt::unattended-upgrades]", 61 | "recipe[ntp::default]", 62 | "recipe[locale::default]", 63 | "recipe[monit-tlq::default]", 64 | "recipe[monit_configs-tlq::system]" 65 | ], 66 | "chef_type": "role", 67 | "override_attributes": { 68 | } 69 | } 70 | 71 | -------------------------------------------------------------------------------- /Berksfile.lock: -------------------------------------------------------------------------------- 1 | DEPENDENCIES 2 | apt (~> 7.4.0) 3 | fail2ban (~> 6.3.2) 4 | hostnames (= 0.3.1) 5 | locale (~> 1.1.0) 6 | memcached (~> 6.1.0) 7 | monit-tlq 8 | git: https://github.com/TalkingQuickly/monit-tlq.git 9 | revision: 0716844d44766f302d9185b0e76fb4e2e162ce85 10 | tag: 0.5.0 11 | monit_configs-tlq 12 | git: https://github.com/TalkingQuickly/monit_configs-tlq.git 13 | revision: 2bf25564c623514d2d56c8518f6334d14914073a 14 | tag: 1.0.0 15 | mysql (~> 5.6.3) 16 | nginx (~> 11.4.0) 17 | ntp (~> 3.7.0) 18 | openssh (~> 2.9.0) 19 | postgresql (~> 8.2.1) 20 | rails_gem_dependencies-tlq 21 | git: https://github.com/TalkingQuickly/rails_gem_dependencies-tlq.git 22 | revision: 9592bdf890810ded3752879c6ac1e6111e669304 23 | tag: 1.0.0 24 | redisio (~> 4.2.0) 25 | ruby_build (~> 2.1.1) 26 | ruby_rbenv 27 | git: https://github.com/sous-chefs/ruby_rbenv.git 28 | revision: 35c775e5e0371cb798f5049a56dc8330bd196f15 29 | sudo (~> 5.4.6) 30 | ufw (~> 3.2.1) 31 | users (~> 5.5.0) 32 | 33 | GRAPH 34 | apt (7.4.0) 35 | chef-sugar (5.1.12) 36 | fail2ban (6.3.2) 37 | yum-epel (>= 0.0.0) 38 | firewall (2.7.0) 39 | chef-sugar (>= 0.0.0) 40 | homebrew (5.1.0) 41 | hostnames (0.3.1) 42 | hostsfile (>= 0.0.0) 43 | hostsfile (2.4.5) 44 | iptables (7.1.0) 45 | locale (1.1.0) 46 | memcached (6.1.0) 47 | monit-tlq (0.5.0) 48 | monit_configs-tlq (1.0.0) 49 | mysql (5.6.3) 50 | yum-mysql-community (>= 0.0.0) 51 | nginx (11.4.0) 52 | ohai (~> 5.2) 53 | ntp (3.7.0) 54 | ohai (5.3.0) 55 | openssh (2.9.0) 56 | iptables (>= 7.0) 57 | postgresql (8.2.1) 58 | apt (>= 0.0.0) 59 | yum-epel (>= 0.0.0) 60 | rails_gem_dependencies-tlq (1.0.0) 61 | apt (>= 0.0.0) 62 | redisio (4.2.0) 63 | selinux_policy (>= 2.2.0) 64 | ulimit (>= 0.1.2) 65 | ruby_build (2.1.1) 66 | homebrew (>= 0.0.0) 67 | yum-centos (>= 0.0.0) 68 | yum-epel (>= 0.0.0) 69 | ruby_rbenv (2.6.0) 70 | selinux_policy (2.4.3) 71 | sudo (5.4.6) 72 | ufw (3.2.1) 73 | firewall (>= 2.0) 74 | ulimit (1.1.1) 75 | users (5.5.0) 76 | yum (3.11.0) 77 | yum-centos (4.0.2) 78 | yum-epel (0.7.0) 79 | yum (>= 3.6.3) 80 | yum-mysql-community (0.2.0) 81 | yum (>= 3.2) 82 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 2 | VAGRANTFILE_API_VERSION = "2" 3 | 4 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 5 | # Setup resource requirements 6 | config.vm.provider "virtualbox" do |v| 7 | v.memory = 1024 8 | v.cpus = 2 9 | end 10 | 11 | config.vm.box = "ubuntu/trusty64" 12 | config.berkshelf.enabled = true 13 | 14 | # This should match the version specified in your 15 | # Gemfile 16 | config.omnibus.chef_version = "11.16.0" 17 | 18 | # Assumes that the Vagrantfile is in the root of our 19 | # Chef repository. 20 | root_dir = File.dirname(File.expand_path(__FILE__)) 21 | 22 | # Assumes that the node definitions are in the nodes 23 | # subfolder 24 | nodes = Dir[File.join(root_dir,'nodes','*.json')] 25 | 26 | # Iterate over each of the JSON files 27 | nodes.each do |file| 28 | puts "parsing #{file}" 29 | node_json = JSON.parse(File.read(file)) 30 | 31 | # Only process the node if it has a vagrant section 32 | if(node_json["vagrant"]) 33 | 34 | # Allow us to remove certain items from the run_list if we're 35 | # using vagrant. Useful for things like networking configuration 36 | # which may not apply. 37 | if exclusions = node_json["vagrant"]["exclusions"] 38 | exclusions.each do |exclusion| 39 | if node_json["run_list"].delete(exclusion) 40 | puts "removed #{exclusion} from the run list" 41 | end 42 | end 43 | end 44 | 45 | vagrant_name = node_json["vagrant"]["name"] 46 | vagrant_ip = node_json["vagrant"]["ip"] 47 | 48 | config.vm.define vagrant_name do |vagrant| 49 | vagrant.vm.hostname = vagrant_name 50 | 51 | # Only use private networking if we specified an 52 | # IP. Otherwise fallback to DHCP 53 | if vagrant_ip 54 | vagrant.vm.network :private_network, ip: vagrant_ip 55 | end 56 | 57 | vagrant.vm.provision "chef_solo" do |chef| 58 | 59 | # Use berks-cookbooks not cookbooks and remember 60 | # to explicitly vendor berkshelf cookbooks 61 | chef.cookbooks_path = ["site-cookbooks"] 62 | chef.data_bags_path = "data_bags" 63 | chef.roles_path = "roles" 64 | 65 | # Instead of using add_recipe and add_role, just 66 | # assign the node definition json, this will take 67 | # care of populating the run_list. 68 | chef.json = node_json 69 | end 70 | end 71 | end 72 | end 73 | end 74 | -------------------------------------------------------------------------------- /.chef/local-mode-cache/cache/chef-stacktrace.out: -------------------------------------------------------------------------------- 1 | Generated at 2016-06-13 14:30:37 +0100 2 | Net::HTTPFatalError: 500 "Internal Server Error" 3 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/2.1.0/net/http/response.rb:119:in `error!' 4 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:146:in `request' 5 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:127:in `post' 6 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/node.rb:639:in `create' 7 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/node.rb:592:in `rescue in find_or_create' 8 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/node.rb:588:in `find_or_create' 9 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/policy_builder/dynamic.rb:72:in `load_node' 10 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/client.rb:467:in `load_node' 11 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/client.rb:269:in `run' 12 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:286:in `block in fork_chef_client' 13 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:274:in `fork' 14 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:274:in `fork_chef_client' 15 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:239:in `block in run_chef_client' 16 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/local_mode.rb:44:in `with_server_connectivity' 17 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:227:in `run_chef_client' 18 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:456:in `sleep_then_run_chef_client' 19 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:443:in `block in interval_run_chef_client' 20 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:442:in `loop' 21 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:442:in `interval_run_chef_client' 22 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:426:in `run_application' 23 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:59:in `run' 24 | /Users/ben/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/chef-12.11.18/bin/chef-client:26:in `' 25 | /Users/ben/.rbenv/versions/2.1.1/bin/chef-client:23:in `load' 26 | /Users/ben/.rbenv/versions/2.1.1/bin/chef-client:23:in `
' --------------------------------------------------------------------------------