Infrastructure configs and automation for Kosmos servers
Go to file
Basti 9c34e82484
Remove obsolete hosts entries for Gitea and Drone
They should use normal DNS
2022-03-17 13:02:56 -06:00
.chef Whitelist ejabberd custom node attributes 2020-12-11 19:07:06 +01:00
clients Move Gitea and Drone to new VMs 2022-03-12 14:47:06 -06:00
cookbooks Update golang cookbook 2021-12-04 19:57:19 -06:00
data_bags Add database secret for Drone CI 2022-03-12 15:05:16 -06:00
doc Use pbkdf2 for backup key derivation 2021-11-30 13:38:34 -06:00
environments WIP 2020-08-16 16:18:01 +02:00
nodes Create nginx_proxy role 2022-03-12 15:39:07 -06:00
roles Create nginx_proxy role 2022-03-12 15:39:07 -06:00
scripts Merge pull request 'Add script for notifying Kosmos channels from Ruby' (#279) from feature/notify_xmpp_from_ruby into master 2021-01-25 10:59:05 +00:00
site-cookbooks Remove obsolete hosts entries for Gitea and Drone 2022-03-17 13:02:56 -06:00
.gitignore WIP RSK cookbook 2021-06-13 16:58:53 +02:00
.gitmodules Use our own fork of the postgresql cookbook 2020-06-07 12:29:34 +02:00
.ruby-version Use chef-workstation Ruby with rbenv 2021-05-28 14:40:02 +02:00
Berksfile Update golang cookbook 2021-12-04 19:57:19 -06:00
Berksfile.lock Update golang cookbook 2021-12-04 19:57:19 -06:00
Gemfile Upgrade knife-zero for Ruby 3.0 2022-02-02 17:31:13 -06:00
Gemfile.lock Upgrade knife-zero for Ruby 3.0 2022-02-02 17:31:13 -06:00
README.md Update README 2021-11-25 19:37:48 -06:00
Vagrantfile Put Vagrant IP in new VirtualBox default allowed range 2022-02-12 10:58:15 -06:00

README.md

Install Chef Workstation

rbenv

If you use rbenv to manage Ruby versions on your system, install the (rbenv-chef-workstation)[https://github.com/docwhat/rbenv-chef-workstation] plugin.

Install gem dependencies

bundle install

Bootstrap a new server

knife zero bootstrap root@dev.kosmos.org --run-list "recipe[kosmos-base],..." -j '{"example_cookbook":{"memory_max":"256M"}}' --secret-file .chef/encrypted_data_bag_secret

Bootstrap a new VM

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

Run Chef Zero

knife zero converge name:dev.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.