Greg Karekinian 443910c7a2 Modernize kosmos-mediawiki
This has been done with the help of `cookstyle` which is very useful to
learn about breaking changes and updates in Chef.

On wiki-1 I managed to update Chef up to 17.10.163. For version 18 I ran
into an issue with the omnibus installer returning a 404

Refs #500
2025-07-09 11:24:14 +02:00
2024-12-12 18:31:54 +04:00
2023-12-06 12:22:24 +01:00
2022-11-25 10:56:22 +00:00
2025-07-09 11:24:14 +02:00
2025-05-31 15:28:33 +04:00
2025-07-09 11:24:14 +02:00
2021-06-13 16:58:53 +02:00
2024-06-11 23:09:48 +02:00
2023-12-06 12:22:24 +01:00
2023-12-06 12:22:24 +01:00
2022-02-02 17:31:13 -06:00
2023-07-15 17:20:06 +02:00

This repository contains all infrastructure automation code that we use to set up and configure servers, virtual machines, and applications for Kosmos hosted services.

Chef cookbooks are written in Ruby, and based on Chef Infra resources. Some cookbooks contain integration test suites based on Test Kitchen.

Note: Manual configuration of servers and applications is highly discouraged, and can be overwritten or lost without notice!

Setup

Install Chef Workstation

rbenv

If you use rbenv to manage Ruby versions on your system, install the rbenv-chef-workstation plugin.

Install gem dependencies

Clone this repository, cd into it, and run:

bundle install

Common tasks

Bootstrap a new host server

knife zero bootstrap root@server-name.kosmos.org --run-list "role[base],role[kvm_host]" --secret-file .chef/encrypted_data_bag_secret

Bootstrap a new VM

knife zero bootstrap ubuntu@zerotier-ip-address -x ubuntu --sudo --run-list "role[base],role[kvm_guest]" --secret-file .chef/encrypted_data_bag_secret

Bootstrap a new VM with environment and role/app (postgres replica as example)

knife zero bootstrap ubuntu@10.1.1.134 -x ubuntu --sudo --environment production --run-list "role[base],role[kvm_guest],role[postgresql_replica]" --secret-file .chef/encrypted_data_bag_secret

Run Chef Zero on a host server

knife zero converge -p2222 name:server-name.kosmos.org

Run Chef Zero on a VM

knife zero converge -a knife_zero.host name:vm-name-23

Update Chef Client on a server:

knife zero converge name:dev.kosmos.org --client-version 15.3.14

Managing cookbooks

Cookbooks are managed via Berkshelf. Run berks --help for command help.

Install cookbooks listed in Berksfile:

berks install

Vendor installed cookbooks to the cookbooks/ dir:

berks vendor cookbooks/ --delete

"Expired" TLS certificates

If you encounter expired TLS certificates during a Chef run (e.g. for remote files), the issue is likely that the certificate has been issued by Let's Encrypt and Chef is still using its own, outdated CA cert store (see here for example).

As a hotfix, you can manually remove the "DST Root CA X3" cert from /opt/chef/embedded/ssl/cert.pem on the machine you're trying to converge.

Description
Infrastructure configs and automation for Kosmos servers
Readme 15 MiB
Languages
Ruby 60.5%
HTML 35.5%
C 2%
PowerShell 1%
Shell 0.9%