mode 0o2775
end
+ruby_version = if node[:lsb][:release].to_f >= 16.04
+ "2.3"
+ else
+ "2.1"
+ end
+
rails_port "www.openstreetmap.org" do
- ruby "2.1"
+ ruby ruby_version
directory "/srv/www.openstreetmap.org/rails"
user "rails"
group "rails"
file_column_root "/store/rails"
end
-execute "/srv/www.openstreetmap.org/rails/db/functions/Makefile" do
+db_version = node[:db][:cluster].split("/").first
+pg_config = "/usr/lib/postgresql/#{db_version}/bin/pg_config"
+function_directory = "/srv/www.openstreetmap.org/rails/db/functions/#{db_version}"
+
+directory function_directory do
+ owner "rails"
+ group "rails"
+ mode 0o755
+end
+
+execute function_directory do
action :nothing
- command "make"
+ command "make PG_CONFIG=#{pg_config} DESTDIR=#{function_directory}"
cwd "/srv/www.openstreetmap.org/rails/db/functions"
user "rails"
group "rails"
+ subscribes :run, "directory[#{function_directory}]"
subscribes :run, "git[/srv/www.openstreetmap.org/rails]"
end
+
+link "/usr/lib/postgresql/#{db_version}/lib/libpgosm.so" do
+ to "#{function_directory}/libpgosm.so"
+ owner "root"
+ group "root"
+end
--- /dev/null
+#
+# Cookbook Name:: foundation
+# Recipe:: dwg
+#
+# Copyright 2016, OpenStreetMap Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "mediawiki"
+
+passwords = data_bag_item("foundation", "passwords")
+
+mediawiki_site "dwg.osmfoundation.org" do
+ sitename "OSMF Data Working Group Wiki"
+ metanamespace "OSMFDWG"
+ directory "/srv/dwg.osmfoundation.org"
+ ssl_enabled true
+ database_name "dwg-wiki"
+ database_user "dwg-wikiuser"
+ database_password passwords["dwg"]["database"]
+ admin_password passwords["dwg"]["admin"]
+ logo "/Wiki.png"
+ email_contact "webmaster@openstreetmap.org"
+ email_sender "webmaster@openstreetmap.org"
+ email_sender_name "OSMF Board Wiki"
+ private true
+ recaptcha_public_key "6LflIQATAAAAAMXyDWpba-FgipVzE-aGF4HIR59N"
+ recaptcha_private_key passwords["dwg"]["recaptcha"]
+end
+
+cookbook_file "/srv/dwg.osmfoundation.org/Wiki.png" do
+ owner node[:mediawiki][:user]
+ group node[:mediawiki][:group]
+ mode 0o644
+end
# Imagery Cookbook
-This installs various packages needed for aerial imagery processing.
+This installs and configures various imagery sites and imagery layers.
include fastcgi_params;
fastcgi_param REQUEST_METHOD "GET";
fastcgi_param HTTP_PROXY "";
+ fastcgi_read_timeout 300s;
# Caching
fastcgi_cache "fastcgi_cache_zone";
fastcgi_cache_key "<%= @layer %><%= @revision %> $request_method $1 $2 $3";
fastcgi_keep_conn on;
fastcgi_cache_lock on;
- fastcgi_cache_lock_timeout 30s;
+ fastcgi_cache_lock_timeout 60s;
fastcgi_cache_valid 200 21d;
fastcgi_cache_use_stale error timeout updating http_500 http_503;
# limitations under the License.
#
+require "shellwords"
+
use_inline_resources
def load_current_resource
end
action :create do
- password = new_resource.password ? "ENCRYPTED PASSWORD '#{new_resource.password}'" : ""
+ password = new_resource.password ? "ENCRYPTED PASSWORD '#{new_resource.password.shellescape}'" : ""
superuser = new_resource.superuser ? "SUPERUSER" : "NOSUPERUSER"
createdb = new_resource.createdb ? "CREATEDB" : "NOCREATEDB"
createrole = new_resource.createrole ? "CREATEROLE" : "NOCREATEROLE"
-Cookbook
-========
-TODO: Enter the cookbook description here.
+# switch2osm cookbook
-e.g.
-This cookbook makes your favorite breakfast sandwich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+This cookbook installs and configures the wordpress website that powers
+[www.switch2osm.org](http://www.switch2osm.org)
-Cookbook
-========
-TODO: Enter the cookbook description here.
+# sysctl cookbook
-e.g.
-This cookbook makes your favorite breakfast sandwich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+This cookbook allows various sysctl settings to be controlled via attributes.
+Settings can be added to node[:sysctl] attribute, and these are both updated
+via `/proc/sys` and added to a template in `/etc/sysctl.d/`
-Cookbook
-========
-TODO: Enter the cookbook description here.
+# sysfs cookbook
-e.g.
-This cookbook makes your favorite breakfast sandwich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+This cookbook installs and configures sysfs, which allows various kernel
+configuration parameters to be tuned via node attributes.
-Cookbook
-========
-TODO: Enter the cookbook description here.
+# taginfo cookbook
-e.g.
-This cookbook makes your favorite breakfast sandwich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+This cookbook installs and configures taginfo websites. The OSMF use this
+cookbook to manage a global taginfo instance at
+[taginfo.openstreetmap.org](http://taginfo.openstreetmap.org)
-Cookbook
-========
-TODO: Enter the cookbook description here.
+# thinkup cookbook
-e.g.
-This cookbook makes your favorite breakfast sandwich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+This cookbook installs and configures the
+[thinkup.openstreetmap.org](http://thinkup.openstreetmap.org) social media
+tracking website.
-Cookbook
-========
-TODO: Enter the cookbook description here.
+# tile cookbook
-e.g.
-This cookbook makes your favorite breakfast sandwich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+This cookbook installs and configures the mod_tile+renderd based tileservers
+that power tile.openstreetmap.org
-Cookbook
-========
-TODO: Enter the cookbook description here.
+# tilecache cookbook
-e.g.
-This cookbook makes your favorite breakfast sandwich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+This cookbook installs and configures the tile caches for the
+tile.openstreetmap.org tileservers.
-tilelog Cookbook
-================
+# tilelog Cookbook
+
This cookbook contains the tile log processing / analysis tools. This includes creating the tile log summaries of the number of tiles downloaded from the tile caches.
-Requirements
-------------
+## Requirements
#### cookbooks
- `tools` - tilelog needs the OSM tools cookbook.
- `libboost-system-dev` - a dependency of the analysis tool.
- `libboost-program-options-dev` - a dependency of the analysis tool.
-
-Attributes
-----------
+## Attributes
#### tilelog::default
<table>
</tr>
</table>
-Usage
------
+## Usage
+
#### tilelog::default
TODO: Write usage instructions for each cookbook.
}
```
-License and Authors
--------------------
+## License and Authors
+
Released under the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0).
Authors: Matt Amos
-Cookbook
-========
-TODO: Enter the cookbook description here.
+# tools cookbook
-e.g.
-This cookbook makes your favorite breakfast sandwich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+This cookbook installs a variety of system administration tools, and removes
+a few unnecessary ones.
-Cookbook
-========
-TODO: Enter the cookbook description here.
+# trac cookbook
-e.g.
-This cookbook makes your favorite breakfast sandwich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+This cookbook installs and configures the trac project management website found
+at [trac.openstreetmap.org](trac.openstreetmap.org).
-Cookbook
-========
-TODO: Enter the cookbook description here.
-
-e.g.
-This cookbook makes your favorite breakfast sandwich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+# web cookbook
+
+This cookbook installs and configures the web frontend machines that power
+[www.openstreetmap.org](http://www.openstreetmap.org). There are several recipes
+
+* `web::backend` - sets up the backend servers, used for processing longer-running requests
+* `web::base` - sets up common storage configuration between all the machines
+* `web::cgimap` - builds and configures [cgimap](https://github.com/openstreetmap/cgimap)
+* `web::cleanup` - configures a cleanup script to be run daily
+* `web::frontend` - sets up the frontend servers, that handle all inbound requests
+* `web::gpx` - sets up the GPX importer
+* `web::rails` - installs and configures the [openstreetmap-website](https://github.com/openstreetmap/openstreetmap-website) rails app
+* `web::statistics` - sets up the scripts for generating the [statistics page](http://www.openstreetmap.org/stats/data_stats.html) for OSM contributions
-Cookbook
-========
-TODO: Enter the cookbook description here.
+# wiki cookbook
-e.g.
-This cookbook makes your favorite breakfast sandwich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+This cookbook installs and configures the mediawiki instance that powers
+[wiki.openstreetmap.org](https://wiki.openstreetmap.org)
-Cookbook
-========
-TODO: Enter the cookbook description here.
+# wordpress cookbook
-e.g.
-This cookbook makes your favorite breakfast sandwich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+This cookbook contains recipes, providers and libraries to install and configure
+wordpress. It is used as a base cookbook by other wordpress site-specific cookbooks.
-Cookbook
-========
-TODO: Enter the cookbook description here.
+# xinetd cookbook
-e.g.
-This cookbook makes your favorite breakfast sandwich.
-
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+This cookbook installs and manages the
+[xinetd](https://en.wikipedia.org/wiki/Xinetd) service, which acts as
+an internet daemon.
-Cookbook
-========
-TODO: Enter the cookbook description here.
+# yournavigation cookbook
-e.g.
-This cookbook makes your favorite breakfast sandwich.
+This cookbook builds and environment suitable for running gosmore as part of the
+[YOURS](http://wiki.openstreetmap.org/wiki/YOURS) routing service.
-Requirements
-------------
-TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
-
-Attributes
-----------
-TODO: List you cookbook attributes here.
-
-Usage
------
-TODO: Write usage instructions for each cookbook.
-
-Contributing
-------------
-TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
-
-e.g.
-1. Fork the repository on Github
-2. Create a named feature branch (like `add_component_x`)
-3. Write your change
-4. Write tests for your change (if applicable)
-5. Run the tests, ensuring they all pass
-6. Submit a Pull Request using Github
-
-License and Authors
--------------------
-Authors: TODO: List authors
+Note that the installation and configuration of gosmore itself is not covered by the cookbook.
"role[crm]",
"role[elasticsearch]",
"recipe[foundation::wiki]",
- "recipe[foundation::board]"
+ "recipe[foundation::board]",
+ "recipe[foundation::dwg]"
)
description "Master role applied to karm"
default_attributes(
+ :apt => {
+ :sources => ["postgresql"]
+ },
+ :db => {
+ :cluster => "9.1/main"
+ },
:networking => {
:interfaces => {
:internal_ipv4 => {
}
}
},
+ :postgresql => {
+ :settings => {
+ :defaults => {
+ :shared_buffers => "64GB",
+ :work_mem => "64MB",
+ :maintenance_work_mem => "1GB",
+ :effective_cache_size => "180GB"
+ }
+ }
+ },
+ :sysctl => {
+ :postgres => {
+ :comment => "Increase shared memory for postgres",
+ :parameters => {
+ "kernel.shmmax" => 66 * 1024 * 1024 * 1024,
+ "kernel.shmall" => 66 * 1024 * 1024 * 1024 / 4096
+ }
+ }
+ },
:sysfs => {
:md_tune => {
:comment => "Enable request merging for NVMe devices",
)
run_list(
- "role[ic]"
+ "role[ic]",
+ "role[db-master]"
)