443 Commits

Author SHA1 Message Date
77e7eed795 Configure Vagrant for dirsrv 2022-05-23 12:47:17 +02:00
6a85c2d5c6 Merge pull request 'Move dirsrv (LDAP) primary node to new VM' (#401) from new_ldap_server into master
Reviewed-on: #401
2022-05-11 14:55:05 +00:00
2d6cbd22e4 Add ejabberd-8 node config 2022-05-11 16:27:21 +02:00
48c3fef1a1 Remove TLS config for ejabberd LDAP 2022-05-11 16:27:21 +02:00
decd937d43 Remove superfluous license header 2022-05-11 16:27:21 +02:00
e89e0b3122 Fix letsencrypt bootstrap for ejabberd 2022-05-11 16:27:21 +02:00
b3f1a74cc2 Remove obsolete ejabberd backups 2022-05-11 16:27:21 +02:00
Greg Karékinian
32f620e95c Update the wiki-1 node after Chef run 2022-05-11 16:23:18 +02:00
Greg Karékinian
e766a96d3b Update the discourse-2 node after Chef run 2022-05-11 16:23:18 +02:00
Greg Karékinian
a14cd9a74f New config for LDAP in Discourse 2022-05-11 16:23:18 +02:00
Greg Karékinian
0d133de1b8 New config and credentials for LDAP connection in mediawiki 2022-05-11 16:23:17 +02:00
5c31531357 Merge pull request 'Configure STUN/TURN for ejabberd and nginx proxy' (#407) from feature/ejabberd_stun_n_turn into new_ldap_server
Reviewed-on: #407
2022-05-11 14:21:14 +00:00
Greg Karékinian
5c00e2d28a Add an attribute containing the LDAP server's address 2022-05-11 15:37:36 +02:00
c158f845f0 Configure STUN/TURN for ejabberd and nginx proxy 2022-05-11 15:27:49 +02:00
36e52a3cf1 Merge pull request 'Use the new LDAP server in the ejabberd configuration' (#406) from chore/ejabberd_new_ldap_server into new_ldap_server
Reviewed-on: #406
2022-05-11 12:57:24 +00:00
Greg Karékinian
c56870008e Use the new LDAP services application accounts 2022-05-11 14:49:28 +02:00
Greg Karékinian
e53e55cb2d Disable TLS for LDAP since we're using Zerotier networking 2022-05-11 14:49:00 +02:00
Greg Karékinian
ff7cb1ce4a Generate a hosts entry for the LDAP server 2022-05-11 14:48:30 +02:00
Greg Karékinian
1502d1956d Set new passwords for the LDAP service accounts 2022-05-11 14:47:32 +02:00
45218ed024 Merge pull request 'Update Gitea to 1.16.6' (#404) from chore/gitea_1.16.6_update into new_ldap_server
Reviewed-on: #404
2022-05-10 09:53:26 +00:00
Greg Karékinian
907706d1d2 Set up the hosts entry for the new LDAP server 2022-05-10 11:50:49 +02:00
Greg Karékinian
b869002c1a Update Gitea to 1.16.6 2022-05-10 11:50:35 +02:00
Greg Karékinian
7ffd3bbf73 Add LDAP's Zerotier IP to the akkount server's hosts 2022-04-28 12:12:10 +02:00
1da5ef4979 Merge branch 'master' into new_ldap_server 2022-04-28 09:23:18 +02:00
3cc11e58d3 Add ldap-2 node config 2022-04-26 20:11:17 +02:00
590366639e Fix fresh dirsrv installs on Ubuntu 20.04 2022-04-26 20:10:51 +02:00
8fe3670ce9 Remove ldap-1 node configs 2022-04-26 20:10:00 +02:00
71f9b06d28 Tor improvements for bitcoin cookbook 2022-04-19 14:08:02 +02:00
a633834a1b Change rate limit for LndHub API 2022-04-18 10:42:47 +02:00
ae342106c9 Merge pull request 'Upgrade Gitea to 1.16.5' (#400) from chore/upgrade_gitea into master
Reviewed-on: #400
2022-04-11 10:52:34 +00:00
994e5873d6 Upgrade Gitea to 1.16.5
Also add our hack-fix cron job to the recipe, so it doesn't get lost
when creating new VMs or otherwise.
2022-04-11 12:50:44 +02:00
8f4d11b317 Add cron job for deleting repo archives 2022-04-11 12:31:00 +02:00
5617591e1c Merge pull request 'Rebuild broken VMs, fix small issues in various cookbooks' (#399) from sheesh into master
Reviewed-on: #399
2022-04-03 13:47:08 +00:00
f758c74b5f Rebuild broken VMs on fornax 2022-03-22 16:25:50 -06:00
bb8467b6ab Switch Discourse deploy branch from master to main 2022-03-22 16:24:40 -06:00
ac1414e24e Open alternative SSH port on KVM hosts 2022-03-22 16:24:14 -06:00
eabb6ab404 Switch more cookbooks from kosmos-redis to redisio
refs #349
2022-03-22 16:23:26 -06:00
71dda86d94 Remove obsolete license header 2022-03-22 16:21:29 -06:00
b6bd8ee6cd Upgrade Sockethub to latest alpha 2022-03-18 11:47:51 -06:00
d5268167b5 Upgrade node.js from 12 to 14 everywhere 2022-03-18 11:47:23 -06:00
8e28d39acd Remove superfluous license header 2022-03-18 11:47:04 -06:00
e3d0f8f83f Merge pull request 'Move static sites from centaurus to fornax' (#398) from chore/move_static_sites into master
Reviewed-on: #398
2022-03-17 21:13:24 +00:00
f17dd53f69 Include Stream configs in Nginx config if missing 2022-03-17 14:28:13 -06:00
4cd0149f76 Move static sites from centaurus to fornax/LB 2022-03-17 14:27:50 -06:00
5e38edb57e Merge pull request 'Move Gitea and Drone CI to new VMs' (#396) from chore/move_gitea_and_drone into master
Reviewed-on: #396
2022-03-17 19:38:04 +00:00
9c34e82484 Remove obsolete hosts entries for Gitea and Drone
They should use normal DNS
2022-03-17 13:02:56 -06:00
e1560ba12a Fix copypasta 2022-03-12 15:40:22 -06:00
0a953070fe Create nginx_proxy role
Used to configure hosts entries in the Gitea and Drone VMs, as well as
the allowed webhooks config for Gitea.
2022-03-12 15:39:07 -06:00
b270a2c1fd Add database secret for Drone CI
closes #388
2022-03-12 15:05:16 -06:00
9187985acc Move Gitea and Drone to new VMs 2022-03-12 14:47:06 -06:00
f35fb638d1 Adapt Drone recipes for VM setup, use PostgreSQL 2022-03-12 14:46:48 -06:00
a1b07dfb9e Adapt Gitea recipes for new VM setup 2022-03-12 14:46:45 -06:00
23e49134e7 Remove superfluous license headers 2022-03-12 14:42:03 -06:00
c25e3632af Upgrade RTL 2022-03-03 21:42:35 -06:00
b0ff8ec2a4 Merge pull request 'Upgrade RSKj to 3.2.0' (#394) from chore/upgrade_rsk into master
Reviewed-on: #394
2022-03-03 15:29:57 +00:00
13c7774433 Upgrade RSKj to 3.2.0 2022-03-03 09:06:30 -06:00
8d7dacffd5 Merge pull request 'Fix Sockethub being offline due to missing HAProxy and UFW configs' (#392) from bugfix/sockethub_firewall into master
Reviewed-on: #392
2022-03-02 15:57:05 +00:00
5f94c9752d Merge pull request 'Deploy Kosmos LndHub fork with lnurl-pay additions' (#393) from chore/fork_lndhub into master
Reviewed-on: #393
2022-03-02 15:56:44 +00:00
a091e07c72 Deploy Kosmos LndHub fork with lnurl-pay additions 2022-03-02 09:54:01 -06:00
f50e7874ba Remove old sockethub firewall recipe 2022-02-27 16:08:40 -06:00
2e8004b37a Add sockethub::firewall to draco, update node info 2022-02-27 13:10:00 -06:00
b9775a26e4 Rename sockethub firewall recipe
Not just used internally anymore.
2022-02-27 13:09:42 -06:00
1586fd536a Remove superfluous license header 2022-02-27 13:09:17 -06:00
227e4a4665 Update node info 2022-02-26 09:47:31 -06:00
d7c5e40602 Merge pull request 'Deploy new akkounts' (#390) from chore/deploy_akkounts into master
Reviewed-on: #390
2022-02-19 17:53:36 +00:00
e9c5286b24 Deploy new akkounts
Requires a newer version of Ruby.
2022-02-19 11:52:48 -06:00
74083256f4 Update zerotier-2 host 2022-02-18 13:19:42 -06:00
dc5813a8bb Remove old zerotier VM config 2022-02-18 13:18:43 -06:00
203f89fe6b Merge pull request 'Migrate Discourse to new VM on fornax' (#389) from chore/migrate_discourse into master
Reviewed-on: #389
2022-02-18 19:02:49 +00:00
Greg Karékinian
ee6bde5b23 Update discourse-1 node after running Chef 2022-02-18 20:00:18 +01:00
Greg Karékinian
58f2544a9e Remove the discourse role from centaurus 2022-02-18 19:59:17 +01:00
Greg Karékinian
98547088f1 Add the zerotier IP for fornax 2022-02-18 19:58:59 +01:00
Greg Karékinian
7582cafb77 Explicitly install snapd package
It was not installed on fornax for example
2022-02-18 19:42:43 +01:00
Greg Karékinian
31631ddc4a Add missing recipe 2022-02-18 19:39:04 +01:00
5b2ae82ce6 Remove obsolete IP from nginx config 2022-02-18 12:23:37 -06:00
910817a7d4 Create certbot site before normal site 2022-02-18 12:23:14 -06:00
163b12efbc Add firewall rule for Discourse 2022-02-18 12:22:15 -06:00
Greg Karékinian
79f623de4e Prepare fornax and discourse-1 for the discourse migration 2022-02-18 18:15:33 +01:00
Greg Karékinian
e8f46db49c Extract the nginx config for discourse to a recipe
Get the upstream servers automatically from Chef nodes
2022-02-18 18:14:33 +01:00
7a8fb1bc78 Add new Discourse VM 2022-02-17 13:02:10 -06:00
e46c8b3e81 Put Vagrant IP in new VirtualBox default allowed range 2022-02-12 10:58:15 -06:00
3c7cc1a133 Update node status 2022-02-12 10:57:26 -06:00
28659665a0 Merge pull request 'Migrate nodejs-2 from centaurus to nodejs-3 on fornax' (#386) from chore/move_nodejs_vm into master
Reviewed-on: #386
2022-02-12 16:56:25 +00:00
6454c56b70 Merge pull request 'Fix Webhooks for Drone not working in Gitea 1.16' (#387) from bugfix/allow_drone_webhooks into master
Reviewed-on: #387
2022-02-12 16:56:01 +00:00
03c7940f1c Fix Webhooks for Drone not working in Gitea 1.16
By default, only external requests are allowed:

https://github.com/go-gitea/gitea/pull/17482
2022-02-12 10:53:45 -06:00
a710182c39 Add missing user recipe import to botka recipe 2022-02-10 17:00:19 -06:00
18161832ef Deploy new nodejs VM (nodejs-3) 2022-02-10 17:00:10 -06:00
a2f1b7ccc6 Merge pull request 'Deploy new Zerotier Controller VMs' (#385) from chore/move_zerotier into master
Reviewed-on: #385
2022-02-10 21:38:47 +00:00
935eff3b84 Deploy zerotier-3 on DO
Changes the firewall config to allow the control UI to be reached from
all connected networks.
2022-02-10 15:34:28 -06:00
a1f723d52e Deploy zerotier-2 VM on fornax 2022-02-10 15:34:12 -06:00
c337ad9e40 Remove obsolete node configs 2022-02-10 15:33:23 -06:00
04a036c2b8 Merge pull request 'Move Mastodon to new VM on fornax' (#383) from chore/mastodon_move into master
Reviewed-on: #383
2022-02-10 21:32:56 +00:00
a4b50d1643 Merge pull request 'Upgrade Gitea to 1.16.1' (#384) from chore/upgrade_gitea into master
Reviewed-on: #384
2022-02-10 21:32:51 +00:00
22f5b8a66c Upgrade Gitea to 1.16.1 2022-02-10 15:32:25 -06:00
b823ad5e59 Switch Mastodon cookbook to new Redis cookbook
Also add new node config.

refs #349

Co-authored-by Greg Karékinian <greg@karekinian.com>
2022-02-10 15:29:02 -06:00
341806ec8a Update jemalloc binary path
Co-authored-by Greg Karékinian <greg@karekinian.com>
2022-02-10 15:26:37 -06:00
abe0218998 Merge pull request 'Upgrade knife-zero for Ruby 3.0' (#381) from chore/upgrade_knife into master
Reviewed-on: #381
2022-02-02 23:32:26 +00:00
dace2ddf79 Upgrade knife-zero for Ruby 3.0
Was failing with latest Chef DK.
2022-02-02 17:31:13 -06:00
da1afcbf46 Merge pull request 'Upgrade Gitea to 1.15.11' (#380) from chore/upgrade_gitea into master
Reviewed-on: #380
2022-02-01 18:49:33 +00:00
4462975e51 Upgrade Gitea to 1.15.11 2022-02-01 12:47:37 -06:00
3c76a1e0ad Merge pull request 'Configure/install boltzd for Lightning/on-chain swaps' (#378) from feature/boltz-lnd into master
Reviewed-on: #378
2022-01-28 23:38:49 +00:00
471c23eb5b Update node config/state 2022-01-28 17:33:34 -06:00
90bd2dadb2 Configure boltzd access for RTL 2022-01-28 17:33:22 -06:00
87334de83a Configure/install boltzd 2022-01-28 17:33:10 -06:00
d9bb257f99 Move golang installation to own recipe
Needed by more than one in the bitcoin cookbook now.
2022-01-28 17:32:19 -06:00
13ae913668 Upgrade nbxplorer
Needed a newer version of the .NET SDK as well.
2022-01-28 17:31:14 -06:00
727210aa74 Merge pull request 'Add new ejabberd node, remove old ones' (#377) from chore/ejabberd_cluster_nodes into master
Reviewed-on: #377
2022-01-23 18:18:23 +00:00
8509e0af58 Add new ejabberd node 2022-01-23 12:15:14 -06:00
05dbf5211f Remove old ejabberd node 2022-01-23 12:15:04 -06:00
bf6a77e41a Merge pull request 'Use private IP for ejabberd TURN' (#376) from chore/ejabberd_stun into master
Reviewed-on: #376
2022-01-23 18:09:46 +00:00
622fabe151 Use private IP for ejabberd TURN 2022-01-19 14:38:53 -06:00
3c3ca3f24a Merge pull request 'Replace ejabberd cluster' (#375) from chore/ejabberd_cluster into master
Reviewed-on: #375
2022-01-19 19:35:04 +00:00
6c8a98c524 Run Chef with ejabberd role against new cluster nodes 2022-01-18 12:50:14 -06:00
58736f05ee Remove node configs for old ejabberd cluster 2022-01-18 12:50:14 -06:00
62c95175cc Only allow ZeroTier connections for ejabberd cluster 2022-01-18 12:50:13 -06:00
74dd59ad07 Write hostname-related configs for new ejabberd cluster 2022-01-18 12:50:10 -06:00
5b351036ba Remove superfluous license header 2022-01-18 11:19:20 -06:00
024b4bf164 Fix typo 2022-01-18 11:19:19 -06:00
14d83b4376 Add ejabberd-4 VM 2022-01-18 10:15:39 -06:00
a2c5295afd Create ejabberd-3 VM 2022-01-18 10:15:37 -06:00
eb7c245ea1 Merge pull request 'Upgrade nbxplorer, c-lightning, BTCPay' (#373) from chore/upgrade_bitcoin_software into master
Reviewed-on: #373
2022-01-08 23:19:23 +00:00
d53e1b538b Update nbxplorer to 2.2.18 2022-01-08 17:17:04 -06:00
0e9a657090 Upgrade BTCPay to 1.3.7 2022-01-08 16:48:58 -06:00
3d54f7052f Upgrade c-lightning to 0.10.2 2022-01-08 16:48:58 -06:00
ca79b6031a Merge pull request 'Fix LndHub balances for on-chain topups' (#372) from bugfix/lndhub_onchain_topups into master
Reviewed-on: #372
2022-01-08 22:48:09 +00:00
14cc2c0eb0 Fix lndhub balances with on-chain topups
Removes the bitcoind RPC config entirely, so lndhub only uses LND's
transaction monitoring. The bitcoind integration is broken as is.
2022-01-08 16:38:01 -06:00
ec10a0c120 Merge pull request 'Connect to IRC bouncer instead of directly' (#371) from chore/fix_botka_connection into master
Reviewed-on: #371
2022-01-06 14:15:36 +00:00
f6fe3bab0f Connect to IRC bouncer instead of directly
Changes botka on libera to connect to a bouncer, which also uses SASL,
in order to fix the connection issues and keep a stable connection with
minimal maintenance.
2022-01-06 08:12:42 -06:00
62ff4e51b7 Merge pull request 'Back up LND files and channels to S3' (#370) from feature/359-lnd_channel_backups into master
Reviewed-on: #370
2022-01-03 17:38:46 +00:00
31f4a547a9 Backup LND SCB to S3 on change
closes #359
2021-12-23 13:06:32 +01:00
56f58f3a1b Install/configure AWS client 2021-12-23 13:06:12 +01:00
57b5a244fa Remove superfluous license header 2021-12-23 13:05:44 +01:00
0b80d490a8 Back up LND dir to S3 2021-12-23 13:05:14 +01:00
7adee84adf Merge pull request 'Upgrade Mastodon to 3.4.4' (#368) from chore/upgrade_mastodon into master
Reviewed-on: #368
2021-12-09 13:32:21 +00:00
a0de016e1c Add single sidekiq process for new scheduler queue 2021-12-05 16:27:05 -06:00
38756fd296 Upgrade Mastodon to latest version
Using a new branch with freshly added Kosmos changes on top of the
upstream release code.
2021-12-05 16:11:09 -06:00
3d06300167 Merge pull request 'Upgrade LND to 0.14.1' (#367) from chore/upgrade_lnd into master
Reviewed-on: #367
2021-12-05 01:59:56 +00:00
bbef38b6d6 Update golang cookbook 2021-12-04 19:57:19 -06:00
a8948053d6 Update LND to 0.14.1
closes #351
2021-12-04 19:56:49 -06:00
da3a70ef4c WIP dirsrv changes 2021-12-02 13:56:23 -06:00
Greg Karékinian
685deea920 Simplify dirsrv setup
Connecting directly using zerotier, no more nginx
2021-12-02 19:08:27 +01:00
Greg Karékinian
d1d48cb749 Add role for ldap (dirsrv) 2021-12-02 19:08:16 +01:00
Greg Karékinian
067f5ba0d9 Add node config for ldap-1 2021-12-02 19:07:55 +01:00
a75237e0fb Merge pull request 'Set up public HTTPS endpoint for RSKj' (#337) from feature/rskj_public_endpoint into master
Reviewed-on: #337
2021-12-02 17:26:00 +00:00
5ac53633cd Merge branch 'master' into feature/rskj_public_endpoint 2021-12-02 17:07:47 +00:00
62d7998da8 Merge pull request 'Deploy/configure LndHub' (#350) from feature/lndhub into master
Reviewed-on: #350
2021-12-02 17:07:17 +00:00
6f29ede8d3 Merge branch 'master' into feature/lndhub 2021-12-02 16:59:46 +00:00
91905e0490 Merge pull request 'Fix backup email notifications' (#366) from bugfix/358-backups into master
Reviewed-on: #366
2021-12-01 22:52:58 +00:00
f7afc21f9e Use pbkdf2 for backup key derivation
Fixes a warning thrown by OpenSSL during backup runs, and makes it more
secure.
2021-11-30 13:38:34 -06:00
c30733e5aa Send backup notifiations when run ends with warning 2021-11-30 13:38:18 -06:00
e63cda3317 Use SMTP/Mailgun for backup notifications 2021-11-30 13:37:51 -06:00
3d1937823a Merge pull request 'Add documentation for backups/restores' (#365) from docs/backup into master
Reviewed-on: #365
2021-11-30 18:46:37 +00:00
172553ddb3 Add documentation for backups/restores 2021-11-30 12:45:52 -06:00
1a7f7fee45 Merge pull request 'Configure/deploy kosmos.org (with Lightning Address support)' (#360) from feature/kosmos_org_nginx into master
Reviewed-on: #360
2021-11-30 18:29:11 +00:00
9e94440975 Merge pull request 'Update kosmos postgres cookbook name in other cookbooks' (#364) from chore/postgres_cookbook_deps into master
Reviewed-on: #364
2021-11-30 15:19:43 +00:00
a184f27c96 Update kosmos postgres cookbook name in other cookbooks 2021-11-30 08:47:15 -06:00
584da20d3e Deploy nginx reverse proxy for RSK mainnet 2021-11-29 13:55:04 -06:00
0e1b362644 Fix nginx config, deploy LE cert 2021-11-29 13:33:43 -06:00
e414dfc23f Merge branch 'master' into feature/rskj_public_endpoint 2021-11-29 13:18:42 -06:00
70fe5f81a5 Merge pull request 'Rename postgres cookbook, deploy new replica' (#363) from chore/update_postgres_cookbook into master
Reviewed-on: #363
2021-11-29 19:15:52 +00:00
91ffe75bc1 Add missing files 2021-11-29 13:12:17 -06:00
ecdc41a54f Rename postgres cookbook, deploy new replica
fixes #361
closes #330
2021-11-29 13:09:13 -06:00
1d8af6e86f Merge pull request 'Fix custom resource not found in newer Chef versions' (#362) from chore/update_postgres_cookbook into master
Reviewed-on: #362
2021-11-29 19:06:54 +00:00
fa8cbac163 Fix custom resource not found in newer Chef versions
fixes #361
refs #337
2021-11-29 13:03:40 -06:00
cbf42b9414 Add node config for fornax 2021-11-29 11:23:17 -06:00
f68eceec4c Remove obsolete role 2021-11-28 10:08:39 -06:00
0628d091dc Update rsk-testnet-2 with new rskj-testnet role 2021-11-28 10:05:48 -06:00
c9d32e02aa Remove old RSK testnet node config 2021-11-28 10:02:28 -06:00
35115b7391 Merge branch 'master' into feature/rskj_public_endpoint 2021-11-28 10:02:06 -06:00
7e49dfd520 Merge pull request 'Deploy RSK mainnet node, and new testnet node' (#346) from feature/343-rsk_mainnet into master
Reviewed-on: #346
2021-11-28 16:01:04 +00:00
d14d109a00 Configure/deploy kosmos.org
Includes a new directive for Lightning Address resolution.
2021-11-26 14:10:39 -06:00
6b2e501c90 Add LndHub backups 2021-11-26 11:22:24 -06:00
3962666a39 Re-enable Tor recipe 2021-11-25 19:44:42 -06:00
1e6c40b136 Update README 2021-11-25 19:37:48 -06:00
5d8e98e4a9 Merge pull request 'Upgrade Drone CI from 1.0 to 2.5' (#357) from chore/upgrade_drone into master
Reviewed-on: #357
2021-11-25 23:29:23 +00:00
5717d11f7e Upgrade Drone CI to latest version
closes #356
2021-11-25 17:28:13 -06:00
9656399e9d Remove superfluous license header 2021-11-25 17:27:48 -06:00
11e9b569ae Merge pull request 'Upgrade Gitea to 1.15.6' (#354) from chore/upgrade_gitea into master
Reviewed-on: #354
2021-11-25 22:49:58 +00:00
24f94bdb02 Upgrade Gitea to 1.15.6
Configures the JWT signing algorithm to be the old, less secure
algorithm, until we update the token for Drone CI (and any other OAuth
apps).

closes #338
2021-11-25 16:44:48 -06:00
f93909da70 Update akkounts-1 node info 2021-11-22 23:46:36 -06:00
931a3a196f Add public HTTP reverse proxy for LndHub 2021-11-21 13:22:40 -06:00
e48cf04e6c Deploy LndHub to bitcoin-2
Update the node config
2021-11-17 11:11:45 -06:00
0481e42aa4 Install/configure LndHub 2021-11-16 16:03:46 -06:00
4b9183d78d Use older Redis cookbook, install on bitcoin-2 2021-11-16 14:11:42 -06:00
18f65c4fc5 Add new Redis cookbook 2021-11-16 13:25:30 -06:00
80ec84782b Berkshelf vendor changes 2021-11-16 13:25:08 -06:00
b911ec92c9 Update node info 2021-11-16 13:23:25 -06:00
65532836ff Merge pull request 'Improve botka IRC config' (#347) from chore/botka_config into master
Reviewed-on: #347
2021-10-23 09:29:36 +00:00
ca33dbe624 Improve botka IRC config
Use TLS, specify port.
2021-10-23 11:28:29 +02:00
e6ad9865bc Add roles for RSK testnet/mainnet 2021-10-22 14:02:56 +02:00
83202747cf Move RSKj firewall config to own recipe 2021-10-22 14:02:41 +02:00
ce7a7d5f83 Update RSKj version 2021-10-22 14:01:39 +02:00
5dd44fc283 Add new RSK VM node configs 2021-10-22 14:00:09 +02:00
ca13acb99f Remove obsolete Parity role 2021-10-22 13:59:42 +02:00
fc70895d9c Merge pull request 'Configure/deploy botka for libera.chat on nodejs-2 VM' (#341) from feature/upgrade_and_move_botka_irc into master
Reviewed-on: #341
2021-09-21 15:52:23 +00:00
ee0a587dad Upgrade botka, deploy for Libera.Chat to nodejs-2
Note: Temporarily disables wormhole, because it's still on Freenode,
where its credentials have been deleted by the new "management".
2021-09-13 18:21:46 +02:00
abec4be8ff Update Gemfile.lock 2021-09-03 10:29:32 +02:00
efda3f6fdb Merge pull request 'Update Sockethub to 4.1.0' (#339) from chore/update_sockethub into master
Reviewed-on: #339
2021-09-03 08:29:10 +00:00
2a5d68cda9 Update Sockethub to 4.1.0
Tested/running on `nodejs-2`.
2021-09-03 10:28:07 +02:00
483481b141 Merge pull request 'Deploy Sockethub from the npm package' (#146) from feature/145-sockethub_from_npm into master
Reviewed-on: #146
2021-08-31 09:00:07 +00:00
3817284566 Bump version 2021-08-09 19:12:45 +02:00
89e27a040f Set up public HTTPS endpoint for RSKj
refs #325
2021-08-09 19:02:14 +02:00
0ffddb9d0f Merge pull request 'Upgrade Gitea to 1.14.6' (#336) from chore/upgrade_gitea into master
Reviewed-on: #336
2021-08-09 14:11:33 +00:00
8bbb4deed7 Upgrade Gitea to 1.14.6 2021-08-09 16:10:40 +02:00
fe66092c26 Merge pull request 'Upgrade LND to 0.13.1' (#335) from chore/upgrade_lnd into master
Reviewed-on: #335
2021-08-09 14:01:19 +00:00
bf009d6822 Upgrade LND to 0.13.1 2021-08-09 16:00:19 +02:00
Greg Karékinian
e00d6c3a86 Use the sockethub role in the run list 2021-07-14 10:14:38 +02:00
Greg Karékinian
383a46676e Create a role for sockethub 2021-07-14 10:14:28 +02:00
Greg Karékinian
eed27713ff Add the sockethub firewall rule to centaurus 2021-07-14 10:14:07 +02:00
Greg Karékinian
b5e7e4ab85 Use DNS validation to generate/renew the TLS cert 2021-07-14 10:13:35 +02:00
Greg Karékinian
7c2aae6650 Add sockethub to nodejs-2's run list 2021-07-09 11:52:58 +02:00
Greg Karékinian
d135b3873c Switch to a systemd unit Chef resource 2021-07-09 11:32:33 +02:00
Greg Karékinian
e9c86081f7 Update sockethub to the latest npm release 2021-07-09 11:32:11 +02:00
Greg Karékinian
b8ac5e1c07 Merge branch 'master' into feature/145-sockethub_from_npm 2021-07-09 10:51:02 +02:00
7fc0a65a22 Merge pull request 'Upgrade all bitcoin software to latest versions' (#328) from chore/upgrade_bitcoin_software into master
Reviewed-on: #328
2021-07-07 09:42:33 +00:00
bb6394ab42 Merge pull request 'Add Tor support for LND' (#332) from feature/lnd_tor into chore/upgrade_bitcoin_software
Reviewed-on: #332
2021-07-07 09:40:37 +00:00
b17c81a1aa Merge branch 'chore/upgrade_bitcoin_software' into feature/lnd_tor 2021-07-07 09:36:11 +00:00
b7af04e8be Support Tor connections for LND
Adds basics for general Tor support in bitcoin recipes, and specific
support for Tor to the lnd recipe.
2021-07-01 15:34:06 +02:00
9f0b5f0e64 (tor) Add support for ControlPort and CookieAuthentication
Allow to configure Tor to be controlled by other applications, so they
can manage hidden services and such.
2021-07-01 15:32:28 +02:00
c60e65020b Merge pull request 'Auto-unlock LND wallet/node' (#331) from feature/auto_unlock_lnd into chore/upgrade_bitcoin_software
Reviewed-on: #331
2021-07-01 13:21:41 +00:00
37873fb881 Add data bag for LND credentials 2021-07-01 13:17:51 +02:00
4bda4d7857 Install LND with all subsystems enabled
This allows to run loopd and other tools.
2021-06-30 17:10:57 +02:00
2ca576468e Auto-unlock LND wallet/node
The latest release added a new config option for auto-unlocking the
wallet/node using a password file. This changeset adds support for just
that to the lnd recipe, so that nobody has to manually unlock it after
reboots or service restarts.
2021-06-30 17:09:31 +02:00
a65065c793 Upgrade all bitcoin software to latest versions 2021-06-29 15:55:20 +02:00
f095094cf7 Fix compilation issue with dotnet services
Compilation fails while the executable is running.
Fixed by stopping the services before upgrades.
2021-06-29 15:53:52 +02:00
3dcb9e76ce Update node info 2021-06-29 15:53:22 +02:00
aa98b07f33 Merge pull request 'Configure/deploy RSKj' (#326) from feature/deploy_rsk_testnet into master
Reviewed-on: #326
2021-06-21 16:38:55 +00:00
54274cef77 Merge branch 'master' into feature/deploy_rsk_testnet 2021-06-21 16:37:26 +00:00
65140f92ed Merge pull request 'Upgrade Gitea to 1.14.3' (#327) from chore/322-update_gitea into master
Reviewed-on: #327
2021-06-21 16:36:55 +00:00
b6d0bafce0 Remove license header, improve formatting 2021-06-21 17:50:23 +02:00
bbaeeb5099 Upgrade Gitea to 1.14.3
Adds a new config for the repository root directory.

closes #322
2021-06-21 17:47:30 +02:00
40a943354a Update generated docs 2021-06-16 11:35:40 +02:00
5bc4266857 Merge pull request 'Use Chef Workstation's ruby with rbenv' (#324) from chore/remove_bundler_version_lock into master
Reviewed-on: #324
2021-06-15 20:26:23 +00:00
Greg Karékinian
9a3565c11f Only keep the knife-zero gem in the Gemfile
The rest is already shipped with Chef Workstation
2021-06-15 22:21:04 +02:00
cbdbb9c2eb Switch to dokken for testing in kitchen 2021-06-13 17:50:32 +02:00
37787ce3e6 Specify package version for rskj 2021-06-13 17:50:25 +02:00
2063f5c953 WIP RSK cookbook 2021-06-13 16:58:53 +02:00
d7af1a57d1 Create RSK testnet VM 2021-06-12 14:52:36 +02:00
bda100313e Update README
Add some info about Chef Workstation and rbenv.
2021-05-28 14:51:42 +02:00
ec75f1446c Use chef-workstation Ruby with rbenv
See https://github.com/docwhat/rbenv-chef-workstation for painlessly
using Chef Workstation's Ruby with rbenv.
2021-05-28 14:40:02 +02:00
6bd76ebec6 Don't require old bundler version 2021-05-28 14:36:07 +02:00
dbdb803b7a Merge pull request 'Upgrade Gitea from 1.13.1 to 1.13.7' (#321) from chore/update_gitea into master
Reviewed-on: #321
2021-04-10 09:01:26 +00:00
7624bcec11 Upgrade Gitea from 1.13.1 to 1.13.7 2021-04-10 11:00:00 +02:00
18a5e0d5d0 Merge pull request 'Deploy hubots from Gitea repos' (#320) from chore/hubot_repos into master
Reviewed-on: #320
2021-04-09 20:03:21 +00:00
f9c992e48e Merge branch 'master' into chore/hubot_repos 2021-04-09 11:48:38 +00:00
Greg Karékinian
87d50d067c Add updated upstream nodejs cookbook
... and its new dependency, chocolatey
2021-04-09 13:18:35 +02:00
c99f82fcd4 Update cookbook version 2021-04-09 11:45:39 +02:00
29e1d64ae0 Remove superfluous license headers from recipe files 2021-04-09 11:44:36 +02:00
9939e4d993 Deploy hubots from Gitea repos
The repos have been moved over from GitHub.
2021-04-09 11:35:49 +02:00
18e45cdaab Merge pull request 'Upgrade nodejs to the latest version from the repo' (#319) from feature/upgrade_nodejs into master
Reviewed-on: #319
2021-03-30 12:02:31 +00:00
769843e6ab Merge branch 'master' into feature/upgrade_nodejs 2021-03-30 12:01:26 +00:00
Greg Karékinian
edf2e071e4 Upgrade nodejs to the latest version from the repo
This is possible in newer versions of the nodejs cookbook, by setting
the `node["nodejs"]["package_action"]["nodejs"]` attribute to `:upgrade`
2021-03-30 13:58:55 +02:00
aea5e07d2e Merge pull request 'Set the environment variables in the hubot-kredits dir' (#318) from feature/315-kredits_for_reviews_fix into master
Reviewed-on: #318
2021-03-30 11:58:26 +00:00
Greg Karékinian
f937e5dc68 Set the environment variables in the hubot-kredits dir
This is meant to be executed as a script manually, not as part of Hubot.

Example usage:

    cd /opt/hal8000_xmpp/node_modules/hubot-kredits
    ./scripts/review-kredits.js --start 2021-02-01 --end 2021-02-28T23:59:59Z --dry

Closes #315
2021-03-30 13:54:21 +02:00
9fc49deafe Merge pull request 'Fix an undefined variable' (#317) from bugfix/dirsrv_undefined_variable into master
Reviewed-on: #317
2021-03-30 10:33:47 +00:00
9b2ba2c714 Merge branch 'master' into bugfix/dirsrv_undefined_variable 2021-03-30 10:33:35 +00:00
0504001e31 Merge pull request 'Deploy hubot with new hubot-kredits' (#316) from feature/315-kredits_for_reviews into master
Reviewed-on: #316
2021-03-30 10:19:30 +00:00
Greg Karékinian
346b6540d1 Fix an undefined variable 2021-03-30 12:14:40 +02:00
Greg Karékinian
45817ba997 Update the barnard node file after running Chef 2021-03-30 12:12:27 +02:00
Greg Karékinian
9415b71965 Deploy hubot with new hubot-kredits
It includes a script for creating Kredits for reviews

Refs #135
2021-03-30 12:11:03 +02:00
3502fb0eec Merge pull request 'Tell browsers to cache Gitea avatars for 30 days' (#313) from bugfix/312-gitea_avatar_caching into master
Reviewed-on: #313
2021-02-26 21:25:41 +00:00
891b5f3fee Tell browsers to cache Gitea avatars for 30 days
fixes #312
2021-02-26 20:41:53 +01:00
ab515e2101 Merge pull request 'Use shared Kosmos webfont for Gitea' (#311) from feature/gitea_fonts into master
Reviewed-on: #311
2021-02-25 16:38:37 +00:00
5559ca41a7 Support IPv6 and CORS for font hosting 2021-02-25 17:38:11 +01:00
a96d29c716 Merge branch 'master' into feature/gitea_fonts 2021-02-25 15:38:06 +00:00
13ea0e3148 Merge pull request 'Set up assets.kosmos.org for shared static file/webfont hosting' (#309) from feature/static_assets into master
Reviewed-on: #309
2021-02-25 15:22:52 +00:00
474208ea8e Use shared Kosmos webfont for Gitea
Currently using a custom rule for system fonts. This change also adds a
missing new class to the custom rule to cover Markdown-generated content
like e.g. comments.
2021-02-25 14:29:41 +01:00
6109707f3c Host assets.kosmos.org on centaurus 2021-02-25 12:13:20 +01:00
1c47f9ab27 Add cookbook for static asset hosting
Configures assets.kosmos.org, only for webfont hosting for now.
2021-02-25 12:12:41 +01:00
09f0faadda Add missing header to recipe 2021-02-24 19:11:53 +01:00
26e8698e4f Merge pull request 'Replace expired Zoom authentication token for hal8000' (#308) from chore/update_zoom_jwt into master
Reviewed-on: #308
2021-02-18 18:53:45 +00:00
adc2ed895f Merge pull request 'Update node.js (apt repo)' (#307) from chore/update_nodejs_apt_repo into master
Reviewed-on: #307
2021-02-18 18:53:18 +00:00
fd901f6e64 Update Zoom JWT 2021-02-18 18:51:36 +01:00
f7d3736712 Update node details
Removes unused recipes from generated runlist
2021-02-18 18:51:11 +01:00
f3def7b71d Update node.js (apt repo) 2021-02-10 23:47:23 +01:00
bac66d4dba Merge pull request 'Configure/run Sidekiq for Akkounts' (#304) from feature/303-akkounts_sidekiq into master
Reviewed-on: #304
2021-02-08 21:17:54 +00:00
f88ccae8a6 Merge branch 'master' into feature/303-akkounts_sidekiq 2021-02-08 21:17:43 +00:00
25e3dae4d4 Merge pull request 'Set up Zerotier Controller UI' (#305) from feature/zncui into master
Reviewed-on: #305
2021-02-08 21:16:53 +00:00
9a54a7554f Use package resource instead of custom command 2021-02-08 20:01:22 +01:00
e1bcd5efa0 Set up Zerotier Control UI
Install/configure ztncui[1], with HTTP access allowed from within the
private network.

[1]: https://key-networks.com/ztncui/
2021-02-07 17:44:08 +01:00
1adf3281bf Configure/run Sidekiq for Akkounts 2021-02-03 19:53:13 +01:00
241f0807b3 Merge pull request 'Fix/refactor bitcoind recipe, upgrade bitcoind to 0.21' (#298) from chore/update_bitcoin-core into master
Reviewed-on: #298
2021-01-28 15:26:31 +00:00
fe0a955314 Merge pull request 'Update lnd to 0.12.0' (#299) from chore/update_lnd into chore/update_bitcoin-core
Reviewed-on: #299
2021-01-27 17:06:34 +00:00
65185b1a1b Update lnd to 0.12.0 2021-01-27 18:05:30 +01:00
0d2a04f8ba Refactor bitcoind recipe
Fixes various issues, like compilation not starting on subsequent
version updates, service not restarting after compilation, and a TODO
note on the compilation script itself.
2021-01-26 12:45:28 +01:00
152edbc958 Update bitcoind to 0.21 2021-01-26 12:45:17 +01:00
40fe403879 Stop c-lightning before compilation
See https://github.com/ElementsProject/lightning/issues/4346 for
potential issues with not doing that.
2021-01-26 12:33:09 +01:00
9023c14849 Merge pull request 'Update c-lightning to v0.9.3' (#297) from chore/update_c-lightning into master
Reviewed-on: #297
2021-01-26 11:07:21 +00:00
c3256a07cc Fix c-lightning configure not finding python
Broke in the latest release.
2021-01-26 12:05:29 +01:00
461af035ac Update c-lightning to 0.9.3 2021-01-26 12:05:19 +01:00
e3507879a1 Merge pull request 'BTCPay recipe fixes (compilation + PostgreSQL config)' (#296) from chore/btcpay_update_and_recipe_fix into master
Reviewed-on: #296
2021-01-26 10:52:03 +00:00
5a5db43de3 Use new postgres client role and config
Fixes btcpay having still used the old postgres master, and integrating
it into the global client config setup from here on out.
2021-01-26 11:49:20 +01:00
f7d3abc307 Stop BTCPay server before compilation
fixes #291
2021-01-26 11:48:41 +01:00
f1ff34d769 Merge pull request 'Add Onion-Location header for kosmos.social' (#295) from feature/mastodon_onion_header into master
Reviewed-on: #295
2021-01-25 11:14:38 +00:00
49c75bbb05 Add Onion-Location header for kosmos.social
Tells Tor Browser where to find the native onion site.

refs #201
2021-01-25 12:09:28 +01:00
0920803535 Merge pull request 'Add script for notifying Kosmos channels from Ruby' (#279) from feature/notify_xmpp_from_ruby into master
Reviewed-on: #279
2021-01-25 10:59:05 +00:00
ad271e55d4 Merge pull request 'Move PostgreSQL to VMs and access via Zerotier' (#282) from feature/postgres_vms into master
Reviewed-on: #282
2021-01-25 10:56:42 +00:00
a3136e820b Merge pull request 'Update Gitea to 1.13.1' (#293) from chore/253-gitea_1.13.1 into master
Reviewed-on: #293
2021-01-24 12:49:49 +00:00
c2f36c6f01 Merge pull request 'Update ejabberd to 20.12' (#294) from chore/ejabberd_20.12 into master
Reviewed-on: #294
2021-01-24 12:47:37 +00:00
Greg Karékinian
90ce664f2e Update ejabberd to 20.12
It fixes a bug that prevented the config to be reloaded for LDAP options
(https://github.com/processone/ejabberd/issues/3181) and more:
https://www.process-one.net/blog/ejabberd-20-12/
2021-01-24 10:14:29 +01:00
Greg Karékinian
0e5519a4b7 Update Gitea to 1.13.1
Running on centaurus

Closes #253
2021-01-24 10:12:37 +01:00
Greg Karékinian
1ad7a6936c Generate the hosts entry for the PostgreSQL replica 2021-01-24 10:11:17 +01:00
Greg Karékinian
b1fea4b09f Update the postgres-3 node after Chef run 2021-01-23 19:25:49 +01:00
Greg Karékinian
7ce8b7d461 Enable PostgreSQL service 2021-01-23 19:14:55 +01:00
Greg Karékinian
112eb903ec Add a script to switch the primary PostgreSQL server
Usage: scripts/postgresql/switch_primary.sh <old_primary_hostname> <new_primary_hostname>
2021-01-23 19:13:54 +01:00
Greg Karékinian
7e61e9cb45 Promote a new PostgreSQL primary: postgres-2 2021-01-23 19:09:41 +01:00
Greg Karékinian
a7116b8fe5 Switch the TLS mode to disabled for Gitea
We connect through a Zerotier private IP
2021-01-23 19:08:06 +01:00
Greg Karékinian
a4a35da0ff Replace the hardcoded primary pg IP with a hostname 2021-01-23 17:34:58 +01:00
Greg Karékinian
5cb390f340 Remove the postgresql_replica from centaurus, run Chef
I have also deleted the data directory (in /mnt/data)
2021-01-23 17:11:45 +01:00
Greg Karékinian
4e1bd458f3 Update the mastodon-1 node after Chef run 2021-01-23 17:11:45 +01:00
Greg Karékinian
40fde8a861 Update the ejabberd nodes after Chef run 2021-01-23 17:11:45 +01:00
Greg Karékinian
39d0304ab4 Update the akkounts-1 node after Chef run 2021-01-23 17:11:45 +01:00
Greg Karékinian
ee7b3626be Generate a host entry for the current PostgreSQL primary 2021-01-23 17:11:45 +01:00
Greg Karékinian
286cd2f2a3 Move the postgresql_client role to the top
We want the host file to be written before database connections happen
2021-01-23 17:11:45 +01:00
Greg Karékinian
1e3a2b40d4 Add the postgresql_client role to the akkounts role 2021-01-23 17:11:45 +01:00
Greg Karékinian
bb0e73d1b9 Switch ejabberd, mastodon and gitea to a hostname for Postgres 2021-01-23 17:11:45 +01:00
Greg Karékinian
fdd70d1872 Remove postgres-1 server
It was created with an encfs volume inside a VM, we want full disk encryption
instead. I have deleted the VM from centaurus as well as its disk and
have also unauthorized its id from the zerotier controller
2021-01-23 17:11:45 +01:00
bd48dab1d8 Set up postgres-3 VM 2021-01-23 17:06:15 +01:00
Greg Karékinian
41ca5938a2 Merge branch 'master' into feature/postgres_vms 2021-01-23 14:43:58 +01:00
e31f9ced96 Merge pull request 'Re-enable and improve Tor access for kosmos.social' (#292) from feature/mastodon_tor into master
Reviewed-on: #292
2021-01-23 13:32:57 +00:00
05cd38a5b9 Re-enable and improve Tor access for kosmos.social 2021-01-23 14:22:34 +01:00
d1929fcc9c Merge pull request 'Fix LN nodes not being accessible from the outside' (#289) from bugfix/lnd_externalip into master
Reviewed-on: #289
2021-01-23 11:07:38 +00:00
Greg Karékinian
6ec747d416 Add missing credentials for zerotier 2021-01-22 18:43:05 +01:00
Greg Karékinian
cbcb50bc86 Create a zerotier_controller role 2021-01-22 18:41:46 +01:00
Greg Karékinian
eba7d63b43 Delete the test-2 client and node file 2021-01-22 18:41:46 +01:00
Greg Karékinian
5fa23fe872 Remove the andromeda client and node files 2021-01-22 18:41:46 +01:00
Greg Karékinian
0e1a73b18f Set the private Zerotier IP for draco in the node file 2021-01-22 18:41:46 +01:00
Greg Karékinian
9b4756441a Add a recipe to join the private Zerotier network 2021-01-22 18:41:45 +01:00
Greg Karékinian
dd78b8cf7e Use the PG primary private Zerotier IP if it exists 2021-01-22 18:41:45 +01:00
Greg Karékinian
88e52607e3 Add a recipe to set up a hosts entry for the PG primary 2021-01-22 18:41:45 +01:00
Greg Karékinian
511400a7b8 Update hostsfile and add zerotier cookbook 2021-01-22 18:41:45 +01:00
Greg Karékinian
9a4420fc11 Add the ability to pass a disk size to the create_vm script
Defaults to 10GB
2021-01-22 18:41:45 +01:00
fd4844a012 Fix ejabberd API permission for akkounts VMs
It should have been using a /32, not a /8 subnet, in order to only allow
the akkounts VM(s) to use the API endpoints without further
authorization.
2021-01-22 18:41:45 +01:00
d018b6570d Use default Redis database now 2021-01-22 18:41:45 +01:00
69c1994840 Update node data 2021-01-22 18:41:45 +01:00
d121971cca Set up mastodon-1 VM 2021-01-22 18:41:45 +01:00
1403d91631 Remove extra license header 2021-01-22 18:41:45 +01:00
6da190b110 Don't configure HTTPS site when certs missing 2021-01-22 18:41:45 +01:00
8a870f6fd6 Don't fail on first run, when Tor hostname missing 2021-01-22 18:41:45 +01:00
ad64bfc0be Update system package dependencies for 20.04 2021-01-22 18:41:45 +01:00
971a3a25a1 Remove extra license headers
And update year in LICENSE file
2021-01-22 18:41:45 +01:00
Greg Karékinian
ab422155e4 Add the ability to pass a disk size to the create_vm script
Defaults to 10GB
2021-01-22 13:49:23 +01:00
775ec691ef Add firewall rules for LND and c-lightning 2021-01-14 21:25:35 +01:00
6c6026958b Fix typo in port number of externalip config 2021-01-14 21:23:03 +01:00
d1ab4c24ea Merge pull request 'Set up new Mastodon VM, fix/improve Chef recipes' (#284) from chore/move_mastodon_to_vm into master
Reviewed-on: #284
2021-01-14 15:17:19 +00:00
e7fbd57189 Merge branch 'master' into chore/move_mastodon_to_vm 2021-01-14 15:16:17 +00:00
12a3fa5b4e Use default Redis database now 2021-01-13 17:06:36 +01:00
9224aa9d97 Update node data 2021-01-13 17:06:25 +01:00
a27b6a1601 Merge pull request 'Fix ejabberd API permission for akkounts VMs' (#283) from bugfix/ejabberd_api_permission into master
Reviewed-on: #283
2021-01-13 10:40:29 +00:00
ab3ca92228 Merge branch 'master' into bugfix/ejabberd_api_permission 2021-01-13 10:40:06 +00:00
62320106cb Set up mastodon-1 VM 2021-01-13 09:50:37 +01:00
c622f81572 Remove extra license header 2021-01-13 09:50:10 +01:00
047526e0fc Don't configure HTTPS site when certs missing 2021-01-13 09:49:49 +01:00
9d13acd41a Don't fail on first run, when Tor hostname missing 2021-01-13 09:49:36 +01:00
4d0259493f Update system package dependencies for 20.04 2021-01-13 09:48:23 +01:00
c4fa9e6ec1 Remove extra license headers
And update year in LICENSE file
2021-01-12 18:42:14 +01:00
74cf26846e Fix ejabberd API permission for akkounts VMs
It should have been using a /32, not a /8 subnet, in order to only allow
the akkounts VM(s) to use the API endpoints without further
authorization.
2021-01-12 18:06:16 +01:00
4872677066 Configure postgres recipes for VMs and zerotier access
* Remove encfs (using encrypted volumes instead)
* Allow access without TLS from zerotier network
2021-01-07 13:53:30 +01:00
9d9907f0ed Remove extra license copy from recipe, update year 2021-01-07 12:53:44 +01:00
4309efd228 Add postgres-2 VM 2021-01-07 12:53:20 +01:00
4ca875a77b Merge pull request 'Create postgres-1 VM' (#281) from feature/280-postgres_vm into master
Reviewed-on: #281
2021-01-07 11:29:37 +00:00
Greg Karékinian
af54777250 Create postgresql-1 VM
Refs #280
2021-01-07 12:04:52 +01:00
Greg Karékinian
f6086e2f6a Add the firewall rules to the postgresql role 2021-01-07 12:02:35 +01:00
6db296a7f1 Merge pull request 'Move wormhole from barnard to nodejs-2' (#278) from chore/move_wormhole into master
Reviewed-on: #278
2021-01-07 10:42:41 +00:00
1eb73711a2 Remove application_javascript usage from wormhole recipe 2021-01-06 19:12:36 +01:00
eb4764026b Add script for notifying Kosmos channels from Ruby
An example for notifying Kosmos XMPP channels from plain Ruby, with no
dependencies.
2021-01-06 11:27:50 +01:00
fe63f01f7b Move wormhole from barnard to nodejs-2
Fixed two small bugs in the recipe:

* hubot user wasn't created when necessary
* systemd template always included redis service dependency
2021-01-05 18:03:15 +01:00
333a76f086 Merge pull request 'Configure and run LND and RTL' (#274) from feauture/lnd into master
Reviewed-on: #274
2021-01-05 10:33:37 +00:00
9ab097dd9a Merge pull request 'Configure local LND as Lightning node in BTCPay Server' (#275) from feature/btcpay_lnd_settings into feauture/lnd
Reviewed-on: #275
2021-01-05 10:33:01 +00:00
876d857dde Merge pull request 'Create new nodejs VM, move kredits-github to it' (#277) from chore/nodejs-2 into master
Reviewed-on: #277
2021-01-05 10:32:44 +00:00
ddded6fbae Create new nodejs VM, move kredits-github to it 2021-01-05 11:30:31 +01:00
adfd76aa64 Configure local LND as Lightning node in BTCPay Server 2021-01-02 09:59:50 +01:00
2b765e744a Configure and run RTL
Ride The Lightning is a Web UI for Lightning Network nodes. It is
accessible via the bitcoin VM's private zerotier IP on port 3000.
2021-01-01 17:42:57 +01:00
19e3dfa7b9 Remove obsolete non-standard RPC and REST ports
We'll just run those on default ports without custom config.
2021-01-01 14:14:59 +01:00
37f1fa79e7 Use standard Lightning Network port for LND
Only use the non-standard one internally, so we can run both c-lightning
and lnd on the same machine.
2021-01-01 14:13:58 +01:00
f5f234c0fd Use name of existing node
Migrated from andromeda to bitcoin-2.
2021-01-01 14:13:17 +01:00
5a8d780d37 Merge pull request 'Fix a syntax error in certbot dirsrv hook' (#273) from bugfix/272-certbot_dirsrv into master
Reviewed-on: #273
2020-12-31 11:54:17 +00:00
bf3bb3ed97 Merge branch 'master' into bugfix/272-certbot_dirsrv 2020-12-31 10:41:06 +00:00
Greg Karékinian
456639bdf8 Fix a syntax error in certbot dirsrv hook
The newline was not escaped and rendered as an actual newline

Fixes #272
2020-12-31 11:38:49 +01:00
1360836377 Merge pull request 'Set up NBXplorer, BTCPay Server, and C-Lightning with Chef' (#270) from feature/btcpay_server into master
Reviewed-on: #270
2020-12-31 10:25:08 +00:00
8a6b81485a Merge branch 'master' into feature/btcpay_server 2020-12-31 10:20:28 +00:00
3fcdc8b056 Configure and run LND 2020-12-31 10:10:22 +01:00
61accc05c2 Add nginx proxy for BTCPay 2020-12-29 15:56:53 +01:00
c71d243c40 Merge pull request 'Add a firewall rule to allow PostgreSQL clients to connect' (#269) from bugfix/postgresql_client_firewall into master
Reviewed-on: #269
2020-12-22 22:15:06 +00:00
7d0490f3da Merge branch 'master' into bugfix/postgresql_client_firewall 2020-12-22 17:16:49 +00:00
5892e3c0ab Configure and run c-lightning daemon 2020-12-22 12:28:29 +01:00
f88354c67c Compile and install c-lightning 2020-12-21 16:53:22 +01:00
bbd5500982 Configure and run BTCPay Server 2020-12-21 13:50:28 +01:00
ca373a1503 Don't require auth cookie for nbxplorer API 2020-12-21 12:25:13 +01:00
570a692bb2 Configure and run nbxplorer 2020-12-21 12:19:30 +01:00
5277bce20b Formatting 2020-12-21 11:14:19 +01:00
aa2aa59e28 Download and build NBXplorer and BTCPay 2020-12-21 11:12:14 +01:00
a2b76c7d76 New recipe: Install .NET Core SDK 2020-12-21 11:01:20 +01:00
bb4b919548 Merge pull request 'Always set the promote trigger file config' (#267) from bugfix/pg_promote_trigger_file into master
Reviewed-on: #267
2020-12-18 21:23:11 +00:00
Greg Karékinian
87388ac69d Add the postgresql_client role to the mastodon role
This will add the firewall rule and pg_hba access rule on the PostgreSQL
servers
2020-12-18 17:54:31 +01:00
Greg Karékinian
c700f98976 Add a firewall rule to allow clients to connect
Previously it was not an issue because services that connected to the
PostgreSQL primary were also on the same server as a standby server.
2020-12-18 17:53:28 +01:00
Greg Karékinian
f75aeaf9b5 Always set the promote trigger file config
Only setting it for standby servers isn't useful, as we need to be able
to touch this file to trigger the promotion of a new primary server
after running Chef on it.
2020-12-18 17:02:13 +01:00
4be542670b Merge pull request 'Add new Zoom meeting ID to hubot-kredits whitelist' (#266) from chore/zoom_meeting_id into master
Reviewed-on: #266
2020-12-17 16:40:24 +00:00
db51f1f332 Add new Zoom meeting ID to whitelist 2020-12-17 14:09:41 +01:00
95c8b9fea9 Merge pull request 'Migrate to self-hosted zerotier network' (#265) from chore/zerotier_migration into master
Reviewed-on: #265
2020-12-13 12:39:14 +00:00
84fdcc4760 Merge pull request 'Fix zerotier network creation' (#262) from bugfix/zerotier_default_rules into master
Reviewed-on: #262
2020-12-13 12:38:59 +00:00
Greg Karékinian
1551fe6d1b Update the ipfs-1 node file after running chef 2020-12-11 19:29:56 +01:00
Greg Karékinian
83736d2a85 Update the bitcoin-2 node file after running chef 2020-12-11 19:28:34 +01:00
4b9dfd9c60 Update node configs 2020-12-11 19:24:12 +01:00
fb996e9abf Join new zerotier network on VM creation 2020-12-11 19:07:11 +01:00
396fe6e714 Whitelist ejabberd custom node attributes
fixes #256
2020-12-11 19:07:06 +01:00
Greg Karékinian
ebfd36bab8 Add nodejs-1 client and node file
Refs #259
2020-12-11 19:02:04 +01:00
c4dbed8d65 Fix zerotier network creation
Using outdated/invalid rules syntax. Remove the property entirely, so
the API will create the default rule (which is the same) on creation.

Co-authored-by: Greg Karékinian <greg@karekinian.com>
2020-12-11 17:42:25 +01:00
2de9d5fe17 Fix typo 2020-12-11 17:40:40 +01:00
8896beab67 Merge pull request 'Configure a zerotier-one network controller' (#260) from feature/zerotier_controller into master
Reviewed-on: #260
2020-12-11 10:42:40 +00:00
8b624b666a Merge branch 'master' into feature/zerotier_controller 2020-12-11 10:39:20 +00:00
ba4e3fdd6f Merge pull request 'Document commands for running Chef against VMs' (#261) from docs/update_readme into master
Reviewed-on: #261
2020-12-11 10:39:08 +00:00
1cb366a160 Add commands for running Chef against VMs 2020-12-10 23:39:59 +01:00
cb8fc25fc8 Configure a zerotier-one network controller 2020-12-10 22:51:35 +01:00
f66f6e2969 Merge pull request 'Add hosts entries for ejabberd private IPs' (#257) from feature/akkounts_xmpp_host into master
Reviewed-on: #257
2020-12-10 13:28:46 +00:00
a06223d764 Merge branch 'master' into feature/akkounts_xmpp_host 2020-12-10 13:27:37 +00:00
0c537d04ef Merge pull request 'Add ejabberd HTTP API permissions for akkounts' (#255) from feature/api_permissions into master
Reviewed-on: #255
2020-12-10 13:27:19 +00:00
f1c8faff85 Merge branch 'master' into feature/api_permissions 2020-12-10 13:26:48 +00:00
623bb1e153 Merge pull request 'Script creating new VMs' (#252) from feature/244-new_vm_script into master
Reviewed-on: #252
2020-12-09 15:33:08 +00:00
Greg Karékinian
a92205bd65 Fix the VM creation script
Also join the zerotier network
2020-12-09 16:29:15 +01:00
Greg Karékinian
77ab77afe8 Update the centaurus and draco nodes after Chef run 2020-12-09 15:42:49 +01:00
Greg Karékinian
6273271d40 Remove kosmos-bitcoin::source from draco
Bitcoind runs inside a VM, not directly on the host
2020-12-09 15:42:19 +01:00
742dc6ff7f Merge branch 'master' into feature/244-new_vm_script 2020-12-09 13:59:52 +00:00
f540661de4 Merge pull request 'Update ejabberd doc' (#254) from docs/ejabberd into master
Reviewed-on: #254
2020-12-09 12:12:51 +00:00
Greg Karékinian
7ceb9af3ed Rename the kosmos_kvm default recipe to host
It makes it clear it is meant for KVM hosts
2020-12-09 11:19:13 +01:00
12125bf0b2 Add hosts entries for ejabberd private IPs 2020-12-08 20:31:01 +01:00
239b6aed51 Add API permissions for akkounts VMs
Using the zerotier IP, which is the same as the knife-zero host.
2020-12-08 20:00:31 +01:00
8e0a66184c Use role for akkounts
Lets us search by role
2020-12-08 19:59:51 +01:00
Greg Karékinian
6c907419aa Set the VM name from the script argument 2020-12-08 17:10:40 +01:00
Greg Karékinian
8f304d00ce Remove unused kitchen.yml files 2020-12-08 16:34:24 +01:00
Greg Karékinian
94a34e4758 Add arguments for RAM and number of CPUs 2020-12-08 16:33:27 +01:00
Greg Karékinian
b3c1f81ec6 Set the description of the kosmos_zerotier cookbook 2020-12-08 16:26:14 +01:00
Greg Karékinian
6f7b493173 Create the base Ubuntu 20.04 cloud image with code 2020-12-08 16:25:32 +01:00
Greg Karékinian
176083497c Install the libvirt-daemon-system package
It creates the libvirt-qemu user
2020-12-08 16:25:04 +01:00
Greg Karékinian
89c8f42a46 Set the description for the kosmos_kvm cookbook 2020-12-08 16:03:18 +01:00
56d9144ad6 Disable ACME
Throws a warning when reloading the config, because it is enabled by
default, but not configured entirely. Disabling it explicitly removes
the warning.
2020-12-08 14:30:29 +01:00
02239dd9a8 Update ejabberd doc 2020-12-08 13:13:05 +01:00
Greg Karékinian
1837285b79 Add the kosmos_kvm recipe and the firewall rules
... to the KVM hosts, centaurus and draco

Refs #244
2020-12-04 16:33:18 +01:00
Greg Karékinian
ee7a117d63 Add initial kosmos_zerotier cookbook
For now it only includes the firewall rule

Refs #244
2020-12-04 16:29:22 +01:00
Greg Karékinian
e6b7794e20 Extract firewall definitions to their own recipe
This allows us to use them for KVM hosts as well. Until now we had set
up ufw rules manually on the two KVM hosts (draco and centaurus)

Refs #244
2020-12-04 16:27:42 +01:00
Greg Karékinian
9dbe5bcfcb Deploy a script to create new VMs
It uses `virt-install` with the official Ubuntu 20.04 cloud image as a
starting point, with cloud-init to add our SSH keys to the ubuntu user
and set up Zerotier.

USAGE: create_vm VMNAME

Closes #244
2020-12-04 16:21:52 +01:00
Greg Karékinian
43736cd8e9 Move the debug logs env variable to an attribute
Set it to 'sockethub*' for now as Nick advised, see
#91
2020-03-25 17:51:28 +01:00
Greg Karékinian
29a5947d18 Deploy Sockethub from the npm package
This is currently 3.1.4 and is set as an attribute. The recipe is very
simple now, it installs the npm package, and the systemd service runs
/usr/bin/sockethub and sets the environment variables

Closes #145
2020-03-25 12:43:39 +01:00
503 changed files with 18166 additions and 4540 deletions

View File

@@ -26,5 +26,5 @@ knife[:automatic_attribute_whitelist] = %w[
chef_packages
]
knife[:default_attribute_whitelist] = []
knife[:normal_attribute_whitelist] = ['knife_zero']
knife[:normal_attribute_whitelist] = ['knife_zero','kosmos-ejabberd']
knife[:override_attribute_whitelist] = []

2
.gitignore vendored
View File

@@ -1,4 +1,6 @@
/.chef/encrypted_data_bag_secret
.chef/chef_guid
/.bundle/
/.vagrant/
/.kitchen
/nodes/vagrant-node.json

1
.ruby-version Normal file
View File

@@ -0,0 +1 @@
chef-workstation

View File

@@ -8,6 +8,7 @@ cookbook 'mediawiki',
cookbook 'redis',
git: 'https://github.com/phlipper/chef-redis.git',
ref: 'v0.5.6'
cookbook 'redisio', '= 5.0.0' # TODO upgrade to 6.x when we use Chef 16
cookbook 'postfix', '= 5.0.2'
cookbook 'php', '~> 8.0.0'
cookbook 'composer', '~> 2.7.0'
@@ -32,9 +33,9 @@ cookbook 'mysql', '~> 8.7.3'
# cookbook 'postgresql', '= 7.1.8'
cookbook 'apt', '~> 7.3.0'
cookbook 'git', '~> 10.0.0'
cookbook 'hostsfile', '= 2.4.5'
cookbook 'hostsfile', '~> 3.0.1'
cookbook 'ohai', '~> 5.2.5'
cookbook 'nodejs', '~> 5.0.0'
cookbook 'nodejs', '~> 7.3.1'
cookbook 'timezone_iii', '= 1.0.4'
cookbook 'ark', '>= 5.0.0'
cookbook 'logrotate', '= 2.2.0'
@@ -51,4 +52,5 @@ cookbook 'ipfs',
cookbook 'elasticsearch', '= 4.2.0'
cookbook 'java', '~> 4.3.0'
cookbook 'ulimit', '~> 1.0.0'
cookbook 'golang', '~> 4.1.0'
cookbook 'golang', '~> 5.3.1'
cookbook 'zerotier', '~> 1.0.7'

View File

@@ -12,10 +12,10 @@ DEPENDENCIES
elasticsearch (= 4.2.0)
firewall (~> 2.6.3)
git (~> 10.0.0)
golang (~> 4.1.0)
golang (~> 5.3.1)
homebrew (= 3.0.0)
hostname (= 0.4.2)
hostsfile (= 2.4.5)
hostsfile (~> 3.0.1)
ipfs
git: https://gitea.kosmos.org/kosmos/ipfs-cookbook.git
revision: d7c25b6ce5fa490b6de3529fdc163fb64f1ece8a
@@ -29,7 +29,7 @@ DEPENDENCIES
ref: nginx
mysql (~> 8.7.3)
nginx (= 9.0.0)
nodejs (~> 5.0.0)
nodejs (~> 7.3.1)
ntp (= 3.4.0)
ohai (~> 5.2.5)
openssl (~> 8.5.5)
@@ -48,9 +48,11 @@ DEPENDENCIES
git: https://github.com/phlipper/chef-redis.git
revision: 7476279fc9c8727f082b8d77b5e1922dc2ef437b
ref: v0.5.6
redisio (= 5.0.0)
timezone_iii (= 1.0.4)
ulimit (~> 1.0.0)
users (~> 5.3.1)
zerotier (~> 1.0.7)
GRAPH
apache2 (3.3.0)
@@ -67,12 +69,13 @@ GRAPH
poise-javascript (~> 1.0)
poise-service (~> 1.0)
apt (7.3.0)
ark (5.0.0)
seven_zip (>= 0.0.0)
ark (6.0.3)
seven_zip (>= 3.1)
build-essential (8.2.1)
mingw (>= 1.1)
seven_zip (>= 0.0.0)
chef-sugar (3.3.0)
chocolatey (3.0.0)
compat_resource (12.19.0)
composer (2.7.0)
apt (>= 0.0.0)
@@ -86,12 +89,12 @@ GRAPH
firewall (2.6.5)
chef-sugar (>= 0.0.0)
git (10.0.0)
golang (4.1.0)
ark (~> 5.0)
golang (5.3.1)
ark (>= 6.0)
homebrew (3.0.0)
hostname (0.4.2)
hostsfile (>= 0.0.0)
hostsfile (2.4.5)
hostsfile (3.0.1)
ipfs (0.7.0)
ark (>= 0.0.0)
java (4.3.0)
@@ -106,20 +109,20 @@ GRAPH
apache2 (>= 0.0.0)
nginx (>= 0.0.0)
php (>= 0.0.0)
mingw (2.1.0)
mingw (2.1.3)
seven_zip (>= 0.0.0)
mysql (8.7.3)
mysql (8.7.4)
nginx (9.0.0)
build-essential (>= 5.0)
ohai (>= 4.1.0)
yum-epel (>= 0.0.0)
nodejs (5.0.0)
nodejs (7.3.3)
ark (>= 2.0.2)
build-essential (>= 0.0.0)
chocolatey (>= 3.0)
ntp (3.4.0)
ohai (5.2.5)
openssl (8.5.5)
php (8.0.0)
php (8.0.1)
yum-epel (>= 0.0.0)
poise (2.8.2)
poise-archive (1.5.0)
@@ -148,11 +151,16 @@ GRAPH
postfix (5.0.2)
redis (0.5.6)
apt (>= 0.0.0)
seven_zip (3.1.1)
windows (>= 0.0.0)
redisio (5.0.0)
selinux_policy (>= 2.2.0)
ulimit (>= 0.1.2)
selinux_policy (2.4.3)
seven_zip (4.2.2)
timezone_iii (1.0.4)
ulimit (1.0.0)
users (5.3.1)
windows (6.0.0)
yum (5.1.0)
yum-epel (3.3.0)
windows (7.0.2)
yum (7.2.0)
yum-epel (4.2.3)
zerotier (1.0.7)
ohai (>= 0.0.0)

View File

@@ -1,7 +1,3 @@
source 'https://rubygems.org'
gem 'chef', '~> 15.3.14'
gem 'berkshelf', '~> 7.0'
gem 'knife-zero'
gem 'cookstyle'
gem 'test-kitchen'
gem 'knife-zero', '>= 2.4.2'

View File

@@ -1,255 +1,315 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.0)
bcrypt_pbkdf (1.0.1)
berkshelf (7.0.8)
chef (>= 13.6.52)
chef-config
cleanroom (~> 1.0)
concurrent-ruby (~> 1.0)
minitar (>= 0.6)
mixlib-archive (>= 0.4, < 2.0)
mixlib-config (>= 2.2.5)
mixlib-shellout (>= 2.0, < 4.0)
octokit (~> 4.0)
retryable (>= 2.0, < 4.0)
solve (~> 4.0)
thor (>= 0.20)
builder (3.2.3)
chef (15.3.14)
aws-eventstream (1.2.0)
aws-partitions (1.551.0)
aws-sdk-core (3.125.6)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.53.0)
aws-sdk-core (~> 3, >= 3.125.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.111.3)
aws-sdk-core (~> 3, >= 3.125.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sdk-secretsmanager (1.56.0)
aws-sdk-core (~> 3, >= 3.125.0)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.4.0)
aws-eventstream (~> 1, >= 1.0.2)
bcrypt_pbkdf (1.1.0)
builder (3.2.4)
chef (17.9.42)
addressable
bcrypt_pbkdf (~> 1.0)
bundler (>= 1.10)
chef-config (= 15.3.14)
aws-sdk-s3 (~> 1.91)
aws-sdk-secretsmanager (~> 1.46)
chef-config (= 17.9.42)
chef-utils (= 17.9.42)
chef-vault
chef-zero (>= 14.0.11)
diff-lcs (~> 1.2, >= 1.2.4)
ed25519 (~> 1.2)
corefoundation (~> 0.3.4)
diff-lcs (>= 1.2.4, < 1.4.0)
erubis (~> 2.7)
ffi (~> 1.9, >= 1.9.25)
ffi-libarchive
ffi (>= 1.5.0)
ffi-libarchive (~> 1.0, >= 1.0.3)
ffi-yajl (~> 2.2)
highline (>= 1.6.9, < 2)
iniparse (~> 1.4)
license-acceptance (~> 1.0, >= 1.0.5)
inspec-core (~> 4.23)
license-acceptance (>= 1.0.5, < 3)
mixlib-archive (>= 0.4, < 2.0)
mixlib-authentication (~> 2.1)
mixlib-authentication (>= 2.1, < 4)
mixlib-cli (>= 2.1.1, < 3.0)
mixlib-log (>= 2.0.3, < 4.0)
mixlib-shellout (>= 3.0.3, < 4.0)
net-sftp (~> 2.1, >= 2.1.2)
net-ssh (>= 4.2, < 6)
net-ssh-multi (~> 1.2, >= 1.2.1)
ohai (~> 15.0)
mixlib-shellout (>= 3.1.1, < 4.0)
net-sftp (>= 2.1.2, < 4.0)
ohai (~> 17.0)
plist (~> 3.2)
proxifier (~> 1.0)
syslog-logger (~> 1.6)
train-core (~> 3.0)
train-winrm
tty-screen (~> 0.6)
uuidtools (~> 2.1.5)
chef-config (15.3.14)
train-core (~> 3.2, >= 3.2.28)
train-winrm (>= 0.2.5)
uuidtools (>= 2.1.5, < 3.0)
vault (~> 0.16)
chef-config (17.9.42)
addressable
chef-utils (= 17.9.42)
fuzzyurl
mixlib-config (>= 2.2.12, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
tomlrb (~> 1.2)
chef-zero (14.0.13)
chef-telemetry (1.1.1)
chef-config
concurrent-ruby (~> 1.0)
chef-utils (17.9.42)
concurrent-ruby
chef-vault (4.1.5)
chef-zero (15.0.11)
ffi-yajl (~> 2.2)
hashie (>= 2.0, < 4.0)
hashie (>= 2.0, < 5.0)
mixlib-log (>= 2.0, < 4.0)
rack (~> 2.0, >= 2.0.6)
uuidtools (~> 2.1)
cleanroom (1.0.0)
concurrent-ruby (1.1.5)
cookstyle (5.7.0)
rubocop (= 0.72.0)
webrick
coderay (1.1.3)
concurrent-ruby (1.1.9)
corefoundation (0.3.10)
ffi (>= 1.15.0)
diff-lcs (1.3)
ed25519 (1.2.4)
equatable (0.6.1)
erubi (1.10.0)
erubis (2.7.0)
faraday (0.17.0)
faraday (1.4.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
multipart-post (>= 1.2, < 3)
ffi (1.11.1)
ffi-libarchive (0.4.10)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday_middleware (1.2.0)
faraday (~> 1.0)
ffi (1.15.5)
ffi-libarchive (1.1.3)
ffi (~> 1.0)
ffi-yajl (2.3.1)
libyajl2 (~> 1.2)
ffi-yajl (2.4.0)
libyajl2 (>= 1.2)
fuzzyurl (0.9.0)
gssapi (1.3.0)
gssapi (1.3.1)
ffi (>= 1.0.1)
gyoku (1.3.1)
builder (>= 2.1.2)
hashie (3.6.0)
highline (1.7.10)
hashie (4.1.0)
highline (2.0.3)
httpclient (2.8.3)
iniparse (1.4.4)
iniparse (1.5.0)
inspec-core (4.52.9)
addressable (~> 2.4)
chef-telemetry (~> 1.0, >= 1.0.8)
faraday (>= 0.9.0, < 1.5)
faraday_middleware (~> 1.0)
hashie (>= 3.4, < 5.0)
license-acceptance (>= 0.2.13, < 3.0)
method_source (>= 0.8, < 2.0)
mixlib-log (~> 3.0)
multipart-post (~> 2.0)
parallel (~> 1.9)
parslet (>= 1.5, < 2.0)
pry (~> 0.13)
rspec (>= 3.9, < 3.11)
rspec-its (~> 1.2)
rubyzip (>= 1.2.2, < 3.0)
semverse (~> 3.0)
sslshake (~> 1.2)
thor (>= 0.20, < 2.0)
tomlrb (>= 1.2, < 2.1)
train-core (~> 3.0)
tty-prompt (~> 0.17)
tty-table (~> 0.10)
ipaddress (0.8.3)
jaro_winkler (1.5.3)
json (2.2.0)
knife-zero (2.1.0)
jmespath (1.5.0)
json (2.6.1)
knife (17.9.26)
bcrypt_pbkdf (~> 1.1)
chef (>= 17)
chef-config (>= 17)
chef-utils (>= 17)
chef-vault
erubis (~> 2.7)
ffi (>= 1.15)
ffi-yajl (~> 2.2)
highline (>= 1.6.9, < 3)
license-acceptance (>= 1.0.5, < 3)
mixlib-archive (>= 0.4, < 2.0)
mixlib-cli (>= 2.1.1, < 3.0)
net-ssh (>= 5.1, < 7)
net-ssh-multi (~> 1.2, >= 1.2.1)
ohai (~> 17.0)
pastel
train-core (~> 3.2, >= 3.2.28)
train-winrm (>= 0.2.5)
tty-prompt (~> 0.21)
tty-screen (~> 0.6)
tty-table (~> 0.11)
knife-zero (2.4.2)
chef (>= 15.0)
libyajl2 (1.2.0)
license-acceptance (1.0.13)
knife (>= 17.0)
libyajl2 (2.1.0)
license-acceptance (2.1.13)
pastel (~> 0.7)
tomlrb (~> 1.2)
tty-box (~> 0.3)
tty-prompt (~> 0.18)
tomlrb (>= 1.2, < 3.0)
tty-box (~> 0.6)
tty-prompt (~> 0.20)
little-plugger (1.1.4)
logging (2.2.2)
logging (2.3.0)
little-plugger (~> 1.1)
multi_json (~> 1.10)
minitar (0.9)
mixlib-archive (1.0.1)
multi_json (~> 1.14)
method_source (1.0.0)
mixlib-archive (1.1.7)
mixlib-log
mixlib-authentication (2.1.1)
mixlib-cli (2.1.1)
mixlib-config (3.0.1)
mixlib-authentication (3.0.10)
mixlib-cli (2.1.8)
mixlib-config (3.0.9)
tomlrb
mixlib-install (3.11.21)
mixlib-shellout
mixlib-versioning
thor
mixlib-log (3.0.1)
mixlib-shellout (3.0.7)
mixlib-versioning (1.2.7)
molinillo (0.6.6)
multi_json (1.13.1)
mixlib-log (3.0.9)
mixlib-shellout (3.2.5)
chef-utils
multi_json (1.15.0)
multipart-post (2.1.1)
necromancer (0.5.0)
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
net-sftp (2.1.2)
net-ssh (>= 2.6.5)
net-ssh (5.2.0)
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-sftp (3.0.0)
net-ssh (>= 5.0.0, < 7.0.0)
net-ssh (6.1.0)
net-ssh-gateway (2.0.0)
net-ssh (>= 4.0.0)
net-ssh-multi (1.2.1)
net-ssh (>= 2.6.5)
net-ssh-gateway (>= 1.2.0)
nori (2.6.0)
octokit (4.14.0)
sawyer (~> 0.8.0, >= 0.5.3)
ohai (15.3.1)
chef-config (>= 12.8, < 16)
ohai (17.9.0)
chef-config (>= 14.12, < 18)
chef-utils (>= 16.0, < 18)
ffi (~> 1.9)
ffi-yajl (~> 2.2)
ipaddress
mixlib-cli (>= 1.7.0)
mixlib-config (>= 2.0, < 4.0)
mixlib-log (>= 2.0.1, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
mixlib-shellout (~> 3.2, >= 3.2.5)
plist (~> 3.1)
systemu (~> 2.6.4)
train-core
wmi-lite (~> 1.0)
parallel (1.18.0)
parser (2.6.5.0)
ast (~> 2.4.0)
pastel (0.7.3)
equatable (~> 0.6)
parallel (1.21.0)
parslet (1.8.2)
pastel (0.8.0)
tty-color (~> 0.5)
plist (3.5.0)
plist (3.6.0)
proxifier (1.0.3)
public_suffix (4.0.1)
rack (2.0.7)
rainbow (3.0.0)
retryable (3.0.4)
rubocop (0.72.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.10.1)
rubyntlm (0.6.2)
rubyzip (1.3.0)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.6)
rack (2.2.3)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.2)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.10.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.3)
ruby2_keywords (0.0.5)
rubyntlm (0.6.3)
rubyzip (2.3.2)
semverse (3.0.0)
solve (4.0.2)
molinillo (~> 0.6)
semverse (>= 1.1, < 4.0)
strings (0.1.6)
strings-ansi (~> 0.1)
unicode-display_width (~> 1.5)
sslshake (1.3.1)
strings (0.2.1)
strings-ansi (~> 0.2)
unicode-display_width (>= 1.5, < 3.0)
unicode_utils (~> 1.4)
strings-ansi (0.1.0)
strings-ansi (0.2.0)
syslog-logger (1.6.8)
systemu (2.6.5)
test-kitchen (2.3.3)
bcrypt_pbkdf (~> 1.0)
ed25519 (~> 1.2)
license-acceptance (~> 1.0, >= 1.0.11)
mixlib-install (~> 3.6)
mixlib-shellout (>= 1.2, < 4.0)
net-scp (>= 1.1, < 3.0)
net-ssh (>= 2.9, < 6.0)
net-ssh-gateway (>= 1.2, < 3.0)
thor (~> 0.19)
winrm (~> 2.0)
winrm-elevated (~> 1.0)
winrm-fs (~> 1.1)
thor (0.20.3)
tomlrb (1.2.8)
train-core (3.1.3)
thor (1.2.1)
tomlrb (1.3.0)
train-core (3.8.7)
addressable (~> 2.5)
ffi (!= 1.13.0)
json (>= 1.8, < 3.0)
mixlib-shellout (>= 2.0, < 4.0)
net-scp (>= 1.2, < 3.0)
net-ssh (>= 2.9, < 6.0)
train-winrm (0.2.5)
winrm (~> 2.0)
net-scp (>= 1.2, < 4.0)
net-ssh (>= 2.9, < 7.0)
train-winrm (0.2.12)
winrm (>= 2.3.6, < 3.0)
winrm-elevated (~> 1.2.2)
winrm-fs (~> 1.0)
tty-box (0.4.1)
pastel (~> 0.7.2)
strings (~> 0.1.6)
tty-box (0.7.0)
pastel (~> 0.8)
strings (~> 0.2.0)
tty-cursor (~> 0.7)
tty-color (0.5.0)
tty-cursor (0.7.0)
tty-prompt (0.19.0)
necromancer (~> 0.5.0)
pastel (~> 0.7.0)
tty-reader (~> 0.6.0)
tty-reader (0.6.0)
tty-color (0.6.0)
tty-cursor (0.7.1)
tty-prompt (0.23.1)
pastel (~> 0.8)
tty-reader (~> 0.8)
tty-reader (0.9.0)
tty-cursor (~> 0.7)
tty-screen (~> 0.7)
wisper (~> 2.0.0)
tty-screen (0.7.0)
unicode-display_width (1.6.0)
tty-screen (~> 0.8)
wisper (~> 2.0)
tty-screen (0.8.1)
tty-table (0.12.0)
pastel (~> 0.8)
strings (~> 0.2.0)
tty-screen (~> 0.8)
unicode-display_width (2.1.0)
unicode_utils (1.4.0)
uuidtools (2.1.5)
winrm (2.3.2)
uuidtools (2.2.0)
vault (0.16.0)
aws-sigv4
webrick (1.7.0)
winrm (2.3.6)
builder (>= 2.1.2)
erubis (~> 2.7)
erubi (~> 1.8)
gssapi (~> 1.2)
gyoku (~> 1.0)
httpclient (~> 2.2, >= 2.2.0.2)
logging (>= 1.6.1, < 3.0)
nori (~> 2.0)
rubyntlm (~> 0.6.0, >= 0.6.1)
winrm-elevated (1.1.1)
rubyntlm (~> 0.6.0, >= 0.6.3)
winrm-elevated (1.2.3)
erubi (~> 1.8)
winrm (~> 2.0)
winrm-fs (~> 1.0)
winrm-fs (1.3.2)
erubis (~> 2.7)
winrm-fs (1.3.5)
erubi (~> 1.8)
logging (>= 1.6.1, < 3.0)
rubyzip (~> 1.1)
rubyzip (~> 2.0)
winrm (~> 2.0)
wisper (2.0.0)
wmi-lite (1.0.2)
wisper (2.0.1)
wmi-lite (1.0.5)
PLATFORMS
ruby
x86_64-darwin-18
x86_64-linux
DEPENDENCIES
berkshelf (~> 7.0)
chef (~> 15.3.14)
cookstyle
knife-zero
test-kitchen
knife-zero (>= 2.4.2)
BUNDLED WITH
1.17.3
2.2.15

View File

@@ -1,19 +1,38 @@
### Install dependencies
### Install Chef Workstation
* macOS, Windows, RHEL, Ubuntu: https://docs.chef.io/workstation/install_workstation/
* Arch Linux: https://aur.archlinux.org/packages/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
### Run Chef Solo
knife zero converge name:dev.kosmos.org
### Update Chef Client on a server:
knife zero converge name:dev.kosmos.org --client-version 15.3.14
### 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.
@@ -25,3 +44,14 @@ Install cookbooks listed in Berksfile:
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](https://github.com/chef/chef/issues/12126#issuecomment-932067530) 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.

6
Vagrantfile vendored
View File

@@ -35,11 +35,11 @@ Vagrant.configure(2) do |config|
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# config.vm.network "forwarded_port", guest: 389, host: 389
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
config.vm.network "private_network", ip: "192.168.56.5"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
@@ -94,7 +94,7 @@ Vagrant.configure(2) do |config|
chef.encrypted_data_bag_secret_key_path = '.chef/encrypted_data_bag_secret'
chef.environment = 'development'
chef.add_recipe 'kosmos-base'
chef.add_recipe 'kosmos_encfs'
chef.add_recipe 'kosmos-dirsrv'
# chef.add_recipe 'kosmos-bitcoin::source'
# chef.add_recipe 'kosmos-mediawiki'
# chef.add_recipe 'kosmos-wordpress'

View File

@@ -1,4 +0,0 @@
{
"name": "andromeda.kosmos.org",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuAI/4XcdJQ4rL3JtQ86Q\nUtdFSBdMnSPxUoHbhXXTaFEB2D0hqyCjfGmt8JqoBaRmj0zNHQvOMixe+SeyfyDs\nDPHQZ5E45f0eBYPchvOjNOZTP6RYhfa1pBRW6D6JJ+2bYW1jfnTur1Tkeg0ZL6zg\nybmcsYeDYeNXEsAGQIz+zqgNHPsTLL7U+eY9u3AYhOPaBXSnaqxPxvYx9fBRWbrx\ntFz/oXjurvLS5rMhts0s6AyMKEs+5bLhSreqGsh+1CfAt2qGNPPY7J5VL1B+cAfk\nFWYD5uWo2NvYKm94UpKsmZgFKFQBglFYpMidYdbl/NNJFq3EJDRyRlzDB8VliOuG\nnwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/discourse-1.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "discourse-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxJBhKUtTcmjP8eG4aLNF\n9UfNU9lRIFhfywjFJjtXoYdNaUatZHE3s1HKND0SjJs5BRQbZBEKLxTHCgnPZD4U\nlRgZ65JtHwi+JNM6ac4TQm5JYKA++KxX7FtOiJV6oGX6foNoFVHrGi+fhTlLE9hL\npHRQWTpM8ErpUEj3VHez+k6KT1Mr3QO5T9L5kqu1BdTYwtyfXJE0VfyDKz/rwrvc\ngPvZd167p8YCTu/rWLG9X8tag+ySUR9cmlEn5sCsBLmq56Zurf0VIe/0tuGPI8DP\nAVc4dIXHsfGuKLwBfFPSDy9YbI7F8gbaD05UnUVn60IWPmWsE19K/iIc/OnJZwRO\nkQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/discourse-2.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "discourse-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwinJNGMUzUdrZwx/ZCkU\nxZRnuWqZHXHdZtkEG6beMY1sB/PpGknLgcfTjhh4FR/5hIXqBcVdUj3DZiTmhd8o\n0QpEkJPNKd08PN12CyShPwCcIA1KTqsCsNys+bp6Wff84JClAe/Oza6DonoRmhqO\ncFxSQcscuv8a6Gc/1X/aySmS01hwL+r9p0VZBEPNKEObgJXHsGIIbajlxgq037X/\n2/IsIk2etXTUSWPJLxNKSXzxC3l4Izw4NfvUgipByPTeJQ2YAVxbvrDEqquBGk5S\nll/mlF+fKX0QvUhm7sdLiSy++rHc8R1ny+4LnR1gAOscYMuLbDbpJnW0Rc0GEJOL\nVwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/drone-1.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "drone-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0DLEt7jfKPH7X7pBknG3\nWoB6Q6Vffl6Q0GRxQiMJ1uRC79dulKH097CYfLzIXFZD9gRRP4K78vW5BA2spXVV\nn3qrak9JT6BGgdFrkBEdMNGZyz814aMiyhPZrQUrmIzyH8R04xZgv7UH86qdNQ5p\nPeIXS7gU7/0PmwRgEBiM1KLq+Kba6pYdGefKqxx5D59xweH+yE+rbd5ac9xn2GP7\nyOiZoG2sMuksq7d3O4SeTS2lBAmG5IeiP2iWvHWpZD48PTr78ItkTgIbaqZU2PXV\ng+2OcJPTel5xISooe5FvW8gdpC9SYoBPvgJuJ6czc1+LdUSK7pE7577eAJNDlh+H\nRwIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"name": "ejabberd-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtoVmQAEmmAWjjzi5X8Ia\n9sl2aH8Lh0AsckM0aE3hvw9lGfbNCPpYWrr0uh7R6/+13Z0OghrT3yDAZ+XfH39Y\nuGomazTzSMMOEofjepo+nXSgq4meFfX5vobYG7rpBdz1EsIT1bElHduItA2zsw9J\nFpXtGd4BjumMq1VykSTA+QaEE8byes/+groQTtXPqXf5gJMxyGlh4SU0MzmkGHaW\n8c9BPCQrV0CMiuGOGJ5mZ28HajbvSg3+bpgwThh3M5uQaQ6on1N2pvJuBypUySS6\nyc4TauocUcUsULYXq9wM8/rqDYsUah0PR0WSiOi90m5thGeBchFAmhdCvrS34FlR\nVQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"name": "ejabberd-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAudueTsPYnRXRu/rmMGZe\nI7LdyrWKdY9FJaRhkXR5J9Yb8QnIcDS7ZXDJsVhyQW8pZ2DuaIs5dmGYvRtmx0ol\nqHTEel01Q3/xI1blJoq4uRm639PB5M9dSJ0w+s6P5zj7rbFKpvMBYxBSK6z+gXIc\n/L1ayJ6JOssX5/tEvcvx/d4GIxof/Q+puACAXawx7W88Wl7yYWdBQ78uTPHzuMyB\n8BRYz24tki/O1fa9JijW32d3EELD0EccI3iJ+/CR4BFEEM2QdDczY/Q6Ny7h7inH\n/TdU246nvtJIx7bAZHmDIDva8YPtL27RIOQ3JqBBe7prQP5Q9MBGPyCXWAglj99a\n6QIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/ejabberd-4.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "ejabberd-4",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6FuI13W2sft83OIWe59/\nYTfpTfKcYTCq5zAQEu87OYHHQeBAYo0W/g/qICh3qw0ie2QMPyggAezoeR5VQdLt\nkJq1X9AHqyX59YThzj7dLCCEKq+mAdriuKzNGu8eml4DRM3m+xw7jFzcwwrD8ECZ\nY+Kn7bcOtozx0mXpEm+cO2cOKmRQn0VJwAQSe6eW301iGmpR9et4hDqMjhiUiwaU\nWAqpsmP/JQMLAX2gLzwilD63VCQlcQCDq/D1m/N6bWb1L47zNAzwOCSYV92bGNDe\nRe+4gCVVLpfGWKbkjQFDraCmME7+O50WpbfowylF8gOzgl3AvnpC/LOSzT8VtMPr\nZQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/ejabberd-6.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "ejabberd-6",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqvGOanDqJOhf0xl/TYcs\nqYhhGz4ptFzxmfxiCMWbnbDcICBLHni28dJHhP2ggfUKOGcp+OIqiy783eRUrPsf\nnH9VmvTnz4NdXIB5J45FgBtfYiF9ZseaPL+ufTSCbZj7Ih3lzTAbO5Ug+UOj852B\nnnqH2Ht2jXMp2v3NW4gAG9QyRpr6P5cyVWBrMFExjuhNWg119tJv+33oGnflrNRi\njV3yGbRFRpqAomAVCr6DAA9SX/R8J3yKTky6MdRGrXKH/7eXH0ehDi33Y9Pyy9Ci\nkQX/JRHffuJeBF3Tndiojqdx81C6oIh2s/H3JMew/DdRxjzlPP4nemYWXv1/YVcS\nCwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/ejabberd-7.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "ejabberd-7",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzHfqcI/6w58gLwDFCKxw\n0TeKFOf4MFBnmUGsWyi8BEskkjh4QEDc4pUFeiVuEADFyBfCnALWh004nKhiwamc\nECybfAKlJryoQQEcYZC6H4rZf3SW7xPLk12X00YySNroYM50PM5Ly/G7MI9a669g\n6HNOgn1MYIEh8unpsAHjfKpx72bNutRYKKvBDaHXNvlJ459Jr8HNpERFk8IeaGcF\n4BKqf/MNxkQHOfy7R4ETXeLUBrgD13SmLbs6mM3lXS6IgkoeFyAvAPP4ZgwgiJ6w\nqIKsX4cRt8xnJJ+MTNBX4oc0f9+Gu8bUpr2JZ8tcwq3GUgDjv+JSJpk/uDzzbQUe\nIwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/ejabberd-8.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "ejabberd-8",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2r+emfhx7bl7MxEeIDGY\nKnj3xEyFvVgXL7GwOsbKszFVgZ17yuPwa6vuiJsZsbcFC/nXgGNH2WF5FEv7XhOi\nwE8KMeNrR4xQ9BEANRlRgUTfrkhZG1NCy7PpVBb7L2r36STBuFSdQJmruJAfvTHm\na4hhmfaSIJ0Wa+Q24gL1GNwkSRdOhXRYxB4OvNIJzzuC3XqgugQVG5xzZh0kULQs\nkZVvkL5dM0FEZzBn8aK2sohTFDivvYJy7PAogC9Z5M1nPatZBowruUZvCym3Wh1J\nRtBwsS9SsTcsUqaT9FpEa7vYUney1/R8G2FAFufTyztjgBQzh78GhU+dek+ycIf1\nVQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/gitea-1.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "gitea-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0bp4I/f5dLL22GRHanLV\nw57sNBEWT3Vx32B24hScKNP5nYDW0dIRkt1c7SLEpe+diNgyIwk7JlI20Vl+oaVo\njdCpmHSB18yXxQT2Ub6aI8ApwFLECVA6SckekcwxLJc/oGRMB52PonI8opJOVbPa\nF+heZ5NNDiMvn3E8qODdMWSjDiJNSVLJgsCPFHAt32aJgLaXQTqG5lrmltaamscW\njGlFqiBJw/5saCkKBPdPwdX4RcDqvGX1FdE1LVB42cskv8CrnvEVFLBxKXAhAr6s\nNhOhenzLGHpy58tNoUoUw3v4WiPRtcnlNxeSVG5LKkjaK04f2oxeZx3SiSU/1naY\nkwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/gitea-2.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "gitea-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7MKbO2vvX7TD1cFKjITh\ntvsf6hgAQRcu7F0kiekx15aC3VLnRgsB9A6SXySVrqvhq/vOSTXZsIC62IQi4Oks\nhhtAA/uvwcOmZ7JkMi0vJ3Ary94dTsg/L8i/0/k2V/D4FRKTV4414wSkpglFGLhl\nvbZ6P17LrqfyAzNJwIDzwd9d6cvt4a0qxvuxbTOHkBuY8tpyGdNzhg6fATadxbBa\nRASEVFb+xqxG3K+8zRmaCFyYqmSPS/8liVVbLPAeUlK6pDyQ5g4T37E5o+CpWfPF\nkBgYw/hHQe6zt1Z4wNJ6mb8YIN/l9kFF3EE99laYxp9Ua7ffrZkRgw12C5Yrn3N6\noQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/ldap-2.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "ldap-2.kosmos.org",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAycyHso4sCJ/RLkuQl1Qp\nBaAJsWw8NilZyoZwuaYAC4IGJ1Pn4p+6Ly4vWveGCPbDf18VNFHwNMSjtH94EWOo\nrF8Qiamcn8/NlT6NbbN77fjOFDvwITW9+7zgJz9QNsAT7lbdv9eWlWijnslVvqtk\njx9IuqAF1tEKEfnhj8wAHLT8WPABHzmp3PdfZXKN4fjCL9VcPNruXJiCIuNPnWIo\nUxY9IRa9DiZ1jXIcWrTLLHCzq07jeo+MWpC5Uuz3U6+zfevFBHM0xpGMsouIfvLf\nF+MeckT5OhwujUL4IvfZ0Wl6/5wsvHbLFFW7KsmiBK0Su04OnKnZUSaAmtEDU2w4\nSQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/mastodon-2.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "mastodon-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA27a8h17CCQLP8JY59n+M\nURsrbeVvRi3yIUe1IklOlRSTy0L3Z37rFuSNC3dC9rKl/pHDKtorgeukxbFADXQx\nkta2LNX8gf09jCWsUdga5lWIbfOdtlCLRDG1MVEUSA0f6Sxdqr8RbjM2ch31T6Me\n5Z6DYdggwBujcPHwZC1AugI1wJ0T5XHY9f2MDs/XjNEdw3ThYbAdbl1e09ql6Gtg\nSVCa4RlLg/KICdLJtVOLkX6049/XRxi41I6xvu9tXsqgV3+bs8dYbeGLsTWmpPIv\naAUMcf/A5t4B2DVpnlXDytPqfvZQPD3aBVyfEJRGI1yD6Vi9zL3RyIhDQ/I7PMNI\naQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/mastodon-3.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "mastodon-3",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArBsrwKV1RtDfw/5y/L2N\n/x7UL2q6G4JypcD5Q8/aDQOTaGuTR+4RCup+Zcn2wzpdGnX6IzS7cy4/LqMoR2pB\nq8K1FZOXvcCtwsBqsyGWiFdy5aLXy2CkHhTRbkwOLPyb1rBy+qPCBdr055BPZUWm\nTfJaxTmph+Z1J+INz0YndYxz3iKET2V99OP27D7tUdZ7yPgMDbDJWqVxPdYrmAUr\n3QLpmYWsYlmPKhpTAXlvbvzE5vgh5EC8RGfhfYRpacc6QdwbahtxMQAV9+1S2+Vj\nntHfB6PSnYwewUHs9MMn8e33KmNlOZdMAVlyJymBZ4pNceC44vxvZYElp077A6tN\nFwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/nodejs-1.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "nodejs-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9L4BQgLEpQSSbSLwXOab\nfFey5VSk8ynDmj2I9sOpPMIXkXpmbONkyXqZ4CqKrMRtesXAg1F1lIwzE/WJy0wP\n9CRhEgnclHRHE3TVqWt8dC6+u5kx5o48EF8X9UWgV1098c21gcn68NZ7+l/janws\ntLYrgMynikcadaGtAkRszGG0dX+qdeRx9hRzhTNUIG4AYe6bUA6/LfOEPyRyuo3Q\ncaN5fAJSK+RRMWr1d7Mzd8k+l3xXzcUTMUL2To+Zh0Fw2SIEocM4NS1W9nAm4+Cq\nhlQUhsoHDwk7bDsIQtRNfy3bX59PSIVMcWLNkWilLzZW1yRtFGPTJfPlR4Y1XJb5\nuwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/nodejs-2.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "nodejs-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuWyrBQXathrKzRO7HbX7\nZXqkeGo7X0q3qckO/Uh4Ht67bFb6iQDRo/gRkaVA0PM++2AhtW7wV2NYXR/3qowc\n1gGtO0zuQq56crcL7k9nVuFJ1IbYDyasEq+5nUKzEUVT0hK1/Vzh12gLFhDkBOX+\nCvISLTTQgEGljwNQLf1kZTraJcdDSN0R2k2jl+idJkeAuK5cjMEJa7Fog8scM2rR\nzGhB8gDRp+iq4HQ+yE3R1yXW9rBfWoConnXiNxholt3e2aAte2V1KnEmVLO/8ceo\nvqIp5xEcDKIAIrSqsmopRFXJ0PjS/nbS0Z2ynxpyh1BV4sqr/y4oOryrnwO+LqBB\nHwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/nodejs-3.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "nodejs-3",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyqP7aGx+S9Mdt6xmaGnJ\nfNWWQsg4BvLiP1qtVt3VRrcXF2cy1bhgfnmqoBqnDk4bGlRoTzF+rSOw284+O2UQ\ntUlsBRos4TOyGfbYHehF12Re6NX51K9LHwaprr3eN5h08wLI8pjVrRJlbce8pHST\nXQ/CZvU+CBg43LE08cXr5kRmhnZrgh70g7zTO8+1E6y74r1LEh77Ar4uaaB5jXw7\n6o9TyfaA1HgyqvfYbH+9KPrJfMX/DeLrYPMI3IG/j3fzDUQQ8o9Pb5B+G1Apl+I+\nsTcgWRei5u06aZHLMMd8MMo4O1yUhbt05kxfVhlDGUDWBdi3cvsMf95t6MNdz/eq\niwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/nodejs-4.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "nodejs-4",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwIlB6swdT/Z7tRx/Sm24\n/ro3Jotpsi0DiNS6i7BA1fH0OdbX5CRel62jGC1Nja9QCY8aBd00E8u7KPCuK3iY\n5aA7v91sxWZ7nbXdSwBawaNsTZAe4rMaEkA74INpq7TOvLzHcmDcgRbo+MC2Nw3T\nl0mCOaWkUWFaukTLN8zBldzEbYxztKsaL+b2TbevnSCaPkdD9WmDbmjrUiWTlnpE\nDidMjZ9rp+PcODyjlvwka1yJCoPFoN/+ZL4yXxo49tJ2kbrxSh4tdDZqiZwnajRb\n4SAuRCaHTASDSmZ1Dj0ET/miXuvy6Jgvt06eSMPDKvb+84Dk8zLf4CW6DaE2TfX4\nzwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/postgres-2.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "postgres-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoQmrHoW5X6jpN6cJnafW\nWKz1LpT2DvOFPeRmrlSPOPIUSVPUMZI8ojdxzmri/dzC8C4quCIYaL5ssARhe17L\no16LG3z/wdPENYONBj/oH5GRvmG1/uCgzL5+QQENk3kAWVAUb7EL3EgHNx90b2oC\nDNoHcjuoi3ZkCUXxkX7BESvw1jII4hP+HyoIqGh8TZLIAQ25/mS9aNL3TbcLYp5d\npqoM0Ruc4DHVuZTamN+zBZwNRCBz6uxMmaEBD+piYTEPJOnf7yUT7d2l/QzLftfE\nkSo80KOyrPOFdIPCpqKJyPOJZgg7fSgpR0YC6BH7I/JgIsIwUsQcMS8/ELUC5+Zg\nfwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/postgres-4.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "postgres-4",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu6fPxOZeKloF/EgYvU0k\nOwv8bJjsCQcWaMTPle5//mRTszA6PM2z9RI+Mfr45qxTlsL9pQY8WJOWF6QOK31x\nszuqcr7oOjtAhrLI8f/oNDEDjcx325FqG9gNKQEAD7d4zodh+PhDe6x7GIyIS7lG\nIcD5Zre9iDwv8FGLR+5GLqS8SJOPL/wJkQ8w+N0f8YDFw81kiTta5NLhAx3fMDs0\n2kmoNlbmKlNZTtLjCfCV+/pa9oY6wycjck3GvobiFE/4cWaNkeGlPc+uAwlfmrOv\nHy0tq1XBX/BCvE5kMXmhnMT23JXjm2s2PgCLgEVGAXilXk/T597KDm+z4oBpAQma\nnQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -0,0 +1,4 @@
{
"name": "rsk-mainnet-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtavs6RQW6af9fWuEuhI1\nQa4Ff7Z1CfZ0fHz152UqUeUKatQ/psKVs5ULWDV/b69fSuNsUzkCny9OwtwyQB/F\n2U+vbv3/3As3z6i3V3q8q4ahCHd7tkMmxMLaWcdkfWbpupWTRkCEX+PSDKS0hdfp\n3EQKVA2FrqR0sSnnT+Q66kZw4/WJrNwtSLcps4D5OubG7xr/uUn3Vyv5qXvS/7kx\nGvMONs55qh64Gtc3FSFPEdVyZXasCMEWwXyadqzf+/qJtEYlK0Uy5E/u7CTsnmcH\n9TEiYVw0/6PomQ2HJfSlZVUUO007OliBHO9bWOwZ6qI5c53pt5KES0dyy6SQ4m+8\nawIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -0,0 +1,4 @@
{
"name": "rsk-mainnet-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1cuvB3l7sBKJXqjhTih\nQloXteYOr/cQ24R5xUDnHZpCzM75khBjf9ZIX5fskManQ7MI4oFHAaKF6sCWT9QQ\nnL3ON0rCX8wDwBJpKY3iFisAK7f86GO5qkG2ovwG4wO1x69eKX52w33xGpPLPrmw\nBhFv+KfT56KZ3NCvDIQ6tew9VJ3g2V2zUtlL7xZIcdkgTXB06Ec8gbtoCAD3MVUQ\noxMCn+CK6QIAHGxpLIFEv5Y4hNRJ3+0RSuQikhhFzd7P2swnUgDSxDpbfoShroCC\neDw29sapOkQ+PwiHo2Zy8Qtr5m1ToGIhh8l1f/k2vi0Vf2xWVaTjbaeePEDMy9Fd\nKQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -0,0 +1,4 @@
{
"name": "rsk-testnet-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0JU46rCyLGOi5OdeeE2M\nobUUxO+Jqd9t9bP75Pyj0uH8WaxNv1PIdWZJiR+fcE+draBV86/YLxHzOFvsnMi+\nE/qgeXLKErGtTSb12mWq0gYv/wz9uqRbtcsv40gpu2BtNv9ycdXYACB/s0ipnuUO\nX/os4YHDvWV1cshwzgsQ87ad7OdT/Nldggtp4go60TkBi49VaftiJzYqVm1ey3xz\nd7+EsQWqhQHAac6POEuPjwNuM2valf/8+nI4Uday/CiFrDDV1SffRG30sd4rJF15\nh1S1Kxyetr72EmQwIGbJuDJL7eUU7blXjg6UtTxDDsl6rYUO5s/j7wZLoFhmC854\npQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -0,0 +1,4 @@
{
"name": "rsk-testnet-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzG2bgL0n5Q7bTR4WYHOB\nZNOuRem/jjarU/bL0VKKn0JqD3PPDAnhq9gRn7H8SwyGoVFN60YGzu45O4c+SqN3\nCXN+FeFabigH2tKLxBz3kNDYTT/F1ErLLi/6ydrCV3tpddR5KTqLSOntojG8KNzc\nyG4rMV9ebCE1wDVxAFdEA+YDZS8YjP0nO5sLWFacA0ZTx27t5ugqZP1acjSvKzWs\nZ+ekX5Pbws/oUHyaqEEPdz7er4MTBm0bdkCHZbM7132oBcH/huJZhmTXFEdoy4ML\nhP4MWWSvwo66HDYjnaID82a8W1RJZZu2irbPHrfVlaFAh8VQk1T1kkUu0bMovT3V\nYQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -0,0 +1,4 @@
{
"name": "rsk-testnet-3",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxbo3GccgPZp8UWhb9l2w\n+o6Qe5s4Tf/1TMOw3ppLw+IGCZhq9LEe8s8kngbBX7dMywbyDuf8vLXwvAHFKvC+\nx4XOXq0r9xDX8ujTCfqJxiSYk1KTyqM4lmi7qno7F9/Nwo7h3HuVbpkT752ojf+/\nDCSXwHL+uHlF6z3jKZ8iYBRHFrWmudh8bOm6lVsp/Iv4pQ/btZf8W5zULlk/Z6lT\nb6GS538Lnaoeu7wPCf/awL5GBg9findY3oS1lsEE+PfAu6SAHmbJcItMkrON7Esd\ng9xtwsjX1VICpJhOSkVS1nmRfYohELVJMdiKSLq+b5UskscbCjkRGY6GAPH8cVGg\nSQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"name": "test-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyU+Pg4svFeiLc4/OogiZ\n45MgXWMT7/S28R5lDQ3QwCc4c3mGEfkoiOzBmPpf/JuTIRO6W8hsXQNm5Wr3jGYa\nIKHtfSqNufLievLxymR781Grkzxsy8GefeUajNn0Nypjs4ACso2rdX3KmQ/xJr4n\nFKk6Jj08Fp/7i7kzgC8WA6ZeuVPRw9PODTof7x1BMoTfUXaGPPEIVxtv7cZBdkp1\nQK3F2A8nokqDo3630iOq/P29h80STGmeH8hjpICTGxYDOR/vvp7Zs7z8aueZ6iUT\n3oit8w+gAI4RTgu4bgPbwsh5nfIXZaJeSVrV6zpPO5usMbWWDJgdbhwbAGGYVSFp\nEQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/zerotier-2.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "zerotier-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsild7NcktO5yVR3Uw0yA\negHFToXHaJMIR1z0WrfHgklHf27lRnWRHOiNjnR6SbsvKIT1MBntg4/mQgotah+n\npo6cKF+0pvUih+hOSBZ6+WwjRf5LxJTaj/R0e2j0Gig6PlDV3yWz8+2AB6gObVcb\nKOQT1w6p+T+S9t6Hv/E0Z8CJW+7ZXDZBvjKTg4kYb47P0J5704wATf38EcVAOuoa\nJsUJoE+dTygx2QUG78eiEYqVDgBak00MA7MpFI/yPrzfn4tjSO1aY2/vy1PyG0Zq\nfgAhuFNZPWQwxMvYsK68gFxfmfwsEn0iJOFh0rPCKYWgOCxzkMLk2z7ppCmNd+H6\nNQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/zerotier-3.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "zerotier-3",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA70y96zXq3XiMlJhLM5Tm\nCzRiZjwqCBN1fKOoihZpsgXHtqDfYd+5BTyafAKTpzVpAZ7HJp+X4da8T/rb+Pym\nu0PrREXJSXGdWjKIgvsTVUtT51ZFYWtqbpu2l43wh57KCt7Q57JRgKTPyNbHJS0Z\ngrB6fifvQMfzFMf+WKK4X7Z6VXFP1r2cwzRvywC4/d3ZSbJ4fP3g+nnl1623Pxfc\n/BkqyaDeRt2dBEa5I8+OvFkKC8muU99fWR/gPZkkWD4pFNwLPLnPfgdk3bUd7tjN\n/0ardVX9lRJog1CjXCHaUG9aq+WFrtr/tfW+kLff/P7k00E5zplqq9Oz6VUvRMmu\nNQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -2,6 +2,40 @@
This file is used to list changes made in each version of the ark cookbook.
## 6.0.3 - *2021-08-30*
- Standardise files with files in sous-chefs/repo-management
## 6.0.2 - *2021-06-18*
- Update location of test archive fixtures
## 6.0.1 - *2021-06-01*
- Standardise files with files in sous-chefs/repo-management
## 6.0.0 - *2021-05-22*
- Chef 17 updates: enable `unified_mode` on all resources
- Bump required Chef Infra Client to >= 15.3
- Migrate to using `seven_zip_tool` resource directly and require `seven_zip` >= 3.1
- Various ChefSpec fixes
## 5.1.1 - *2021-04-29*
- Added a version pin on seven_zip
## 5.1.0 - *2021-01-24*
- Sous Chefs Adoption
- Standardise files with files in sous-chefs/repo-management
- Cookstyle fixes
- Add integration testing for Windows and MacOS
- Remove testing for Amazon Linux 201x, CentOS 6 and Ubuntu 16.04
- Fix ChefSpec tests
- Fix issues with `--strip-components` with the `:cherry_pick` action on MacOS
- Ensure `/etc/profile.d` exists on MacOS if `append_env_path` is used
## 5.0.0 (2020-01-02)
- Require Chef Infra Client 14+ and remove the need for the build_essential dependency - [@tas50](https://github.com/tas50)
@@ -33,8 +67,9 @@ This file is used to list changes made in each version of the ark cookbook.
- Rewrite of resource to custom resources.
- Remove EOL platforms from testing.
- Update zlib URL
-
## 2.2.1 (2016-12-16)
- Use Ohai root_group attribute to avoid trying to set the group to root on BSD/macOS.
- Add missing accessor for owner property

View File

@@ -1,2 +0,0 @@
Please refer to
https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD

202
cookbooks/ark/LICENSE Normal file
View File

@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
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.

View File

@@ -1,6 +1,10 @@
# ark cookbook
[![Build Status](https://travis-ci.org/chef-cookbooks/ark.svg?branch=master)](https://travis-ci.org/chef-cookbooks/ark) [![Cookbook Version](https://img.shields.io/cookbook/v/ark.svg)](https://supermarket.chef.io/cookbooks/ark)
[![Cookbook Version](https://img.shields.io/cookbook/v/ark.svg)](https://supermarket.chef.io/cookbooks/ark)
[![CI State](https://github.com/sous-chefs/ark/workflows/ci/badge.svg)](https://github.com/sous-chefs/ark/actions?query=workflow%3Aci)
[![OpenCollective](https://opencollective.com/sous-chefs/backers/badge.svg)](#backers)
[![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors)
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)
## Overview
@@ -27,6 +31,10 @@ By default, the ark will not run again if the `:path` is not empty. Ark provides
For remote files ark supports URLs using the [remote_file](http://docs.chef.io/resource_remote_file.html) resource. Local files are accessed with the `file://` syntax.
## Maintainers
This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If youd like to know more please visit [sous-chefs.org](https://sous-chefs.org/) or come chat with us on the Chef Community Slack in [#sous-chefs](https://chefcommunity.slack.com/messages/C2V7B88SF).
## Requirements
### Platforms
@@ -269,29 +277,27 @@ You can also supply the file extension in case the file extension can not be det
end
```
## License & Authors
## Contributors
- Author: Philip (flip) Kromer - Infochimps, Inc([coders@infochimps.com](mailto:coders@infochimps.com))
- Author: Bryan W. Berry ([bryan.berry@gmail.com](mailto:bryan.berry@gmail.com))
- Author: Denis Barishev ([denis.barishev@gmail.com](mailto:denis.barishev@gmail.com))
- Author: Sean OMeara ([someara@chef.io](mailto:someara@chef.io))
- Author: John Bellone ([jbellone@bloomberg.net](mailto:jbellone@bloomberg.net))
- Copyright: 2011, Philip (flip) Kromer - Infochimps, Inc
- Copyright: 2012, Bryan W. Berry
- Copyright: 2012, Denis Barishev
- Copyright: 2013-2017, Chef Software, Inc
- Copyright: 2014, Bloomberg L.P.
This project exists thanks to all the people who [contribute.](https://opencollective.com/sous-chefs/contributors.svg?width=890&button=false)
```
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
### Backers
http://www.apache.org/licenses/LICENSE-2.0
Thank you to all our backers!
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.
```
![https://opencollective.com/sous-chefs#backers](https://opencollective.com/sous-chefs/backers.svg?width=600&avatarHeight=40)
### Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
![https://opencollective.com/sous-chefs/sponsor/0/website](https://opencollective.com/sous-chefs/sponsor/0/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/1/website](https://opencollective.com/sous-chefs/sponsor/1/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/2/website](https://opencollective.com/sous-chefs/sponsor/2/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/3/website](https://opencollective.com/sous-chefs/sponsor/3/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/4/website](https://opencollective.com/sous-chefs/sponsor/4/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/5/website](https://opencollective.com/sous-chefs/sponsor/5/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/6/website](https://opencollective.com/sous-chefs/sponsor/6/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/7/website](https://opencollective.com/sous-chefs/sponsor/7/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/8/website](https://opencollective.com/sous-chefs/sponsor/8/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/9/website](https://opencollective.com/sous-chefs/sponsor/9/avatar.svg?avatarHeight=100)

View File

@@ -31,7 +31,7 @@ pkgs = %w(libtool autoconf) unless platform_family?('mac_os_x')
pkgs += %w(make) unless platform_family?('mac_os_x', 'freebsd')
pkgs += %w(unzip rsync gcc) unless platform_family?('mac_os_x')
pkgs += %w(autogen) unless platform_family?('rhel', 'fedora', 'mac_os_x', 'suse', 'amazon')
pkgs += %w(gtar) if platform?('freebsd') || platform?('smartos')
pkgs += %w(gtar) if platform?('freebsd', 'smartos')
pkgs += %w(gmake) if platform?('freebsd')
if platform_family?('rhel', 'suse', 'amazon')
if node['platform_version'].to_i >= 7

115
cookbooks/ark/chefignore Normal file
View File

@@ -0,0 +1,115 @@
# Put files/directories that should be ignored in this file when uploading
# to a Chef Infra Server or Supermarket.
# Lines that start with '# ' are comments.
# OS generated files #
######################
.DS_Store
ehthumbs.db
Icon?
nohup.out
Thumbs.db
.envrc
# EDITORS #
###########
.#*
.project
.settings
*_flymake
*_flymake.*
*.bak
*.sw[a-z]
*.tmproj
*~
\#*
REVISION
TAGS*
tmtags
.vscode
.editorconfig
## COMPILED ##
##############
*.class
*.com
*.dll
*.exe
*.o
*.pyc
*.so
*/rdoc/
a.out
mkmf.log
# Testing #
###########
.circleci/*
.codeclimate.yml
.delivery/*
.foodcritic
.kitchen*
.mdlrc
.overcommit.yml
.rspec
.rubocop.yml
.travis.yml
.watchr
.yamllint
azure-pipelines.yml
Dangerfile
examples/*
features/*
Guardfile
kitchen.yml*
mlc_config.json
Procfile
Rakefile
spec/*
test/*
# SCM #
#######
.git
.gitattributes
.gitconfig
.github/*
.gitignore
.gitkeep
.gitmodules
.svn
*/.bzr/*
*/.git
*/.hg/*
*/.svn/*
# Berkshelf #
#############
Berksfile
Berksfile.lock
cookbooks/*
tmp
# Bundler #
###########
vendor/*
Gemfile
Gemfile.lock
# Policyfile #
##############
Policyfile.rb
Policyfile.lock.json
# Documentation #
#############
CODE_OF_CONDUCT*
CONTRIBUTING*
documentation/*
TESTING*
UPGRADING*
# Vagrant #
###########
.vagrant
Vagrantfile

View File

@@ -0,0 +1,65 @@
driver:
name: dokken
privileged: true # because Docker and SystemD
chef_version: <%= ENV['CHEF_VERSION'] || 'current' %>
chef_license: accept-no-persist
transport:
name: dokken
provisioner:
name: dokken
platforms:
- name: amazonlinux-2
driver:
image: dokken/amazonlinux-2
pid_one_command: /usr/lib/systemd/systemd
- name: debian-9
driver:
image: dokken/debian-9
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- name: debian-10
driver:
image: dokken/debian-10
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- name: centos-7
driver:
image: dokken/centos-7
pid_one_command: /usr/lib/systemd/systemd
- name: centos-8
driver:
image: dokken/centos-8
pid_one_command: /usr/lib/systemd/systemd
- name: fedora-latest
driver:
image: dokken/fedora-latest
pid_one_command: /usr/lib/systemd/systemd
- name: ubuntu-18.04
driver:
image: dokken/ubuntu-18.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- name: ubuntu-20.04
driver:
image: dokken/ubuntu-20.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- name: opensuse-leap-15
driver:
image: dokken/opensuse-leap-15
pid_one_command: /bin/systemd

View File

@@ -0,0 +1,14 @@
---
driver:
name: exec
transport:
name: exec
provisioner:
name: chef_zero
deprecations_as_errors: true
platforms:
- name: windows-latest
- name: macos-latest

View File

@@ -104,7 +104,7 @@ module Ark
def wmi_property_from_query(wmi_property, wmi_query)
@wmi = ::WIN32OLE.connect('winmgmts://')
result = @wmi.ExecQuery(wmi_query)
return nil unless result.each.count > 0
return unless result.each.count > 0
result.each.next.send(wmi_property)
end

View File

@@ -42,7 +42,7 @@ module Ark
end
def sevenzip_binary
@tar_binary ||= "\"#{(node['ark']['sevenzip_binary'] || sevenzip_path_from_registry)}\""
@tar_binary ||= "\"#{node['ark']['sevenzip_binary'] || sevenzip_path_from_registry}\""
end
def sevenzip_path_from_registry

View File

@@ -9,7 +9,7 @@ module Ark
end
def cherry_pick
"#{tar_binary} #{args} #{resource.release_file} -C #{resource.path} #{resource.creates}#{strip_args}"
"#{tar_binary} #{args} #{resource.release_file} -C #{resource.path}#{strip_args} #{resource.creates}"
end
def initialize(resource)

View File

@@ -1 +1,49 @@
{"name":"ark","version":"5.0.0","description":"Provides a custom resource for installing runtime artifacts in a predictable fashion","long_description":"","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache-2.0","platforms":{"ubuntu":">= 0.0.0","debian":">= 0.0.0","redhat":">= 0.0.0","centos":">= 0.0.0","suse":">= 0.0.0","opensuse":">= 0.0.0","opensuseleap":">= 0.0.0","scientific":">= 0.0.0","oracle":">= 0.0.0","amazon":">= 0.0.0","windows":">= 0.0.0","mac_os_x":">= 0.0.0","smartos":">= 0.0.0","freebsd":">= 0.0.0"},"dependencies":{"seven_zip":">= 0.0.0"},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/chef-cookbooks/ark","issues_url":"https://github.com/chef-cookbooks/ark/issues","chef_version":[[">= 14.0"]],"ohai_version":[]}
{
"name": "ark",
"description": "Provides a custom resource for installing runtime artifacts in a predictable fashion",
"long_description": "",
"maintainer": "Sous Chefs",
"maintainer_email": "help@sous-chefs.org",
"license": "Apache-2.0",
"platforms": {
"amazon": ">= 0.0.0",
"centos": ">= 0.0.0",
"debian": ">= 0.0.0",
"freebsd": ">= 0.0.0",
"mac_os_x": ">= 0.0.0",
"opensuse": ">= 0.0.0",
"opensuseleap": ">= 0.0.0",
"oracle": ">= 0.0.0",
"redhat": ">= 0.0.0",
"scientific": ">= 0.0.0",
"smartos": ">= 0.0.0",
"suse": ">= 0.0.0",
"ubuntu": ">= 0.0.0",
"windows": ">= 0.0.0"
},
"dependencies": {
"seven_zip": ">= 3.1"
},
"providing": {
},
"recipes": {
},
"version": "6.0.3",
"source_url": "https://github.com/sous-chefs/ark",
"issues_url": "https://github.com/sous-chefs/ark/issues",
"privacy": false,
"chef_versions": [
[
">= 15.3"
]
],
"ohai_versions": [
],
"gems": [
],
"eager_load_libraries": true
}

View File

@@ -1,16 +1,26 @@
name 'ark'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache-2.0'
description 'Provides a custom resource for installing runtime artifacts in a predictable fashion'
version '5.0.0'
name 'ark'
maintainer 'Sous Chefs'
maintainer_email 'help@sous-chefs.org'
license 'Apache-2.0'
description 'Provides a custom resource for installing runtime artifacts in a predictable fashion'
version '6.0.3'
source_url 'https://github.com/sous-chefs/ark'
issues_url 'https://github.com/sous-chefs/ark/issues'
chef_version '>= 15.3'
%w(ubuntu debian redhat centos suse opensuse opensuseleap scientific oracle amazon windows mac_os_x smartos freebsd).each do |os|
supports os
end
supports 'amazon'
supports 'centos'
supports 'debian'
supports 'freebsd'
supports 'mac_os_x'
supports 'opensuse'
supports 'opensuseleap'
supports 'oracle'
supports 'redhat'
supports 'scientific'
supports 'smartos'
supports 'suse'
supports 'ubuntu'
supports 'windows'
depends 'seven_zip' # for windows os
source_url 'https://github.com/chef-cookbooks/ark'
issues_url 'https://github.com/chef-cookbooks/ark/issues'
chef_version '>= 14.0'
depends 'seven_zip', '>= 3.1' # for windows os

View File

@@ -20,4 +20,4 @@
package node['ark']['package_dependencies'] unless platform_family?('windows', 'mac_os_x')
include_recipe 'seven_zip' if platform_family?('windows')
seven_zip_tool 'ark' if platform_family?('windows')

View File

@@ -25,7 +25,7 @@ property :url, String, required: true
property :path, String
property :full_path, String
property :append_env_path, [true, false], default: false
property :checksum, regex: /^[a-zA-Z0-9]{64}$/, default: nil
property :checksum, String, regex: /^[a-zA-Z0-9]{64}$/
property :has_binaries, Array, default: []
property :creates, String
property :release_file, String, default: ''
@@ -46,6 +46,8 @@ property :autoconf_opts, Array, default: []
property :extension, String
property :backup, [FalseClass, Integer], default: 5
unified_mode true
#################
# action :install
#################
@@ -105,6 +107,9 @@ action :install do
to new_resource.path
end
# This directory doesn't exist by default on MacOS
directory '/etc/profile.d' if platform_family?('mac_os_x')
# Add to path for interactive bash sessions
template "/etc/profile.d/#{new_resource.name}.sh" do
cookbook 'ark'

View File

@@ -0,0 +1,118 @@
# Changelog for Chocolatey cookbook
## v3.0.0 (2019-07-11)
- Add `node['chocolatey']['sensitive']` attribute (default: false) to give users the option to suppress output spam when the install.ps1 file is pushed to the machine.
- Require Chef Infra Client 12.15 or later
- Resolve minor Cookstyle warnings
- Fix `node['chocolatey']['upgrade']` to properly upgrade the `chocolatey` package
- Upgrade to the latest and greatest Chocolatey install script
## v2.0.1 (2018-07-03)
- Remove mentions of the package provider from the readme and metadata
## v2.0.0 (2018-05-01)
### Breaking Change
The package LWRP has been removed from this cookbook. chocolatey_package was integrated into Chef 12.7, which was released in Feb 2016\. This cookbook now requires Chef 12.7 or later.
### Other Changes
- This cookbook no longer requires the Windows cookbook
- The install script has been updated to the latest Chocolatey install script
- Converted testing to use Delivery Local Mode from within ChefDK
## v1.2.1 (2017-08-20)
- Explicitly use the double-dash long option names for `--source` and `--installargs`
## v1.2.0 (2017-05-04)
- Change the default `['chocolatey']['upgrade']` attribute value to `false`. Preventing chocolatey from reinstalling every chef run
## v1.1.1 (2017-04-22)
- Fix chef 13 converges renaming conflicting `env_path` method
## v1.1.0 (2017-01-09)
- Update the chocolatey install script to match chocolatey.org.
## v1.0.3 (2016-09-12)
- Loosen windows-cookbook constraint
## v1.0.2 (2016-08-29)
- Ensure `chocolateyVersion` attribute is used and the correct version of chocolatey is installed.
## v1.0.1 (2016-07-15)
- Always execute chocolatey installer unless guard is satisfied to allow the install to retry on subsequent attempts if it fails.
## v1.0.0 (2016-03-07)
- No longer dependent on chocolatey.org for install script
- Removed deprecated overwriting of the current_resource and fixed visibility problem with `env_path`
## v0.6.2 (2016-01-07)
- Fix Chocolatey detection on chef clients older than 12.4.0
## v0.6.1 (2015-11-24)
- Fix LocalJumpError on existing chocolatey package
## v0.6.0 (2015-11-17)
- Path Tracking. Tracking additions to the user and machine %PATH% environment and merging them into the current process.
- Downcase package name results from choco upgrade.
## v0.5.1 (2015-11-10)
- Prepend library include with :: in provder to fix 12.3.0 and likely other versions older than 12.5.1.
- Add backward compatibiliy to new metadata.rb attributes `source_url` and `issues_url`.
## v0.5.0 (2015-11-09)
- Refactored install script (and .kitchen.yml) to support installing Chocolatey in test-kitchen behind a proxy.
- Download `node['chocolatey']['Uri']` via `remote_file` resource instead of .net web client
- Set `chocolateyProxyLocation` environment variable to `Chef::Config['https_proxy']` if one is set before chocolatey install
- Changed helpers module namespacing from: `ChocolateyHelpers` to `Chocolatey::Helpers`
- Add ChefSpec unit tests
- Add ServerSpec integration tests
- Gemfile: bump foodcritic to 5.0 and Berkshelf to 4.0
- Add ChefSpec matchers
## v0.4.1 (2015-10-15)
- Adds example how to install package with version
- use the vanilla script resource to bypass 64bit interpreter builder introduced in Chef 12.5
## v0.4.0 (2015-06-30)
- Refactor script to download Chocolatey install script
- Chocolatey install: add proxy support
- fix for 64-bit chocolatey installs
## v0.3.0 (2015-04-20)
- Support for chocolatey >= 0.9.9
- Make package name case insensitive
## v0.2.0 (2014-09-24)
- Allow spaces in the path to the "choco" command.
- Update tests to use Rakefile
- Support Chocolatey version 0.9.8.24+
- Support custom command line options when installing packages
## v0.1.0 (2014-02-20)
- Fix and tests
## v0.0.5 (2013-04-30)
- Initial release

View File

@@ -0,0 +1,46 @@
# chocolatey Cookbook
[![Cookbook Version](https://img.shields.io/cookbook/v/chocolatey.svg)](https://supermarket.getchef.com/cookbooks/chocolatey) ![delivery](https://github.com/chocolatey-community/chocolatey-cookbook/workflows/delivery/badge.svg)
Install Chocolatey with the default recipe.
## Requirements
### Platform
- Windows
### Chef Infra Client
- 12.15 or greater
## Notes
As of Chocolatey version [0.9.8.24](https://github.com/chocolatey/chocolatey/blob/master/CHANGELOG.md#09824-july-3-2014) the install directory for Chocolatey has changed from `C:\Chocolatey` to `C:\ProgramData\Chocolatey`.
More information can be gotten from the [Chocolateywiki](https://github.com/chocolatey/chocolatey/wiki/DefaultChocolateyInstallReasoning).
## Attributes
All attributes below are pre-pended with `node['chocolatey']`
Attribute | Description | Type | Default
---------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------
`['upgrade']` | Whether to upgrade Chocolatey if it's already installed | Boolean | false
`['install_vars']['chocolateyProxyLocation']` | HTTPS proxy for Chocolatey install script | String | Chef::Config['https_proxy'] or ENV['https_proxy']
`['install_vars']['chocolateyProxyUser']` | Proxy user for authenticating proxies | String | nil
`['install_vars']['chocolateyProxyPassword']` | Proxy user password | String | nil
`['install_vars']['chocolateyVersion']` | Version of Chocolatey to install, e.g. '0.9.9.11' | String | nil (download latest version)
`['install_vars']['chocolateyDownloadUrl']` | Chocolatey .nupkg file URL. Use this if you host an internal copy of the chocolatey.nupkg | String | <https://chocolatey.org/api/v2/package/chocolatey> (download from chocolatey.org)
`['install_vars']['chocolateyUseWindowsCompression']`| To use built-in compression instead of 7zip (requires additional download) set to `true` | String | nil (use 7zip)
`['sensitive']` | When true, will suppress writing the contents of install.ps1 to the console | Boolean | false
## Recipes
- `chocolatey::default` - installs Chocolatey
## License and Maintainer
Maintainer:: Guilhem Lettron ([guilhem@lettron.fr](mailto:guilhem@lettron.fr))
License:: Apache 2.0

View File

@@ -0,0 +1,12 @@
default['chocolatey']['upgrade'] = false
default['chocolatey']['sensitive'] = false
# Chocolatey install.ps1 env vars. See https://chocolatey.org/install.ps1
default['chocolatey']['install_vars'].tap do |env|
env['chocolateyProxyLocation'] = Chef::Config['https_proxy'] || ENV['https_proxy']
env['chocolateyProxyUser'] = nil
env['chocolateyProxyPassword'] = nil
env['chocolateyVersion'] = nil
env['chocolateyDownloadUrl'] = 'https://chocolatey.org/api/v2/package/chocolatey'
env['chocolateyUseWindowsCompression'] = nil
end

View File

@@ -0,0 +1,421 @@
# =====================================================================
# Copyright 2017 - 2020 Chocolatey Software, Inc, and the
# original authors/contributors from ChocolateyGallery
# Copyright 2011 - 2017 RealDimensions Software, LLC, and the
# original authors/contributors from ChocolateyGallery
# at https://github.com/chocolatey/chocolatey.org
#
# 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.
# =====================================================================
# For organizational deployments of Chocolatey, please see https://chocolatey.org/docs/how-to-setup-offline-installation
# Environment Variables, specified as $env:NAME in PowerShell.exe and %NAME% in cmd.exe.
# For explicit proxy, please set $env:chocolateyProxyLocation and optionally $env:chocolateyProxyUser and $env:chocolateyProxyPassword
# For an explicit version of Chocolatey, please set $env:chocolateyVersion = 'versionnumber'
# To target a different url for chocolatey.nupkg, please set $env:chocolateyDownloadUrl = 'full url to nupkg file'
# NOTE: $env:chocolateyDownloadUrl does not work with $env:chocolateyVersion.
# To use built-in compression instead of 7zip (requires additional download), please set $env:chocolateyUseWindowsCompression = 'true'
# To bypass the use of any proxy, please set $env:chocolateyIgnoreProxy = 'true'
#specifically use the API to get the latest version (below)
$url = ''
$chocolateyVersion = $env:chocolateyVersion
if (![string]::IsNullOrEmpty($chocolateyVersion)){
Write-Output "Downloading specific version of Chocolatey: $chocolateyVersion"
$url = "https://chocolatey.org/api/v2/package/chocolatey/$chocolateyVersion"
}
$chocolateyDownloadUrl = $env:chocolateyDownloadUrl
if (![string]::IsNullOrEmpty($chocolateyDownloadUrl)){
Write-Output "Downloading Chocolatey from : $chocolateyDownloadUrl"
$url = "$chocolateyDownloadUrl"
}
if ($env:TEMP -eq $null) {
$env:TEMP = Join-Path $env:SystemDrive 'temp'
}
$chocTempDir = Join-Path $env:TEMP "chocolatey"
$tempDir = Join-Path $chocTempDir "chocInstall"
if (![System.IO.Directory]::Exists($tempDir)) {[void][System.IO.Directory]::CreateDirectory($tempDir)}
$file = Join-Path $tempDir "chocolatey.zip"
# PowerShell v2/3 caches the output stream. Then it throws errors due
# to the FileStream not being what is expected. Fixes "The OS handle's
# position is not what FileStream expected. Do not use a handle
# simultaneously in one FileStream and in Win32 code or another
# FileStream."
function Fix-PowerShellOutputRedirectionBug {
$poshMajorVerion = $PSVersionTable.PSVersion.Major
if ($poshMajorVerion -lt 4) {
try{
# http://www.leeholmes.com/blog/2008/07/30/workaround-the-os-handles-position-is-not-what-filestream-expected/ plus comments
$bindingFlags = [Reflection.BindingFlags] "Instance,NonPublic,GetField"
$objectRef = $host.GetType().GetField("externalHostRef", $bindingFlags).GetValue($host)
$bindingFlags = [Reflection.BindingFlags] "Instance,NonPublic,GetProperty"
$consoleHost = $objectRef.GetType().GetProperty("Value", $bindingFlags).GetValue($objectRef, @())
[void] $consoleHost.GetType().GetProperty("IsStandardOutputRedirected", $bindingFlags).GetValue($consoleHost, @())
$bindingFlags = [Reflection.BindingFlags] "Instance,NonPublic,GetField"
$field = $consoleHost.GetType().GetField("standardOutputWriter", $bindingFlags)
$field.SetValue($consoleHost, [Console]::Out)
[void] $consoleHost.GetType().GetProperty("IsStandardErrorRedirected", $bindingFlags).GetValue($consoleHost, @())
$field2 = $consoleHost.GetType().GetField("standardErrorWriter", $bindingFlags)
$field2.SetValue($consoleHost, [Console]::Error)
} catch {
Write-Output "Unable to apply redirection fix."
}
}
}
Fix-PowerShellOutputRedirectionBug
# Attempt to set highest encryption available for SecurityProtocol.
# PowerShell will not set this by default (until maybe .NET 4.6.x). This
# will typically produce a message for PowerShell v2 (just an info
# message though)
try {
# Set TLS 1.2 (3072) as that is the minimum required by Chocolatey.org.
# Use integers because the enumeration value for TLS 1.2 won't exist
# in .NET 4.0, even though they are addressable if .NET 4.5+ is
# installed (.NET 4.5 is an in-place upgrade).
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
} catch {
Write-Output 'Unable to set PowerShell to use TLS 1.2. This is required for contacting Chocolatey as of 03 FEB 2020. https://chocolatey.org/blog/remove-support-for-old-tls-versions. If you see underlying connection closed or trust errors, you may need to do one or more of the following: (1) upgrade to .NET Framework 4.5+ and PowerShell v3+, (2) Call [System.Net.ServicePointManager]::SecurityProtocol = 3072; in PowerShell prior to attempting installation, (3) specify internal Chocolatey package location (set $env:chocolateyDownloadUrl prior to install or host the package internally), (4) use the Download + PowerShell method of install. See https://chocolatey.org/docs/installation for all install options.'
}
function Get-Downloader {
param (
[string]$url
)
$downloader = new-object System.Net.WebClient
$defaultCreds = [System.Net.CredentialCache]::DefaultCredentials
if ($defaultCreds -ne $null) {
$downloader.Credentials = $defaultCreds
}
$ignoreProxy = $env:chocolateyIgnoreProxy
if ($ignoreProxy -ne $null -and $ignoreProxy -eq 'true') {
Write-Debug "Explicitly bypassing proxy due to user environment variable"
$downloader.Proxy = [System.Net.GlobalProxySelection]::GetEmptyWebProxy()
} else {
# check if a proxy is required
$explicitProxy = $env:chocolateyProxyLocation
$explicitProxyUser = $env:chocolateyProxyUser
$explicitProxyPassword = $env:chocolateyProxyPassword
if ($explicitProxy -ne $null -and $explicitProxy -ne '') {
# explicit proxy
$proxy = New-Object System.Net.WebProxy($explicitProxy, $true)
if ($explicitProxyPassword -ne $null -and $explicitProxyPassword -ne '') {
$passwd = ConvertTo-SecureString $explicitProxyPassword -AsPlainText -Force
$proxy.Credentials = New-Object System.Management.Automation.PSCredential ($explicitProxyUser, $passwd)
}
Write-Debug "Using explicit proxy server '$explicitProxy'."
$downloader.Proxy = $proxy
} elseif (!$downloader.Proxy.IsBypassed($url)) {
# system proxy (pass through)
$creds = $defaultCreds
if ($creds -eq $null) {
Write-Debug "Default credentials were null. Attempting backup method"
$cred = get-credential
$creds = $cred.GetNetworkCredential();
}
$proxyaddress = $downloader.Proxy.GetProxy($url).Authority
Write-Debug "Using system proxy server '$proxyaddress'."
$proxy = New-Object System.Net.WebProxy($proxyaddress)
$proxy.Credentials = $creds
$downloader.Proxy = $proxy
}
}
return $downloader
}
function Download-String {
param (
[string]$url
)
$downloader = Get-Downloader $url
return $downloader.DownloadString($url)
}
function Download-File {
param (
[string]$url,
[string]$file
)
#Write-Output "Downloading $url to $file"
$downloader = Get-Downloader $url
$downloader.DownloadFile($url, $file)
}
if ($url -eq $null -or $url -eq '') {
Write-Output "Getting latest version of the Chocolatey package for download."
$url = 'https://chocolatey.org/api/v2/Packages()?$filter=((Id%20eq%20%27chocolatey%27)%20and%20(not%20IsPrerelease))%20and%20IsLatestVersion'
[xml]$result = Download-String $url
$url = $result.feed.entry.content.src
}
# Download the Chocolatey package
Write-Output "Getting Chocolatey from $url."
Download-File $url $file
# Determine unzipping method
# 7zip is the most compatible so use it by default
$7zaExe = Join-Path $tempDir '7za.exe'
$unzipMethod = '7zip'
$useWindowsCompression = $env:chocolateyUseWindowsCompression
if ($useWindowsCompression -ne $null -and $useWindowsCompression -eq 'true') {
Write-Output 'Using built-in compression to unzip'
$unzipMethod = 'builtin'
} elseif (-Not (Test-Path ($7zaExe))) {
Write-Output "Downloading 7-Zip commandline tool prior to extraction."
# download 7zip
Download-File 'https://chocolatey.org/7za.exe' "$7zaExe"
}
# unzip the package
Write-Output "Extracting $file to $tempDir..."
if ($unzipMethod -eq '7zip') {
$params = "x -o`"$tempDir`" -bd -y `"$file`""
# use more robust Process as compared to Start-Process -Wait (which doesn't
# wait for the process to finish in PowerShell v3)
$process = New-Object System.Diagnostics.Process
$process.StartInfo = New-Object System.Diagnostics.ProcessStartInfo($7zaExe, $params)
$process.StartInfo.RedirectStandardOutput = $true
$process.StartInfo.UseShellExecute = $false
$process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Hidden
$process.Start() | Out-Null
$process.BeginOutputReadLine()
$process.WaitForExit()
$exitCode = $process.ExitCode
$process.Dispose()
$errorMessage = "Unable to unzip package using 7zip. Perhaps try setting `$env:chocolateyUseWindowsCompression = 'true' and call install again. Error:"
switch ($exitCode) {
0 { break }
1 { throw "$errorMessage Some files could not be extracted" }
2 { throw "$errorMessage 7-Zip encountered a fatal error while extracting the files" }
7 { throw "$errorMessage 7-Zip command line error" }
8 { throw "$errorMessage 7-Zip out of memory" }
255 { throw "$errorMessage Extraction cancelled by the user" }
default { throw "$errorMessage 7-Zip signalled an unknown error (code $exitCode)" }
}
} else {
if ($PSVersionTable.PSVersion.Major -lt 5) {
try {
$shellApplication = new-object -com shell.application
$zipPackage = $shellApplication.NameSpace($file)
$destinationFolder = $shellApplication.NameSpace($tempDir)
$destinationFolder.CopyHere($zipPackage.Items(),0x10)
} catch {
throw "Unable to unzip package using built-in compression. Set `$env:chocolateyUseWindowsCompression = 'false' and call install again to use 7zip to unzip. Error: `n $_"
}
} else {
Expand-Archive -Path "$file" -DestinationPath "$tempDir" -Force
}
}
# Call chocolatey install
Write-Output "Installing chocolatey on this machine"
$toolsFolder = Join-Path $tempDir "tools"
$chocInstallPS1 = Join-Path $toolsFolder "chocolateyInstall.ps1"
& $chocInstallPS1
Write-Output 'Ensuring chocolatey commands are on the path'
$chocInstallVariableName = "ChocolateyInstall"
$chocoPath = [Environment]::GetEnvironmentVariable($chocInstallVariableName)
if ($chocoPath -eq $null -or $chocoPath -eq '') {
$chocoPath = "$env:ALLUSERSPROFILE\Chocolatey"
}
if (!(Test-Path ($chocoPath))) {
$chocoPath = "$env:SYSTEMDRIVE\ProgramData\Chocolatey"
}
$chocoExePath = Join-Path $chocoPath 'bin'
if ($($env:Path).ToLower().Contains($($chocoExePath).ToLower()) -eq $false) {
$env:Path = [Environment]::GetEnvironmentVariable('Path',[System.EnvironmentVariableTarget]::Machine);
}
Write-Output 'Ensuring chocolatey.nupkg is in the lib folder'
$chocoPkgDir = Join-Path $chocoPath 'lib\chocolatey'
$nupkg = Join-Path $chocoPkgDir 'chocolatey.nupkg'
if (![System.IO.Directory]::Exists($chocoPkgDir)) { [System.IO.Directory]::CreateDirectory($chocoPkgDir); }
Copy-Item "$file" "$nupkg" -Force -ErrorAction SilentlyContinue
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDNxwdauklvXMYd
# R6F324woy4ZDT1pBVoUMp0tAZ0LTVKCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2CWsDnkoOn7p0WfTxvspJ8fT
# eyOU5JEjlpB3gvmhhCNmElQzUHSxKCa7JGnCwlLyFGeKiUXULaGj6YgsIJWuHEqH
# CN8M9eJNYBi+qsSyrnAxZjNxPqxwoqvOf+l8y5Kh5TsxHM/q8grkV7tKtel05iv+
# bMt+dDk2DZDv5LVOpKnqagqrhPOsZ061xPeM0SAlI+sIZD5SlsHyDxL0xY4PwaLo
# LFH3c7y9hbFig3NBggfkOItqcyDQD2RzPJ6fpjOp/RnfJZPRAgMBAAGjggHNMIIB
# yTASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBhjATBgNVHSUEDDAK
# BggrBgEFBQcDAzB5BggrBgEFBQcBAQRtMGswJAYIKwYBBQUHMAGGGGh0dHA6Ly9v
# Y3NwLmRpZ2ljZXJ0LmNvbTBDBggrBgEFBQcwAoY3aHR0cDovL2NhY2VydHMuZGln
# aWNlcnQuY29tL0RpZ2lDZXJ0QXNzdXJlZElEUm9vdENBLmNydDCBgQYDVR0fBHow
# eDA6oDigNoY0aHR0cDovL2NybDQuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0QXNzdXJl
# ZElEUm9vdENBLmNybDA6oDigNoY0aHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0Rp
# Z2lDZXJ0QXNzdXJlZElEUm9vdENBLmNybDBPBgNVHSAESDBGMDgGCmCGSAGG/WwA
# AgQwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly93d3cuZGlnaWNlcnQuY29tL0NQUzAK
# BghghkgBhv1sAzAdBgNVHQ4EFgQUWsS5eyoKo6XqcQPAYPkt9mV1DlgwHwYDVR0j
# BBgwFoAUReuir/SSy4IxLVGLp6chnfNtyA8wDQYJKoZIhvcNAQELBQADggEBAD7s
# DVoks/Mi0RXILHwlKXaoHV0cLToaxO8wYdd+C2D9wz0PxK+L/e8q3yBVN7Dh9tGS
# dQ9RtG6ljlriXiSBThCk7j9xjmMOE0ut119EefM2FAaK95xGTlz/kLEbBw6RFfu6
# r7VRwo0kriTGxycqoSkoGjpxKAI8LpGjwCUR4pwUR6F6aGivm6dcIFzZcbEMj7uo
# +MUSaJ/PQMtARKUT8OZkDCUIQjKyNookAv4vcn4c10lFluhZHen6dGRrsutmQ9qz
# sIzV6Q3d9gEgzpkxYz0IGhizgZtPxpMQBvwHgfqL2vmCSfdibqFT+hKUGIUukpHq
# aGxEMrJmoecYpJpkUe8wggU6MIIEIqADAgECAhAH+0XZ9wtVKQNgl7T04UNwMA0G
# CSqGSIb3DQEBCwUAMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJ
# bmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lDZXJ0
# IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwHhcNMTgwMzMwMDAwMDAw
# WhcNMjEwNDE0MTIwMDAwWjB3MQswCQYDVQQGEwJVUzEPMA0GA1UECBMGS2Fuc2Fz
# MQ8wDQYDVQQHEwZUb3Bla2ExIjAgBgNVBAoTGUNob2NvbGF0ZXkgU29mdHdhcmUs
# IEluYy4xIjAgBgNVBAMTGUNob2NvbGF0ZXkgU29mdHdhcmUsIEluYy4wggEiMA0G
# CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4irdLWVJryfKSgPPCyMN+nBmxtZIm
# mTBhJMaYVJ6gtfvHcFakH7IC8TcjcEIrkK7wB/2vEJkEqiOTgbVQPZLnfX8ZAxhd
# UiJmwQHEiSwLzoo2B35ROQ9qdOsn1bYIEzDpaqm/XwYH925LLpxhr9oCkBNf5dZs
# e5bc/s1J5sQ9HRYwpb3MimmNHGpNP/YhjXX/kNFCZIv3mUadFHi+talYIN5dp6ai
# /k+qgZeL5klPdmjyIgf3JiDywCf7j5nSbm3sWarYjM5vLe/oD+eK70fez30a17Cy
# 97Jtqmdz6WUV1BcbMWeb9b8x369UJq5vt7vGwVFDOeGjwffuVHLRvWLnAgMBAAGj
# ggHFMIIBwTAfBgNVHSMEGDAWgBRaxLl7KgqjpepxA8Bg+S32ZXUOWDAdBgNVHQ4E
# FgQUqRlYCMLOvsDUS4mx9UA1avD3fvgwDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQM
# MAoGCCsGAQUFBwMDMHcGA1UdHwRwMG4wNaAzoDGGL2h0dHA6Ly9jcmwzLmRpZ2lj
# ZXJ0LmNvbS9zaGEyLWFzc3VyZWQtY3MtZzEuY3JsMDWgM6Axhi9odHRwOi8vY3Js
# NC5kaWdpY2VydC5jb20vc2hhMi1hc3N1cmVkLWNzLWcxLmNybDBMBgNVHSAERTBD
# MDcGCWCGSAGG/WwDATAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2Vy
# dC5jb20vQ1BTMAgGBmeBDAEEATCBhAYIKwYBBQUHAQEEeDB2MCQGCCsGAQUFBzAB
# hhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wTgYIKwYBBQUHMAKGQmh0dHA6Ly9j
# YWNlcnRzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFNIQTJBc3N1cmVkSURDb2RlU2ln
# bmluZ0NBLmNydDAMBgNVHRMBAf8EAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQA+ddcs
# z/NB/+V+AIlUNOVTlGDNCtn1AfvwoRZg9XMmx0/S0EKayfVFTk/x96WMQgxL+/5x
# B8Uhw6anlhbPC6bjBcIxRj/IUgR7yJ/NAykyM1x+pWvkPZV3slwe0GDPwhaqGUTU
# aG8njO4EvA682a1o7wqQFR1MIltjtuPB2gp311LLxP1k5dpUMgaA0lAfnbRr+5dc
# QOFWslkho1eBf0xlzSrhRGPy0e/IYWpl+/sEwXhD88QUkN7dSXY0fMlyGQfn6H4f
# ozBQvCk37eoE0uAtkUrWAlJxO/4Esi83ko4hokwQJHaN64/7NdNaKlG3shC9+2QM
# kY3j3BU+Ym2GZgtBMIIGajCCBVKgAwIBAgIQAwGaAjr/WLFr1tXq5hfwZjANBgkq
# hkiG9w0BAQUFADBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5j
# MRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBB
# c3N1cmVkIElEIENBLTEwHhcNMTQxMDIyMDAwMDAwWhcNMjQxMDIyMDAwMDAwWjBH
# MQswCQYDVQQGEwJVUzERMA8GA1UEChMIRGlnaUNlcnQxJTAjBgNVBAMTHERpZ2lD
# ZXJ0IFRpbWVzdGFtcCBSZXNwb25kZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
# ggEKAoIBAQCjZF38fLPggjXg4PbGKuZJdTvMbuBTqZ8fZFnmfGt/a4ydVfiS457V
# WmNbAklQ2YPOb2bu3cuF6V+l+dSHdIhEOxnJ5fWRn8YUOawk6qhLLJGJzF4o9GS2
# ULf1ErNzlgpno75hn67z/RJ4dQ6mWxT9RSOOhkRVfRiGBYxVh3lIRvfKDo2n3k5f
# 4qi2LVkCYYhhchhoubh87ubnNC8xd4EwH7s2AY3vJ+P3mvBMMWSN4+v6GYeofs/s
# jAw2W3rBerh4x8kGLkYQyI3oBGDbvHN0+k7Y/qpA8bLOcEaD6dpAoVk62RUJV5lW
# MJPzyWHM0AjMa+xiQpGsAsDvpPCJEY93AgMBAAGjggM1MIIDMTAOBgNVHQ8BAf8E
# BAMCB4AwDAYDVR0TAQH/BAIwADAWBgNVHSUBAf8EDDAKBggrBgEFBQcDCDCCAb8G
# A1UdIASCAbYwggGyMIIBoQYJYIZIAYb9bAcBMIIBkjAoBggrBgEFBQcCARYcaHR0
# cHM6Ly93d3cuZGlnaWNlcnQuY29tL0NQUzCCAWQGCCsGAQUFBwICMIIBVh6CAVIA
# QQBuAHkAIAB1AHMAZQAgAG8AZgAgAHQAaABpAHMAIABDAGUAcgB0AGkAZgBpAGMA
# YQB0AGUAIABjAG8AbgBzAHQAaQB0AHUAdABlAHMAIABhAGMAYwBlAHAAdABhAG4A
# YwBlACAAbwBmACAAdABoAGUAIABEAGkAZwBpAEMAZQByAHQAIABDAFAALwBDAFAA
# UwAgAGEAbgBkACAAdABoAGUAIABSAGUAbAB5AGkAbgBnACAAUABhAHIAdAB5ACAA
# QQBnAHIAZQBlAG0AZQBuAHQAIAB3AGgAaQBjAGgAIABsAGkAbQBpAHQAIABsAGkA
# YQBiAGkAbABpAHQAeQAgAGEAbgBkACAAYQByAGUAIABpAG4AYwBvAHIAcABvAHIA
# YQB0AGUAZAAgAGgAZQByAGUAaQBuACAAYgB5ACAAcgBlAGYAZQByAGUAbgBjAGUA
# LjALBglghkgBhv1sAxUwHwYDVR0jBBgwFoAUFQASKxOYspkH7R7for5XDStnAs0w
# HQYDVR0OBBYEFGFaTSS2STKdSip5GoNL9B6Jwcp9MH0GA1UdHwR2MHQwOKA2oDSG
# Mmh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEFzc3VyZWRJRENBLTEu
# Y3JsMDigNqA0hjJodHRwOi8vY3JsNC5kaWdpY2VydC5jb20vRGlnaUNlcnRBc3N1
# cmVkSURDQS0xLmNybDB3BggrBgEFBQcBAQRrMGkwJAYIKwYBBQUHMAGGGGh0dHA6
# Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBBBggrBgEFBQcwAoY1aHR0cDovL2NhY2VydHMu
# ZGlnaWNlcnQuY29tL0RpZ2lDZXJ0QXNzdXJlZElEQ0EtMS5jcnQwDQYJKoZIhvcN
# AQEFBQADggEBAJ0lfhszTbImgVybhs4jIA+Ah+WI//+x1GosMe06FxlxF82pG7xa
# FjkAneNshORaQPveBgGMN/qbsZ0kfv4gpFetW7easGAm6mlXIV00Lx9xsIOUGQVr
# NZAQoHuXx/Y/5+IRQaa9YtnwJz04HShvOlIJ8OxwYtNiS7Dgc6aSwNOOMdgv420X
# Ewbu5AO2FKvzj0OncZ0h3RTKFV2SQdr5D4HRmXQNJsQOfxu19aDxxncGKBXp2JPl
# VRbwuwqrHNtcSCdmyKOLChzlldquxC5ZoGHd2vNtomHpigtt7BIYvfdVVEADkitr
# wlHCCkivsNRu4PQUCjob4489yq9qjXvc2EQwggbNMIIFtaADAgECAhAG/fkDlgOt
# 6gAK6z8nu7obMA0GCSqGSIb3DQEBBQUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBa
# Fw0yMTExMTAwMDAwMDBaMGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNVBAMTGERpZ2lD
# ZXJ0IEFzc3VyZWQgSUQgQ0EtMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
# ggEBAOiCLZn5ysJClaWAc0Bw0p5WVFypxNJBBo/JM/xNRZFcgZ/tLJz4FlnfnrUk
# FcKYubR3SdyJxArar8tea+2tsHEx6886QAxGTZPsi3o2CAOrDDT+GEmC/sfHMUiA
# fB6iD5IOUMnGh+s2P9gww/+m9/uizW9zI/6sVgWQ8DIhFonGcIj5BZd9o8dD3QLo
# Oz3tsUGj7T++25VIxO4es/K8DCuZ0MZdEkKB4YNugnM/JksUkK5ZZgrEjb7Szgau
# rYRvSISbT0C58Uzyr5j79s5AXVz2qPEvr+yJIvJrGGWxwXOt1/HYzx4KdFxCuGh+
# t9V3CidWfA9ipD8yFGCV/QcEogkCAwEAAaOCA3owggN2MA4GA1UdDwEB/wQEAwIB
# hjA7BgNVHSUENDAyBggrBgEFBQcDAQYIKwYBBQUHAwIGCCsGAQUFBwMDBggrBgEF
# BQcDBAYIKwYBBQUHAwgwggHSBgNVHSAEggHJMIIBxTCCAbQGCmCGSAGG/WwAAQQw
# ggGkMDoGCCsGAQUFBwIBFi5odHRwOi8vd3d3LmRpZ2ljZXJ0LmNvbS9zc2wtY3Bz
# LXJlcG9zaXRvcnkuaHRtMIIBZAYIKwYBBQUHAgIwggFWHoIBUgBBAG4AeQAgAHUA
# cwBlACAAbwBmACAAdABoAGkAcwAgAEMAZQByAHQAaQBmAGkAYwBhAHQAZQAgAGMA
# bwBuAHMAdABpAHQAdQB0AGUAcwAgAGEAYwBjAGUAcAB0AGEAbgBjAGUAIABvAGYA
# IAB0AGgAZQAgAEQAaQBnAGkAQwBlAHIAdAAgAEMAUAAvAEMAUABTACAAYQBuAGQA
# IAB0AGgAZQAgAFIAZQBsAHkAaQBuAGcAIABQAGEAcgB0AHkAIABBAGcAcgBlAGUA
# bQBlAG4AdAAgAHcAaABpAGMAaAAgAGwAaQBtAGkAdAAgAGwAaQBhAGIAaQBsAGkA
# dAB5ACAAYQBuAGQAIABhAHIAZQAgAGkAbgBjAG8AcgBwAG8AcgBhAHQAZQBkACAA
# aABlAHIAZQBpAG4AIABiAHkAIAByAGUAZgBlAHIAZQBuAGMAZQAuMAsGCWCGSAGG
# /WwDFTASBgNVHRMBAf8ECDAGAQH/AgEAMHkGCCsGAQUFBwEBBG0wazAkBggrBgEF
# BQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29tMEMGCCsGAQUFBzAChjdodHRw
# Oi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUNlcnRBc3N1cmVkSURSb290Q0Eu
# Y3J0MIGBBgNVHR8EejB4MDqgOKA2hjRodHRwOi8vY3JsMy5kaWdpY2VydC5jb20v
# RGlnaUNlcnRBc3N1cmVkSURSb290Q0EuY3JsMDqgOKA2hjRodHRwOi8vY3JsNC5k
# aWdpY2VydC5jb20vRGlnaUNlcnRBc3N1cmVkSURSb290Q0EuY3JsMB0GA1UdDgQW
# BBQVABIrE5iymQftHt+ivlcNK2cCzTAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun
# pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEARlA+ybcoJKc4HbZbKa9Sz1LpMUer
# Vlx71Q0LQbPv7HUfdDjyslxhopyVw1Dkgrkj0bo6hnKtOHisdV0XFzRyR4WUVtHr
# uzaEd8wkpfMEGVWp5+Pnq2LN+4stkMLA0rWUvV5PsQXSDj0aqRRbpoYxYqioM+Sb
# OafE9c4deHaUJXPkKqvPnHZL7V/CSxbkS3BMAIke/MV5vEwSV/5f4R68Al2o/vsH
# OE8Nxl2RuQ9nRc3Wg+3nkg2NsWmMT/tZ4CMP0qquAHzunEIOz5HXJ7cW7g/DvXwK
# oO4sCFWFIrjrGBpN/CohrUkxg0eVd3HcsRtLSxwQnHcUwZ1PL1qVCCkQJjGCBEww
# ggRIAgEBMIGGMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMx
# GTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lDZXJ0IFNI
# QTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0ECEAf7Rdn3C1UpA2CXtPThQ3Aw
# DQYJYIZIAWUDBAIBBQCggYQwGAYKKwYBBAGCNwIBDDEKMAigAoAAoQKAADAZBgkq
# hkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgorBgEEAYI3AgELMQ4wDAYKKwYBBAGC
# NwIBFTAvBgkqhkiG9w0BCQQxIgQgVOMYjIaBHu7LkOhlbFNa1FFBBUFQu8BKOfZZ
# AK2CtCUwDQYJKoZIhvcNAQEBBQAEggEAccxIsQDitasvwWmCy+JQLBU4qNfShPld
# fVFg7Dte5/KpHMEd6rgw0ECoN1H8nabSf3dVMPDWGTdXzYVc+zB5Nmhlwy/9CGAs
# XmIICX16xcwYb18miih52j/m5JXT4NhTIl/+e5mF4nyoJUJeBJwIUSDuV3rHyOpE
# 90BGZXJPX2ItGbp1J//bMDECzkxRtSRDxNCQ8QlS0YBc2h+ftQFmlmb86N8XCqdB
# 32paBD1OmhH7tVB9eXQRQ9rtNLbVUB790d/IGYkHU7zlVMwxpI7wYNqgdcV9bv5z
# O9GaG8QaQXxxtIB/hH5m5wWvcberqJb2qr5Ke6U1mPV1T6G6TGdctKGCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMjAwNDE2MDA1MDU0WjAjBgkqhkiG9w0BCQQxFgQUSnVQXFG9NidxPlpR
# Zbf9t65cx2kwDQYJKoZIhvcNAQEBBQAEggEAlpX/WR+PI6eEsARfNpjEQAdcOOG6
# Kp1TyXOaikIUh0BI7IjCiGRr7LbXQdkZIMcl3UD8TN+GQ59RsHSsYaAQJozUW9uo
# pj3NaQJaKwHB15zHzcD1TMi18zCCPlebPmUTDsbICWBWangCST0zqU849+3tlx7E
# LLjYjs/ybeS7aQffy1Dv87ElCYWsVuoQ0n9U/7hqJ3pv88SM52xmg9IlexfOanCz
# tTAM+ke9OcXuPhoZJuDL3c8gaWxELpkokMoqX0UCgCgY4RTmJ44mC9GcYKSnpMQZ
# qFot8MXA8t5cdxN2EL8j0ASufyE0oucys4cs+yiN65GWds7YbjYC/ihG6A==
# SIG # End signature block

View File

@@ -0,0 +1,55 @@
module Chocolatey
module Helpers
# include the PowershellOut module from the windows cookbook
# in case we are running an older chef client
include Chef::Mixin::PowershellOut
# Get the ChocolateyInstall directory from the environment.
def chocolatey_install
ENV.fetch('ChocolateyInstall') { |env_var| machine_env_var(env_var) }
end
# The Chocolatey command.
#
# Reference: https://github.com/chocolatey/chocolatey-cookbook/pull/16#issuecomment-47975896
def chocolatey_executable
"\"#{::File.join(chocolatey_install, 'bin', 'choco')}\""
end
def chocolatey_lib_dir
File.join(chocolatey_install, 'lib', 'chocolatey')
end
# Check if Chocolatey is installed
def chocolatey_installed?
return @is_chocolatey_installed if @is_chocolatey_installed
return false if chocolatey_install.nil?
# choco /? returns an exit status of -1 with chocolatey 0.9.9 => use list
cmd = Mixlib::ShellOut.new("#{chocolatey_executable} list -l chocolatey")
cmd.run_command
@is_chocolatey_installed = cmd.exitstatus == 0
end
# combine the local path with the user and machine paths
def environment_path(local_path)
machine = env_var('PATH', 'MACHINE').split(';')
user = env_var('PATH', 'USER').split(';')
local = local_path.split(';')
combined = local.concat(machine).concat(user).uniq.compact
combined.join(';')
end
private
def machine_env_var(env_var)
env_var(env_var, 'MACHINE')
end
def env_var(env_var, scope)
env_var = powershell_out!(
"[System.Environment]::GetEnvironmentVariable('#{env_var}', '#{scope}')"
)
env_var.stdout.chomp
end
end
end

View File

@@ -0,0 +1 @@
{"name":"chocolatey","version":"3.0.0","description":"Install Chocolatey on Windows","long_description":"","maintainer":"Guilhem Lettron","maintainer_email":"guilhem.lettron@youscribe.com","license":"Apache-2.0","platforms":{"windows":">= 0.0.0"},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/chocolatey/chocolatey-cookbook","issues_url":"https://github.com/chocolatey/chocolatey-cookbook/issues","chef_version":[[">= 12.15"]],"ohai_version":[]}

View File

@@ -0,0 +1,13 @@
name 'chocolatey'
maintainer 'Guilhem Lettron'
maintainer_email 'guilhem.lettron@youscribe.com'
license 'Apache-2.0'
description 'Install Chocolatey on Windows'
version '3.0.0'
source_url 'https://github.com/chocolatey/chocolatey-cookbook'
issues_url 'https://github.com/chocolatey/chocolatey-cookbook/issues'
supports 'windows'
chef_version '>= 12.15'

View File

@@ -0,0 +1,48 @@
#
# Cookbook:: chocolatey
# recipe:: default
# Author:: Guilhem Lettron <guilhem.lettron@youscribe.com>
#
# Copyright:: 2012, Societe Publica.
# Copyright:: 2015, Doug Ireton
#
# 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.
#
unless platform_family?('windows')
return "Chocolatey install not supported on #{node['platform_family']}"
end
Chef::Resource.include Chocolatey::Helpers
install_ps1 = File.join(Chef::Config['file_cache_path'], 'chocolatey-install.ps1')
cookbook_file install_ps1 do
action :create
backup false
source 'install.ps1'
sensitive node['chocolatey']['sensitive']
end
powershell_script 'Install Chocolatey' do
environment node['chocolatey']['install_vars']
cwd Chef::Config['file_cache_path']
code install_ps1
not_if { chocolatey_installed? }
end
if node['chocolatey']['upgrade']
chocolatey_package 'chocolatey' do
action :upgrade
version node['chocolatey']['install_vars']['chocolateyVersion']
end
end

View File

@@ -2,6 +2,36 @@
This file is used to list changes made in each version of golang.
## 5.3.1 - *2021-08-30*
- Standardise files with files in sous-chefs/repo-management
## 5.3.0 - *2021-07-15*
- Fix `unified_mode` declaration
- Bump `ark` dependency to one with `unified_mode` set
## 5.2.0 - *2021-06-04*
- Update example package to adhere with modern Go standards
## 5.1.0 - *2021-06-03*
- Fix resource to use the correct path in GOPATH profile.d template
## 5.0.1 - *2021-06-01*
- Standardise files with files in sous-chefs/repo-management
## 5.0.0 - *2021-05-21*
- Require chef 15.3 or greater
- Use unified_mode for chef 17 support
## 4.1.1 - *2021-02-03*
- Use `node['golang']['scm']` and `node['golang']['scm_packages']` attributes in default recipe.
## 4.1.0
- Create a custom resource to install Go from source or by downloading a package

201
cookbooks/golang/LICENSE Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.

115
cookbooks/golang/chefignore Normal file
View File

@@ -0,0 +1,115 @@
# Put files/directories that should be ignored in this file when uploading
# to a Chef Infra Server or Supermarket.
# Lines that start with '# ' are comments.
# OS generated files #
######################
.DS_Store
ehthumbs.db
Icon?
nohup.out
Thumbs.db
.envrc
# EDITORS #
###########
.#*
.project
.settings
*_flymake
*_flymake.*
*.bak
*.sw[a-z]
*.tmproj
*~
\#*
REVISION
TAGS*
tmtags
.vscode
.editorconfig
## COMPILED ##
##############
*.class
*.com
*.dll
*.exe
*.o
*.pyc
*.so
*/rdoc/
a.out
mkmf.log
# Testing #
###########
.circleci/*
.codeclimate.yml
.delivery/*
.foodcritic
.kitchen*
.mdlrc
.overcommit.yml
.rspec
.rubocop.yml
.travis.yml
.watchr
.yamllint
azure-pipelines.yml
Dangerfile
examples/*
features/*
Guardfile
kitchen.yml*
mlc_config.json
Procfile
Rakefile
spec/*
test/*
# SCM #
#######
.git
.gitattributes
.gitconfig
.github/*
.gitignore
.gitkeep
.gitmodules
.svn
*/.bzr/*
*/.git
*/.hg/*
*/.svn/*
# Berkshelf #
#############
Berksfile
Berksfile.lock
cookbooks/*
tmp
# Bundler #
###########
vendor/*
Gemfile
Gemfile.lock
# Policyfile #
##############
Policyfile.rb
Policyfile.lock.json
# Documentation #
#############
CODE_OF_CONDUCT*
CONTRIBUTING*
documentation/*
TESTING*
UPGRADING*
# Vagrant #
###########
.vagrant
Vagrantfile

View File

@@ -0,0 +1,55 @@
---
driver:
name: dokken
privileged: true
transport:
name: dokken
provisioner:
name: dokken
product_name: chef
product_version: <%= ENV['CHEF_VERSION'] || 'latest' %>
chef_license: accept-no-persist
install_strategy: once
platforms:
- name: debian-9
driver:
image: dokken/debian-9
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- name: debian-10
driver:
image: dokken/debian-10
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- name: centos-7
driver:
image: dokken/centos-7
platform: rhel
pid_one_command: /usr/lib/systemd/systemd
- name: centos-8
driver:
image: dokken/centos-8
platform: rhel
pid_one_command: /usr/lib/systemd/systemd
- name: ubuntu-18.04
driver:
image: dokken/ubuntu-18.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
- name: ubuntu-20.04
driver:
image: dokken/ubuntu-18.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update

View File

@@ -1 +1,43 @@
{"name":"golang","version":"4.1.0","description":"Installs go programming language","long_description":"","maintainer":"Sous Chefs","maintainer_email":"help@sous-chefs.org","license":"Apache-2.0","platforms":{"debian":">= 0.0.0","ubuntu":">= 0.0.0","redhat":">= 0.0.0","centos":">= 0.0.0","fedora":">= 0.0.0","amazon":">= 0.0.0","scientific":">= 0.0.0","oracle":">= 0.0.0"},"dependencies":{"ark":"~> 5.0"},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/sous-chefs/golang","issues_url":"https://github.com/sous-chefs/golang/issues","chef_version":[[">= 14.0"]],"ohai_version":[]}
{
"name": "golang",
"description": "Installs go programming language",
"long_description": "",
"maintainer": "Sous Chefs",
"maintainer_email": "help@sous-chefs.org",
"license": "Apache-2.0",
"platforms": {
"debian": ">= 0.0.0",
"ubuntu": ">= 0.0.0",
"redhat": ">= 0.0.0",
"centos": ">= 0.0.0",
"fedora": ">= 0.0.0",
"amazon": ">= 0.0.0",
"scientific": ">= 0.0.0",
"oracle": ">= 0.0.0"
},
"dependencies": {
"ark": ">= 6.0"
},
"providing": {
},
"recipes": {
},
"version": "5.3.1",
"source_url": "https://github.com/sous-chefs/golang",
"issues_url": "https://github.com/sous-chefs/golang/issues",
"privacy": false,
"chef_versions": [
[
">= 15.3"
]
],
"ohai_versions": [
],
"gems": [
],
"eager_load_libraries": true
}

View File

@@ -5,8 +5,8 @@ license 'Apache-2.0'
description 'Installs go programming language'
source_url 'https://github.com/sous-chefs/golang'
issues_url 'https://github.com/sous-chefs/golang/issues'
chef_version '>= 14.0'
version '4.1.0'
chef_version '>= 15.3'
version '5.3.1'
supports 'debian'
supports 'ubuntu'
@@ -17,4 +17,4 @@ supports 'amazon'
supports 'scientific'
supports 'oracle'
depends 'ark', '~> 5.0'
depends 'ark', '>= 6.0'

View File

@@ -2,7 +2,7 @@
# Cookbook:: golang
# Recipe:: default
#
# Copyright:: 2013, Alexander Rozhnov
# Copyright:: 2013-2021, Alexander Rozhnov
#
# 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
@@ -21,6 +21,8 @@ golang 'Install go' do
from_source node['golang']['from_source']
version node['golang']['version'] if node['golang']['version'] # go version
source_version node['golang']['source_version'] if node['golang']['source_version'] # go version from source
scm node['golang']['scm']
scm_packages node['golang']['scm_packages']
owner node['golang']['owner'] if node['golang']['owner']
group node['golang']['group'] if node['golang']['group']
end

View File

@@ -2,7 +2,7 @@
# Cookbook:: golang
# Resource:: default
#
# Copyright:: 2020, Sous-chefs
# Copyright:: 2020-2021, Sous-chefs
#
# 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
@@ -17,6 +17,8 @@
# under the License.
#
unified_mode true
# Install golang by compiling from source
property :from_source, [true, false], default: false
@@ -99,7 +101,7 @@ action :install do
source 'golang.sh.erb'
mode new_resource.directory_mode
variables gobin: new_resource.gobin,
gopath: new_resource.gobin,
gopath: new_resource.gopath,
install_dir: new_resource.install_dir
end

View File

@@ -2,6 +2,22 @@
# Cookbook:: golang
# Resource:: default
#
# Copyright:: 2020-2021, Sous-chefs
#
# 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.
#
unified_mode true
default_action :install

View File

@@ -1,42 +1,53 @@
hostsfile Cookbook CHANGELOG
=======================
# hostsfile Cookbook CHANGELOG
This file is used to list changes made in each version of the hostsfile cookbook.
## v3.0.1 (2017-08-22)
- Add TESTING.md and CONTRIBUTING.md files
- Fix the readme to properly specify Chef 12.7+ as the Chef requirement
- Add a local delivery configuration and remove the existing rakefile
- Resolve _most_ of the ChefSpec failures
## v3.0.0 (2017-08-22)
- Converted the LWRP to a custom resource which increases the required Chef release to 12.7
- Namespaced the helper libraries under the HostsFile module to prevent method collisions with other resources or the chef-client itself
## v2.4.6 (2017-08-15)
- use openssl for FIPS compatibility
- Expand priority documentation in README
- Add ::1 loopback to test cases and priority settings
## v2.4.5 (2014-06-24)
v2.4.5 (2014-06-24)
-------------------
- Fix notifications and why-run mode
## v2.4.4 (2014-02-25)
v2.4.4 (2014-02-25)
-------------------
- Bump Berkshelf version
- Remove scope pieces from IPv6 addresses
v2.4.3 (2014-02-01)
-------------------
## v2.4.3 (2014-02-01)
- Package custom ChefSpec matchers
- Update testing harness
- Avoid using `Chef::Application.fatal!`
- Use Chef::Resource::File for atomic updates
## v2.4.2
v2.4.2
------
- Fix Travis CI integration
- Remove newline characters
- Allow specifying a custom hostsfile path
## v2.4.1
v2.4.1
------
- Force a new upload to the community site
## v2.4.0
v2.4.0
------
- Convert everything to Ruby 1.9 syntax because I'm tired of people removing trailing commas despite the **massive** warning in the README: ([#29](https://github.com/customink-webops/hostsfile/issues/29), [#30](https://github.com/customink-webops/hostsfile/issues/30), [#32](https://github.com/customink-webops/hostsfile/issues/32), [#33](https://github.com/customink-webops/hostsfile/issues/33), [#34](https://github.com/customink-webops/hostsfile/issues/34), [#35](https://github.com/customink-webops/hostsfile/issues/35), [#36](https://github.com/customink-webops/hostsfile/issues/36), [#38](https://github.com/customink-webops/hostsfile/issues/38), [#39](https://github.com/customink-webops/hostsfile/issues/39))
- Update to the latest and greatest testing gems and practices
- Remove strainer in favor of a purer solution
@@ -44,30 +55,30 @@ v2.4.0
- Add more platforms to the `.kitchen.yml`
- Use `converge_by` and support whyruny mode
v2.0.0
------
## v2.0.0
- Completely manage the hostsfile, ensuring no duplicate entries
v1.0.2
------
## v1.0.2
- Support Windows (thanks @igantt-daptiv)
- Specs + Travis support
- Throw fatal error if hostsfile does not exist (@jkerzner)
- Write priorities in hostsfile so they are read on subsequent Chef runs
v0.2.0
------
## v0.2.0
- Updated README to require Ruby 1.9
- Allow hypens in hostnames
- Ensure newline at end of file
- Allow priority ordering in hostsfile
v0.1.1
------
## v0.1.1
- Fixed issue #1
- Better unique object filtering
- Better handing of aliases
v0.1.0
------
## v0.1.0
- Initial release

View File

@@ -0,0 +1,6 @@
# Contributing
1. Fork the project
2. Create a feature branch corresponding to you change
3. Commit and test thoroughly
4. Create a Pull Request on GitHub

View File

@@ -1,71 +1,31 @@
hostsfile LWRP
==============
[![Build Status](https://travis-ci.org/customink-webops/hostsfile.png?branch=master)](https://travis-ci.org/customink-webops/hostsfile)
# hostsfile cookbook
`hostsfile` provides an LWRP for managing your `/etc/hosts` (or Windows equivalent) file using Chef.
[![Build Status](https://travis-ci.org/customink-webops/hostsfile.svg?branch=master)](https://travis-ci.org/customink-webops/hostsfile)
`hostsfile` provides a resource for managing your `/etc/hosts` (or Windows equivalent) file using Chef.
Requirements
------------
- Chef 11 or higher
- **Ruby 1.9.3 or higher**
## Requirements
**Please stop opening Pull Requests to restore Ruby 1.8 support!** Any of the `1.x.y` series of this cookbook will work with Chef 10 and Ruby 1.8. You can use Opscode's [Omnibus installer](http://www.opscode.com/blog/2012/06/29/omnibus-chef-packaging/) to install Ruby 1.9+ and Seth Chisamore's [Vagrant Omnibus plugin](https://github.com/schisamo/vagrant-omnibus) to get Ruby 1.9+ on your Vagrant box.
- Chef 12.7 or higher
## Attributes
Attributes
----------
<table>
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Example</th>
<th>Default</th>
</tr>
<tr>
<td>ip_address</td>
<td>(name attribute) the IP address for the entry</td>
<td><tt>1.2.3.4</tt></td>
<td></td>
</tr>
<tr>
<td>hostname</td>
<td>(required) the hostname associated with the entry</td>
<td><tt>example.com</tt></td>
<td></td>
</tr>
<tr>
<td>unique</td>
<td>remove any existing entries that have the same <tt>hostname</tt></td>
<td><tt>true</tt></td>
<td><tt>false</tt></td>
</tr>
<tr>
<td>aliases</td>
<td>array of aliases for the entry</td>
<td><tt>['www.example.com']</tt></td>
<td><tt>[]</tt></td>
</tr>
<tr>
<td>comment</td>
<td>a comment to append to the end of the entry</td>
<td><tt>'interal DNS server'</tt></td>
<td><tt>nil</tt></td>
</tr>
<tr>
<td>priority</td>
<td>the relative position of this entry</td>
<td><tt>20</tt></td>
<td>(varies, see **Priorities** section)</td>
</tr>
</table>
Attribute | Description | Example | Default
---------- | ------------------------------------------------------- | -------------------- | ------------------------------------
ip_address | (name attribute) the IP address for the entry | 1.2.3.4 |
hostname | (required) the hostname associated with the entry | example.com |
unique | remove any existing entries that have the same hostname | true | false
aliases | array of aliases for the entry | ['www.example.com'] | []
comment | a comment to append to the end of the entry | 'interal DNS server' | nil
priority | the relative position of this entry | 20 | (varies, see **Priorities** section)
## Actions
Actions
-------
**Please note**: In `v0.1.2`, specifying a hostname or alias that existed in another automatically removed that hostname from the other entry before. In `v2.1.0`, the `unique` option was added to give the user case-by-case control of this behavior. For example, given an `/etc/hosts` file that contains:
1.2.3.4 example.com www.example.com
```
1.2.3.4 example.com www.example.com
```
when the Chef recipe below is converged:
@@ -78,12 +38,15 @@ end
then the `/etc/hosts` file will look like this:
1.2.3.4 example.com
2.3.4.5 www.example.com
```
1.2.3.4 example.com
2.3.4.5 www.example.com
```
Not specifying the `unique` parameter will result in duplicate hostsfile entries.
#### `create`
### `create`
Creates a new hosts file entry. If an entry already exists, it will be overwritten by this one.
```ruby
@@ -95,9 +58,12 @@ end
This will create an entry like this:
1.2.3.4 example.com
```
1.2.3.4 example.com
```
### `create_if_missing`
#### `create_if_missing`
Create a new hosts file entry, only if one does not already exist for the given IP address. If one exists, this does nothing.
```ruby
@@ -107,10 +73,13 @@ hostsfile_entry '1.2.3.4' do
end
```
#### `append`
### `append`
Append a hostname or alias to an existing record. If the given IP address doesn't already exist in the hostsfile, this method behaves the same as create. Otherwise, it will append the additional hostname and aliases to the existing entry.
1.2.3.4 example.com www.example.com # Created by Chef
```
1.2.3.4 example.com www.example.com # Created by Chef
```
```ruby
hostsfile_entry '1.2.3.4' do
@@ -123,10 +92,12 @@ end
would yield:
1.2.3.4 example.com www.example.com www2.example.com foo.com foobar.com # Created by Chef, Appended by Recipe X
```
1.2.3.4 example.com www.example.com www2.example.com foo.com foobar.com # Created by Chef, Appended by Recipe X
```
### `update`
#### `update`
Updates the given hosts file entry. Does nothing if the entry does not exist.
```ruby
@@ -139,11 +110,13 @@ end
This will create an entry like this:
1.2.3.4 example # Updated by Chef
```
1.2.3.4 example # Updated by Chef
```
#### `remove`
Removes an entry from the hosts file. Does nothing if the entry does not
exist.
### `remove`
Removes an entry from the hosts file. Does nothing if the entry does not exist.
```ruby
hostsfile_entry '1.2.3.4' do
@@ -153,9 +126,8 @@ end
This will remove the entry for `1.2.3.4`.
## Usage
Usage
-----
If you're using [Berkshelf](http://berkshelf.com/), just add `hostsfile` to your `Berksfile`:
```ruby
@@ -164,9 +136,11 @@ cookbook 'hostsfile'
Otherwise, install the cookbook from the community site:
knife cookbook site install hostsfile
```
knife cookbook site install hostsfile
```
Have any other cookbooks *depend* on hostsfile by editing editing the `metadata.rb` for your cookbook.
Have any other cookbooks _depend_ on hostsfile by editing editing the `metadata.rb` for your cookbook.
```ruby
# metadata.rb
@@ -176,7 +150,8 @@ depends 'hostsfile'
Note that you can specify a custom path to your hosts file in the `['hostsfile']['path']` node attribute. Otherwise, it defaults to sensible paths depending on your OS.
### Testing
If you are using [ChefSpec](https://github.com/sethvargo/chefspec) to unit test a cookbook that implements the `hostsfile_entry` LWRP, this cookbook packages customer matchers that you can use in your unit tests:
If you are using [ChefSpec](https://github.com/sethvargo/chefspec) to unit test a cookbook that implements the `hostsfile_entry` resource, this cookbook packages customer matchers that you can use in your unit tests:
- `append_hostsfile_entry`
- `create_hostsfile_entry`
@@ -193,27 +168,21 @@ it 'creates a hostsfile entry for the DNS server' do
end
```
Priority
--------
## Priority
Priority is a relatively new addition to the cookbook. It gives you the ability to (somewhat) specify the relative order of entries. By default, the priority is calculated for you as follows:
1. Local, loopback
2. IPV4
3. IPV6
82. 127.0.0.1
81. ::1
80. 127.0.0.0/8
60. IPV4
20. IPV6
00. default
However, you can override it using the `priority` option.
## License & Authors
Contributing
------------
1. Fork the project
2. Create a feature branch corresponding to you change
3. Commit and test thoroughly
4. Create a Pull Request on github
License & Authors
-----------------
- Author:: Seth Vargo (sethvargo@gmail.com)
```text

View File

@@ -3,8 +3,8 @@
# Cookbook:: hostsfile
# Attribute:: default
#
# Copyright 2012-2013, Seth Vargo
# Copyright 2012, CustomInk, LCC
# Copyright:: 2012-2013, Seth Vargo
# Copyright:: 2012, CustomInk, LCC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -3,8 +3,8 @@
# Cookbook:: hostsfile
# Library:: entry
#
# Copyright 2012-2013, Seth Vargo
# Copyright 2012, CustomInk, LCC
# Copyright:: 2012-2013, Seth Vargo
# Copyright:: 2012, CustomInk, LCC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -24,160 +24,163 @@ require 'ipaddr'
# An object representation of a single line in a hostsfile.
#
# @author Seth Vargo <sethvargo@gmail.com>
class Entry
class << self
# Creates a new Hostsfile::Entry object by parsing a text line. The
# `line` attribute will be in the following format:
#
# 1.2.3.4 hostname [alias[, alias[, alias]]] [# comment [@priority]]
#
# @param [String] line
# the line to parse
# @return [Entry]
# a new entry object
def parse(line)
entry, comment = extract_comment(line)
comment, priority = extract_priority(comment)
entries = extract_entries(entry)
module HostsFile
class Entry
class << self
# Creates a new Hostsfile::Entry object by parsing a text line. The
# `line` attribute will be in the following format:
#
# 1.2.3.4 hostname [alias[, alias[, alias]]] [# comment [@priority]]
#
# @param [String] line
# the line to parse
# @return [Entry]
# a new entry object
def parse(line)
entry, comment = extract_comment(line)
comment, priority = extract_priority(comment)
entries = extract_entries(entry)
# Return nil if the line is empty
return nil if entries.nil? || entries.empty?
# Return nil if the line is empty
return nil if entries.nil? || entries.empty?
# If /etc/hosts has a broken content we throw a descriptive exception
if entries[0].nil?
raise ArgumentError, "/etc/hosts has a line without IP address: #{line}"
end
if entries[1].nil?
raise ArgumentError, "/etc/hosts has a line without hostname: #{line}"
# If /etc/hosts has a broken content we throw a descriptive exception
if entries[0].nil?
raise ArgumentError, "/etc/hosts has a line without IP address: #{line}"
end
if entries[1].nil?
raise ArgumentError, "/etc/hosts has a line without hostname: #{line}"
end
new(
ip_address: entries[0],
hostname: entries[1],
aliases: entries[2..-1],
comment: comment,
priority: priority
)
end
return self.new(
ip_address: entries[0],
hostname: entries[1],
aliases: entries[2..-1],
comment: comment,
priority: priority,
)
private
def extract_comment(line)
return nil if presence(line).nil?
line.split('#', 2).collect { |part| presence(part) }
end
def extract_priority(comment)
return nil if comment.nil?
if comment.include?('@')
comment.split('@', 2).collect { |part| presence(part) }
else
[comment, nil]
end
end
def extract_entries(entry)
return nil if entry.nil?
entry.split(/\s+/).collect { |entry| presence(entry) }.compact
end
def presence(string)
return nil if string.nil?
return nil if string.strip.empty?
string.strip
end
end
# @return [String]
attr_accessor :ip_address, :hostname, :aliases, :comment, :priority
# Creates a new entry from the given options.
#
# @param [Hash] options
# a list of options to create the entry with
# @option options [String] :ip_address
# the IP Address for this entry
# @option options [String] :hostname
# the hostname for this entry
# @option options [String, Array<String>] :aliases
# a alias or array of aliases for this entry
# @option options[String] :comment
# an optional comment for this entry
# @option options [Integer] :priority
# the relative priority of this entry (compared to others)
#
# @raise [ArgumentError]
# if neither :ip_address nor :hostname are supplied
def initialize(options = {})
if options[:ip_address].nil? || options[:hostname].nil?
raise ArgumentError, ':ip_address and :hostname are both required options'
end
@ip_address = IPAddr.new(remove_ip_scope(options[:ip_address]))
@hostname = options[:hostname]
@aliases = [options[:aliases]].flatten.compact
@comment = options[:comment]
@priority = options[:priority] || calculated_priority
end
# Set a the new priority for an entry.
#
# @param [Integer] new_priority
# the new priority to set
def priority=(new_priority)
@calculated_priority = false
@priority = new_priority
end
# The line representation of this entry.
#
# @return [String]
# the string representation of this entry
def to_line
hosts = [hostname, aliases].flatten.join(' ')
comments = "# #{comment}".strip
comments << " @#{priority}" unless priority.nil? || @calculated_priority
comments = comments.strip
comments = nil if comments == '#'
[ip_address, hosts, comments].compact.join("\t").strip
end
# Returns true if priority is calculated
#
# @return [Boolean]
# true if priority is calculated and false otherwise
def calculated_priority?
@calculated_priority
end
private
def extract_comment(line)
return nil if presence(line).nil?
line.split('#', 2).collect { |part| presence(part) }
# Calculates the relative priority of this entry.
#
# @return [Integer]
# the relative priority of this item
def calculated_priority
@calculated_priority = true
return 82 if ip_address == IPAddr.new('127.0.0.1')
return 81 if ip_address == IPAddr.new('::1')
return 80 if IPAddr.new('127.0.0.0/8').include?(ip_address) # local
return 60 if ip_address.ipv4? # ipv4
return 20 if ip_address.ipv6? # ipv6
00
end
def extract_priority(comment)
return nil if comment.nil?
if comment.include?('@')
comment.split('@', 2).collect { |part| presence(part) }
else
[comment, nil]
end
# Removes the scopes pieces of the address, because reasons.
#
# @see https://bugs.ruby-lang.org/issues/8464
# @see https://github.com/customink-webops/hostsfile/issues/51
#
# @return [String, nil]
#
def remove_ip_scope(address)
return nil if address.nil?
address.to_s.sub(/%.*/, '')
end
def extract_entries(entry)
return nil if entry.nil?
entry.split(/\s+/).collect { |entry| presence(entry) }.compact
end
def presence(string)
return nil if string.nil?
return nil if string.strip.empty?
string.strip
end
end
# @return [String]
attr_accessor :ip_address, :hostname, :aliases, :comment, :priority
# Creates a new entry from the given options.
#
# @param [Hash] options
# a list of options to create the entry with
# @option options [String] :ip_address
# the IP Address for this entry
# @option options [String] :hostname
# the hostname for this entry
# @option options [String, Array<String>] :aliases
# a alias or array of aliases for this entry
# @option options[String] :comment
# an optional comment for this entry
# @option options [Fixnum] :priority
# the relative priority of this entry (compared to others)
#
# @raise [ArgumentError]
# if neither :ip_address nor :hostname are supplied
def initialize(options = {})
if options[:ip_address].nil? || options[:hostname].nil?
raise ArgumentError, ':ip_address and :hostname are both required options'
end
@ip_address = IPAddr.new(remove_ip_scope(options[:ip_address]))
@hostname = options[:hostname]
@aliases = [options[:aliases]].flatten.compact
@comment = options[:comment]
@priority = options[:priority] || calculated_priority
end
# Set a the new priority for an entry.
#
# @param [Fixnum] new_priority
# the new priority to set
def priority=(new_priority)
@calculated_priority = false
@priority = new_priority
end
# The line representation of this entry.
#
# @return [String]
# the string representation of this entry
def to_line
hosts = [hostname, aliases].flatten.join(' ')
comments = "# #{comment.to_s}".strip
comments << " @#{priority}" unless priority.nil? || @calculated_priority
comments = comments.strip
comments = nil if comments == '#'
[ip_address, hosts, comments].compact.join("\t").strip
end
# Returns true if priority is calculated
#
# @return [Boolean]
# true if priority is calculated and false otherwise
def calculated_priority?
@calculated_priority
end
private
# Calculates the relative priority of this entry.
#
# @return [Fixnum]
# the relative priority of this item
def calculated_priority
@calculated_priority = true
return 81 if ip_address == IPAddr.new('127.0.0.1')
return 80 if IPAddr.new('127.0.0.0/8').include?(ip_address) # local
return 60 if ip_address.ipv4? # ipv4
return 20 if ip_address.ipv6? # ipv6
return 00
end
# Removes the scopes pieces of the address, because reasons.
#
# @see https://bugs.ruby-lang.org/issues/8464
# @see https://github.com/customink-webops/hostsfile/issues/51
#
# @return [String, nil]
#
def remove_ip_scope(address)
return nil if address.nil?
address.to_s.sub(/%.*/, '')
end
end

View File

@@ -3,8 +3,8 @@
# Cookbook:: hostsfile
# Library:: manipulator
#
# Copyright 2012-2013, Seth Vargo
# Copyright 2012, CustomInk, LCC
# Copyright:: 2012-2013, Seth Vargo
# Copyright:: 2012, CustomInk, LCC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -20,274 +20,283 @@
#
require 'chef/application'
require 'digest/sha2'
require 'openssl'
class Manipulator
attr_reader :node
attr_reader :entries
module HostsFile
class Manipulator
attr_reader :node
attr_reader :entries
# Create a new Manipulator object (aka an /etc/hosts manipulator). If a
# hostsfile is not found, an exception is raised.
#
# @param [Chef::node] node
# the current Chef node
# @return [Manipulator]
# a class designed to manipulate the node's /etc/hosts file
def initialize(node)
@node = node
# Create a new Manipulator object (aka an /etc/hosts manipulator). If a
# hostsfile is not found, an exception is raised.
#
# @param [Chef::node] node
# the current Chef node
# @return [Manipulator]
# a class designed to manipulate the node's /etc/hosts file
def initialize(node)
@node = node
# Fail if no hostsfile is found
unless ::File.exists?(hostsfile_path)
raise RuntimeError, "No hostsfile exists at `#{hostsfile_path}'!"
end
@entries = []
collect_and_flatten(::File.readlines(hostsfile_path))
end
# Return a list of all IP Addresses for this hostsfile.
#
# @return [Array<IPAddr>]
# the list of IP Addresses
def ip_addresses
@entries.collect do |entry|
entry.ip_address
end.compact || []
end
# Add a new record to the hostsfile.
#
# @param [Hash] options
# a list of options to create the entry with
# @option options [String] :ip_address
# the IP Address for this entry
# @option options [String] :hostname
# the hostname for this entry
# @option options [String, Array<String>] :aliases
# a alias or array of aliases for this entry
# @option options[String] :comment
# an optional comment for this entry
# @option options [Fixnum] :priority
# the relative priority of this entry (compared to others)
def add(options = {})
entry = Entry.new(
ip_address: options[:ip_address],
hostname: options[:hostname],
aliases: options[:aliases],
comment: options[:comment],
priority: options[:priority],
)
@entries << entry
remove_existing_hostnames(entry) if options[:unique]
end
# Update an existing entry. This method will do nothing if the entry
# does not exist.
#
# @param (see #add)
def update(options = {})
if entry = find_entry_by_ip_address(options[:ip_address])
entry.hostname = options[:hostname]
entry.aliases = options[:aliases]
entry.comment = options[:comment]
entry.priority = options[:priority]
remove_existing_hostnames(entry) if options[:unique]
end
end
# Append content to an existing entry. This method will add a new entry
# if one does not already exist.
#
# @param (see #add)
def append(options = {})
if entry = find_entry_by_ip_address(options[:ip_address])
hosts = normalize(entry.hostname, entry.aliases, options[:hostname], options[:aliases])
entry.hostname = hosts.shift
entry.aliases = hosts
unless entry.comment && options[:comment] && entry.comment.include?(options[:comment])
entry.comment = normalize(entry.comment, options[:comment]).join(', ')
# Fail if no hostsfile is found
unless ::File.exist?(hostsfile_path)
raise "No hostsfile exists at `#{hostsfile_path}'!"
end
remove_existing_hostnames(entry) if options[:unique]
else
add(options)
@entries = []
collect_and_flatten(::File.readlines(hostsfile_path))
end
end
# Remove an entry by it's IP Address
#
# @param [String] ip_address
# the IP Address of the entry to remove
def remove(ip_address)
if entry = find_entry_by_ip_address(ip_address)
@entries.delete(entry)
# Return a list of all IP Addresses for this hostsfile.
#
# @return [Array<IPAddr>]
# the list of IP Addresses
def ip_addresses
@entries.collect(&:ip_address).compact || []
end
end
# Save the new hostsfile to the target machine. This method will only write the
# hostsfile if the current version has changed. In other words, it is convergent.
def save
file = Chef::Resource::File.new(hostsfile_path, node.run_context)
file.content(new_content)
file.run_action(:create)
end
# Determine if the content of the hostfile has changed by comparing sha
# values of existing file and new content
#
# @return [Boolean]
def content_changed?
new_sha = Digest::SHA512.hexdigest(new_content)
new_sha != current_sha
end
# Find an entry by the given IP Address.
#
# @param [String] ip_address
# the IP Address of the entry to find
# @return [Entry, nil]
# the corresponding entry object, or nil if it does not exist
def find_entry_by_ip_address(ip_address)
@entries.find do |entry|
!entry.ip_address.nil? && entry.ip_address == ip_address
end
end
# Determine if the current hostsfile contains the given resource. This
# is really just a proxy to {find_resource_by_ip_address} /
#
# @param [Chef::Resource] resource
#
# @return [Boolean]
def contains?(resource)
!!find_entry_by_ip_address(resource.ip_address)
end
private
# The path to the current hostsfile.
#
# @return [String]
# the full path to the hostsfile, depending on the operating system
# can also be overriden in the node attributes
def hostsfile_path
return @hostsfile_path if @hostsfile_path
@hostsfile_path = node['hostsfile']['path'] || case node['platform_family']
when 'windows'
"#{node['kernel']['os_info']['system_directory']}\\drivers\\etc\\hosts"
else
'/etc/hosts'
end
end
# The header of the new hostsfile
#
# @return [Array]
# an array of header comments
def hostsfile_header
lines = []
lines << '#'
lines << '# This file is managed by Chef, using the hostsfile cookbook.'
lines << '# Editing this file by hand is highly discouraged!'
lines << '#'
lines << '# Comments containing an @ sign should not be modified or else'
lines << '# hostsfile will be unable to guarantee relative priority in'
lines << '# future Chef runs!'
lines << '#'
lines << ''
end
# The content that will be written to the hostfile
#
# @return [String]
# the full contents of the hostfile to be written
def new_content
entries = hostsfile_header
entries += unique_entries.map(&:to_line)
entries << ''
entries.join("\n")
end
# The current sha of the system hostsfile.
#
# @return [String]
# the sha of the current hostsfile
def current_sha
@current_sha ||= Digest::SHA512.hexdigest(File.read(hostsfile_path))
end
# Normalize the given list of elements into a single array with no nil
# values and no duplicate values.
#
# @param [Object] things
#
# @return [Array]
# a normalized array of things
def normalize(*things)
things.flatten.compact.uniq
end
# This is a crazy way of ensuring unique objects in an array using a Hash.
#
# @return [Array]
# the sorted list of entires that are unique
def unique_entries
entries = Hash[*@entries.map { |entry| [entry.ip_address, entry] }.flatten].values
entries.sort_by { |e| [-e.priority.to_i, e.hostname.to_s] }
end
# Takes /etc/hosts file contents and builds a flattened entries
# array so that each IP address has only one line and multiple hostnames
# are flattened into a list of aliases.
#
# @param [Array] contents
# Array of lines from /etc/hosts file
def collect_and_flatten(contents)
contents.each do |line|
entry = Entry.parse(line)
next if entry.nil?
append(
ip_address: entry.ip_address,
hostname: entry.hostname,
aliases: entry.aliases,
comment: entry.comment,
priority: !entry.calculated_priority? && entry.priority,
# Add a new record to the hostsfile.
#
# @param [Hash] options
# a list of options to create the entry with
# @option options [String] :ip_address
# the IP Address for this entry
# @option options [String] :hostname
# the hostname for this entry
# @option options [String, Array<String>] :aliases
# a alias or array of aliases for this entry
# @option options[String] :comment
# an optional comment for this entry
# @option options [Integer] :priority
# the relative priority of this entry (compared to others)
def add(options = {})
entry = HostsFile::Entry.new(
ip_address: options[:ip_address],
hostname: options[:hostname],
aliases: options[:aliases],
comment: options[:comment],
priority: options[:priority]
)
@entries << entry
remove_existing_hostnames(entry) if options[:unique]
end
end
# Removes duplicate hostnames in other files ensuring they are unique
#
# @param [Entry] entry
# the entry to keep the hostname and aliases from
#
# @return [nil]
def remove_existing_hostnames(entry)
@entries.delete(entry)
changed_hostnames = [entry.hostname, entry.aliases].flatten.uniq
# Update an existing entry. This method will do nothing if the entry
# does not exist.
#
# @param (see #add)
def update(options = {})
if entry = find_entry_by_ip_address(options[:ip_address])
entry.hostname = options[:hostname]
entry.aliases = options[:aliases]
entry.comment = options[:comment]
entry.priority = options[:priority]
@entries = @entries.collect do |entry|
entry.hostname = nil if changed_hostnames.include?(entry.hostname)
entry.aliases = entry.aliases - changed_hostnames
remove_existing_hostnames(entry) if options[:unique]
end
end
if entry.hostname.nil?
if entry.aliases.empty?
nil
# Append content to an existing entry. This method will add a new entry
# if one does not already exist.
#
# @param (see #add)
def append(options = {})
if entry = find_entry_by_ip_address(options[:ip_address])
hosts = normalize(entry.hostname, entry.aliases, options[:hostname], options[:aliases])
entry.hostname = hosts.shift
entry.aliases = hosts
unless entry.comment && options[:comment] && entry.comment.include?(options[:comment])
entry.comment = normalize(entry.comment, options[:comment]).join(', ')
end
remove_existing_hostnames(entry) if options[:unique]
else
add(options)
end
end
# Remove an entry by it's IP Address
#
# @param [String] ip_address
# the IP Address of the entry to remove
def remove(ip_address)
if entry = find_entry_by_ip_address(ip_address)
@entries.delete(entry)
end
end
# Save the new hostsfile to the target machine. This method will only write the
# hostsfile if the current version has changed. In other words, it is convergent.
def save
file = Chef::Resource::File.new(hostsfile_path, node.run_context)
file.content(new_content)
file.atomic_update false if docker_guest?
file.run_action(:create)
end
# Determine if the content of the hostfile has changed by comparing sha
# values of existing file and new content
#
# @return [Boolean]
def content_changed?
new_sha = OpenSSL::Digest::SHA512.hexdigest(new_content)
new_sha != current_sha
end
# Find an entry by the given IP Address.
#
# @param [String] ip_address
# the IP Address of the entry to find
# @return [Entry, nil]
# the corresponding entry object, or nil if it does not exist
def find_entry_by_ip_address(ip_address)
@entries.find do |entry|
!entry.ip_address.nil? && entry.ip_address == ip_address
end
end
# Determine if the current hostsfile contains the given resource. This
# is really just a proxy to {find_resource_by_ip_address} /
#
# @param [Chef::Resource] resource
#
# @return [Boolean]
def contains?(resource)
!!find_entry_by_ip_address(resource.ip_address)
end
private
# Determine if we are running inside a Docker container
#
# @return [Boolean]
def docker_guest?
node['virtualization'] && node['virtualization']['systems'] &&
node['virtualization']['systems']['docker'] && node['virtualization']['systems']['docker'] == 'guest'
end
# The path to the current hostsfile.
#
# @return [String]
# the full path to the hostsfile, depending on the operating system
# can also be overriden in the node attributes
def hostsfile_path
return @hostsfile_path if @hostsfile_path
@hostsfile_path = node['hostsfile']['path'] || case node['platform_family']
when 'windows'
"#{node['kernel']['os_info']['system_directory']}\\drivers\\etc\\hosts"
else
'/etc/hosts'
end
end
# The header of the new hostsfile
#
# @return [Array]
# an array of header comments
def hostsfile_header
lines = []
lines << '#'
lines << '# This file is managed by Chef, using the hostsfile cookbook.'
lines << '# Editing this file by hand is highly discouraged!'
lines << '#'
lines << '# Comments containing an @ sign should not be modified or else'
lines << '# hostsfile will be unable to guarantee relative priority in'
lines << '# future Chef runs!'
lines << '#'
lines << ''
end
# The content that will be written to the hostfile
#
# @return [String]
# the full contents of the hostfile to be written
def new_content
entries = hostsfile_header
entries += unique_entries.map(&:to_line)
entries << ''
entries.join("\n")
end
# The current sha of the system hostsfile.
#
# @return [String]
# the sha of the current hostsfile
def current_sha
@current_sha ||= OpenSSL::Digest::SHA512.hexdigest(File.read(hostsfile_path))
end
# Normalize the given list of elements into a single array with no nil
# values and no duplicate values.
#
# @param [Object] things
#
# @return [Array]
# a normalized array of things
def normalize(*things)
things.flatten.compact.uniq
end
# This is a crazy way of ensuring unique objects in an array using a Hash.
#
# @return [Array]
# the sorted list of entires that are unique
def unique_entries
entries = Hash[*@entries.map { |entry| [entry.ip_address, entry] }.flatten].values
entries.sort_by { |e| [-e.priority.to_i, e.hostname.to_s] }
end
# Takes /etc/hosts file contents and builds a flattened entries
# array so that each IP address has only one line and multiple hostnames
# are flattened into a list of aliases.
#
# @param [Array] contents
# Array of lines from /etc/hosts file
def collect_and_flatten(contents)
contents.each do |line|
entry = HostsFile::Entry.parse(line)
next if entry.nil?
append(
ip_address: entry.ip_address,
hostname: entry.hostname,
aliases: entry.aliases,
comment: entry.comment,
priority: !entry.calculated_priority? && entry.priority
)
end
end
# Removes duplicate hostnames in other files ensuring they are unique
#
# @param [Entry] entry
# the entry to keep the hostname and aliases from
#
# @return [nil]
def remove_existing_hostnames(entry)
@entries.delete(entry)
changed_hostnames = [entry.hostname, entry.aliases].flatten.uniq
@entries = @entries.collect do |entry|
entry.hostname = nil if changed_hostnames.include?(entry.hostname)
entry.aliases = entry.aliases - changed_hostnames
if entry.hostname.nil?
if entry.aliases.empty?
nil
else
entry.hostname = entry.aliases.shift
entry
end
else
entry.hostname = entry.aliases.shift
entry
end
else
entry
end
end.compact
end.compact
@entries << entry
@entries << entry
nil
nil
end
end
end

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +0,0 @@
name 'hostsfile'
maintainer 'Seth Vargo'
maintainer_email 'sethvargo@gmail.com'
license 'Apache 2.0'
description 'Provides an LWRP for managing the /etc/hosts file'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '2.4.5'

View File

@@ -1,138 +0,0 @@
#
# Author:: Seth Vargo <sethvargo@gmail.com>
# Cookbook:: hostsfile
# Provider:: entry
#
# Copyright 2012-2013, Seth Vargo
# Copyright 2012, CustomInk, LCC
#
# 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.
#
# Support whyrun
def whyrun_supported?
true
end
# Creates a new hosts file entry. If an entry already exists, it will be
# overwritten by this one.
action :create do
if hostsfile.contains?(new_resource)
Chef::Log.debug "#{new_resource} already exists - overwriting."
end
hostsfile.add(
ip_address: new_resource.ip_address,
hostname: new_resource.hostname,
aliases: new_resource.aliases,
comment: new_resource.comment,
priority: new_resource.priority,
unique: new_resource.unique,
)
if hostsfile.content_changed?
converge_by("Create #{new_resource}") { hostsfile.save }
else
Chef::Log.info "#{new_resource} content already matches - nothing to do."
end
end
# Create a new hosts file entry, only if one does not already exist for
# the given IP address. If one exists, this does nothing.
action :create_if_missing do
if hostsfile.contains?(new_resource)
Chef::Log.info "#{new_resource} already exists - skipping create_if_missing."
else
converge_by("Create #{new_resource} if missing") do
hostsfile.add(
ip_address: new_resource.ip_address,
hostname: new_resource.hostname,
aliases: new_resource.aliases,
comment: new_resource.comment,
priority: new_resource.priority,
unique: new_resource.unique,
)
hostsfile.save
end
end
end
# Appends the given data to an existing entry. If an entry does not exist,
# one will be created
action :append do
unless hostsfile.contains?(new_resource)
Chef::Log.info "#{new_resource} does not exist - creating instead."
end
hostsfile.append(
ip_address: new_resource.ip_address,
hostname: new_resource.hostname,
aliases: new_resource.aliases,
comment: new_resource.comment,
priority: new_resource.priority,
unique: new_resource.unique,
)
if hostsfile.content_changed?
converge_by("Append #{new_resource}") { hostsfile.save }
else
Chef::Log.info "#{new_resource} content already matches - nothing to do."
end
end
# Updates the given hosts file entry. Does nothing if the entry does not
# exist.
action :update do
if hostsfile.contains?(new_resource)
hostsfile.update(
ip_address: new_resource.ip_address,
hostname: new_resource.hostname,
aliases: new_resource.aliases,
comment: new_resource.comment,
priority: new_resource.priority,
unique: new_resource.unique,
)
if hostsfile.content_changed?
converge_by("Update #{new_resource}") { hostsfile.save }
else
Chef::Log.info "#{new_resource} content already matches - nothing to do."
end
else
Chef::Log.info "#{new_resource} does not exist - skipping update."
end
end
# Removes an entry from the hosts file. Does nothing if the entry does
# not exist.
action :remove do
if hostsfile.contains?(new_resource)
converge_by("Remove #{new_resource}") do
hostsfile.remove(new_resource.ip_address)
hostsfile.save
end
else
Chef::Log.info "#{new_resource} does not exist - skipping remove."
end
end
private
# The hostsfile object
#
# @return [Manipulator]
# the manipulator for this hostsfile
def hostsfile
@hostsfile ||= Manipulator.new(node)
end

View File

@@ -3,8 +3,8 @@
# Cookbook:: hostsfile
# Resource:: entry
#
# Copyright 2012-2013, Seth Vargo
# Copyright 2012, CustomInk, LCC
# Copyright:: 2012-2013, Seth Vargo
# Copyright:: 2012, CustomInk, LCC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,18 +19,125 @@
# limitations under the License.
#
# List of all actions supported by the provider
actions :create, :create_if_missing, :append, :update, :remove
# Make create the default action
default_action :create
# Required attributes
attribute :ip_address, kind_of: String, name_attribute: true
attribute :hostname, kind_of: String
property :ip_address, String, name_property: true
property :hostname, String
# Optional attributes
attribute :aliases, kind_of: Array
attribute :comment, kind_of: String
attribute :priority, kind_of: Fixnum
attribute :unique, kind_of: [TrueClass, FalseClass]
property :aliases, Array
property :comment, String
property :priority, Integer
property :unique, [TrueClass, FalseClass]
# Creates a new hosts file entry. If an entry already exists, it will be
# overwritten by this one.
action :create do
if hostsfile.contains?(new_resource)
Chef::Log.debug "#{new_resource} already exists - overwriting."
end
hostsfile.add(
ip_address: new_resource.ip_address,
hostname: new_resource.hostname,
aliases: new_resource.aliases,
comment: new_resource.comment,
priority: new_resource.priority,
unique: new_resource.unique
)
if hostsfile.content_changed?
converge_by("Create #{new_resource}") { hostsfile.save }
else
Chef::Log.info "#{new_resource} content already matches - nothing to do."
end
end
# Create a new hosts file entry, only if one does not already exist for
# the given IP address. If one exists, this does nothing.
action :create_if_missing do
if hostsfile.contains?(new_resource)
Chef::Log.info "#{new_resource} already exists - skipping create_if_missing."
else
converge_by("Create #{new_resource} if missing") do
hostsfile.add(
ip_address: new_resource.ip_address,
hostname: new_resource.hostname,
aliases: new_resource.aliases,
comment: new_resource.comment,
priority: new_resource.priority,
unique: new_resource.unique
)
hostsfile.save
end
end
end
# Appends the given data to an existing entry. If an entry does not exist,
# one will be created
action :append do
unless hostsfile.contains?(new_resource)
Chef::Log.info "#{new_resource} does not exist - creating instead."
end
hostsfile.append(
ip_address: new_resource.ip_address,
hostname: new_resource.hostname,
aliases: new_resource.aliases,
comment: new_resource.comment,
priority: new_resource.priority,
unique: new_resource.unique
)
if hostsfile.content_changed?
converge_by("Append #{new_resource}") { hostsfile.save }
else
Chef::Log.info "#{new_resource} content already matches - nothing to do."
end
end
# Updates the given hosts file entry. Does nothing if the entry does not
# exist.
action :update do
if hostsfile.contains?(new_resource)
hostsfile.update(
ip_address: new_resource.ip_address,
hostname: new_resource.hostname,
aliases: new_resource.aliases,
comment: new_resource.comment,
priority: new_resource.priority,
unique: new_resource.unique
)
if hostsfile.content_changed?
converge_by("Update #{new_resource}") { hostsfile.save }
else
Chef::Log.info "#{new_resource} content already matches - nothing to do."
end
else
Chef::Log.info "#{new_resource} does not exist - skipping update."
end
end
# Removes an entry from the hosts file. Does nothing if the entry does
# not exist.
action :remove do
if hostsfile.contains?(new_resource)
converge_by("Remove #{new_resource}") do
hostsfile.remove(new_resource.ip_address)
hostsfile.save
end
else
Chef::Log.info "#{new_resource} does not exist - skipping remove."
end
end
action_class do
# The hostsfile object
#
# @return [Manipulator]
# the manipulator for this hostsfile
def hostsfile
@hostsfile ||= HostsFile::Manipulator.new(node)
end
end

View File

@@ -31,5 +31,6 @@
],
"gems": [
]
],
"eager_load_libraries": true
}

View File

@@ -32,5 +32,6 @@
],
"gems": [
]
],
"eager_load_libraries": true
}

View File

@@ -2,6 +2,19 @@
This file is used to list changes made in each version of the mingw cookbook.
## 2.1.3 - *2021-08-31*
- Standardise files with files in sous-chefs/repo-management
## 2.1.1 (2020-06-02)
- Resolve cookstyle 5.8 warnings - [@tas50](https://github.com/tas50)
- Require Chef 12.15+ - [@tas50](https://github.com/tas50)
- Fix compatibility with Chef Infra Client 16 - [@xorimabot](https://github.com/xorimabot)
- resolved cookstyle error: resources/get.rb:26:1 warning: `ChefDeprecations/ResourceUsesOnlyResourceName`
- resolved cookstyle error: resources/msys2_package.rb:31:1 warning: `ChefDeprecations/ResourceUsesOnlyResourceName`
- resolved cookstyle error: resources/tdm_gcc.rb:26:1 warning: `ChefDeprecations/ResourceUsesOnlyResourceName`
## 2.1.0 (2018-07-24)
- refactor msys2 package source and checksum to attributes

View File

@@ -1,2 +0,0 @@
Please refer to
https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD

202
cookbooks/mingw/LICENSE Normal file
View File

@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
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.

View File

@@ -12,7 +12,7 @@ Installs a mingw/msys based compiler tools chain on windows. This is required fo
### Chef
- Chef 12.5+
- Chef 12.15+
### Cookbooks

115
cookbooks/mingw/chefignore Normal file
View File

@@ -0,0 +1,115 @@
# Put files/directories that should be ignored in this file when uploading
# to a Chef Infra Server or Supermarket.
# Lines that start with '# ' are comments.
# OS generated files #
######################
.DS_Store
ehthumbs.db
Icon?
nohup.out
Thumbs.db
.envrc
# EDITORS #
###########
.#*
.project
.settings
*_flymake
*_flymake.*
*.bak
*.sw[a-z]
*.tmproj
*~
\#*
REVISION
TAGS*
tmtags
.vscode
.editorconfig
## COMPILED ##
##############
*.class
*.com
*.dll
*.exe
*.o
*.pyc
*.so
*/rdoc/
a.out
mkmf.log
# Testing #
###########
.circleci/*
.codeclimate.yml
.delivery/*
.foodcritic
.kitchen*
.mdlrc
.overcommit.yml
.rspec
.rubocop.yml
.travis.yml
.watchr
.yamllint
azure-pipelines.yml
Dangerfile
examples/*
features/*
Guardfile
kitchen.yml*
mlc_config.json
Procfile
Rakefile
spec/*
test/*
# SCM #
#######
.git
.gitattributes
.gitconfig
.github/*
.gitignore
.gitkeep
.gitmodules
.svn
*/.bzr/*
*/.git
*/.hg/*
*/.svn/*
# Berkshelf #
#############
Berksfile
Berksfile.lock
cookbooks/*
tmp
# Bundler #
###########
vendor/*
Gemfile
Gemfile.lock
# Policyfile #
##############
Policyfile.rb
Policyfile.lock.json
# Documentation #
#############
CODE_OF_CONDUCT*
CONTRIBUTING*
documentation/*
TESTING*
UPGRADING*
# Vagrant #
###########
.vagrant
Vagrantfile

View File

@@ -2,7 +2,7 @@
# Cookbook:: mingw
# Library:: _helper
#
# Copyright:: 2016, Chef Software, Inc.
# Copyright:: 2016-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -35,4 +35,4 @@ module Mingw
end
end
Chef::Resource.send(:include, Mingw::Helper)
Chef::Resource.include Mingw::Helper

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,14 @@
name 'mingw'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache-2.0'
description 'Installs a mingw/msys based toolchain on windows'
version '2.1.3'
supports 'windows'
depends 'seven_zip'
source_url 'https://github.com/chef-cookbooks/mingw'
issues_url 'https://github.com/chef-cookbooks/mingw/issues'
chef_version '>= 12.15'

View File

@@ -2,7 +2,7 @@
# Cookbook:: mingw
# Recipe:: default
#
# Copyright:: 2016, Chef Software, Inc.
# Copyright:: 2016-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -2,7 +2,7 @@
# Cookbook:: mingw
# Resource:: get
#
# Copyright:: 2016, Chef Software, Inc.
# Copyright:: 2016-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -23,8 +23,6 @@
property :package, String, name_property: true
property :root, String, required: true
resource_name :mingw_get
action_class do
def mingw_do_action(action_cmd)
seven_zip_archive "fetching mingw-get to #{win_friendly_path(root)}" do

View File

@@ -2,7 +2,7 @@
# Cookbook:: mingw
# Resource:: msys2_package
#
# Copyright:: 2016, Chef Software, Inc.
# Copyright:: 2016-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,16 +19,16 @@
# Installs msys2 base system and installs/upgrades packages within in.
#
# Where's the version flag? Where's idempotence you say? Well f*** you
# for trying to version your product. This is arch. They live on the edge.
# You never get anything but the latest version. And if that's broken...
# well that's your problem isn't it? And they don't believe in preserving
# older versions. Good luck!
# Where's the version flag? Where's idempotence you say? Well f*** you
# for trying to version your product. This is arch. They live on the edge.
# You never get anything but the latest version. And if that's broken...
# well that's your problem isn't it? And they don't believe in preserving
# older versions. Good luck!
property :package, String, name_property: true
property :root, String, required: true
resource_name :msys2_package
provides :msys2_package
action_class do
#
@@ -97,7 +97,7 @@ action_class do
cookbook 'mingw'
end
# $HOME is using files from /etc/skel. The home-directory creation step
# $HOME is using files from /etc/skel. The home-directory creation step
# will automatically be performed if other users log in - so if you wish
# to globally modify user first time setup, edit /etc/skel or add
# "post-setup" steps to /etc/post-install/
@@ -125,10 +125,10 @@ action :install do
msys2_do_action("installing #{package}", "pacman -S --needed --noconfirm #{package}")
end
# Package name is ignored. This is arch. Why would you ever upgrade a single
# package and its deps? That'll just break everything else that ever depended
# on a different version of that dep. Because arch is wonderful like that.
# So you only get the choice to move everything to latest or not... it's the
# Package name is ignored. This is arch. Why would you ever upgrade a single
# package and its deps? That'll just break everything else that ever depended
# on a different version of that dep. Because arch is wonderful like that.
# So you only get the choice to move everything to latest or not... it's the
# most agile development possible!
action :upgrade do
msys2_do_action("upgrading #{package}", "pacman -Syu --noconfirm #{package}")

View File

@@ -2,7 +2,7 @@
# Cookbook:: mingw
# Resource:: tdm_gcc
#
# Copyright:: 2016, Chef Software, Inc.
# Copyright:: 2016-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -23,8 +23,6 @@ property :flavor, Symbol, is: [:sjlj_32, :seh_sjlj_64], default: :seh_sjlj_64
property :root, String, required: true
property :version, String, is: ['5.1.0'], name_property: true
resource_name :mingw_tdm_gcc
tdm_gcc_64 = {
'http://iweb.dl.sourceforge.net/project/tdm-gcc/TDM-GCC%205%20series/5.1.0-tdm64-1/gcc-5.1.0-tdm64-1-core.tar.lzma' =>
'29393aac890847089ad1e93f81a28f6744b1609c00b25afca818f3903e42e4bd',

View File

@@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file.
## 8.7.4 - 2020-09-16
- resolved cookstyle error: spec/mysql_client_installation_package_spec.rb:4:48 warning: `ChefDeprecations/DeprecatedChefSpecPlatform`
- resolved cookstyle error: spec/mysql_server_installation_package_spec.rb:4:48 warning: `ChefDeprecations/DeprecatedChefSpecPlatform`
- Use mysql_test cookbook attributes for testing
- Cookstyle Bot Auto Corrections with Cookstyle 6.17.6
## 8.7.3 - 2020-07-22
- restore resource_name in mysql_service for Chef Infra Client < 16

View File

@@ -3,48 +3,48 @@ module MysqlCookbook
require 'shellwords'
def el6?
return true if node['platform_family'] == 'rhel' && node['platform_version'].to_i == 6
return true if platform_family?('rhel') && node['platform_version'].to_i == 6
false
end
def el7?
return true if node['platform_family'] == 'rhel' && node['platform_version'].to_i == 7
return true if platform_family?('rhel') && node['platform_version'].to_i == 7
false
end
def fedora?
return true if node['platform_family'] == 'fedora'
return true if platform_family?('fedora')
false
end
def suse?
return true if node['platform_family'] == 'suse'
return true if platform_family?('suse')
false
end
def jessie?
return true if node['platform'] == 'debian' && node['platform_version'].to_i == 8
return true if platform?('debian') && node['platform_version'].to_i == 8
false
end
def stretch?
return true if node['platform'] == 'debian' && node['platform_version'].to_i == 9
return true if platform?('debian') && node['platform_version'].to_i == 9
false
end
def trusty?
return true if node['platform'] == 'ubuntu' && node['platform_version'] == '14.04'
return true if node['platform'] == 'linuxmint' && node['platform_version'] =~ /^17\.[0-9]$/
return true if platform?('ubuntu') && node['platform_version'] == '14.04'
return true if platform?('linuxmint') && node['platform_version'] =~ /^17\.[0-9]$/
false
end
def xenial?
return true if node['platform'] == 'ubuntu' && node['platform_version'] == '16.04'
return true if platform?('ubuntu') && node['platform_version'] == '16.04'
false
end
def bionic?
return true if node['platform'] == 'ubuntu' && node['platform_version'] == '18.04'
return true if platform?('ubuntu') && node['platform_version'] == '18.04'
false
end
@@ -70,7 +70,7 @@ module MysqlCookbook
# rhelish
return '5.6' if el6?
return '5.6' if el7?
return '5.6' if node['platform'] == 'amazon'
return '5.6' if platform?('amazon')
# debian
return '5.5' if jessie?
@@ -81,7 +81,7 @@ module MysqlCookbook
return '5.7' if bionic?
# misc
return '5.6' if node['platform'] == 'freebsd'
return '5.6' if platform?('freebsd')
return '5.7' if fedora?
return '5.6' if suse?
end
@@ -105,25 +105,25 @@ module MysqlCookbook
def default_client_package_name
return %w(mysql mysql-devel) if major_version == '5.1' && el6?
return %w(mysql mysql-devel) if el7?
return ['mysql55', 'mysql55-devel.x86_64'] if major_version == '5.5' && node['platform'] == 'amazon'
return ['mysql56', 'mysql56-devel.x86_64'] if major_version == '5.6' && node['platform'] == 'amazon'
return ['mysql57', 'mysql57-devel.x86_64'] if major_version == '5.7' && node['platform'] == 'amazon'
return ['mysql-client-5.5', 'libmysqlclient-dev'] if major_version == '5.5' && node['platform_family'] == 'debian'
return ['mysql-client-5.6', 'libmysqlclient-dev'] if major_version == '5.6' && node['platform_family'] == 'debian'
return ['mysql-client-5.7', 'libmysqlclient-dev'] if major_version == '5.7' && node['platform_family'] == 'debian'
return 'mysql-community-server-client' if major_version == '5.6' && node['platform_family'] == 'suse'
return ['mysql55', 'mysql55-devel.x86_64'] if major_version == '5.5' && platform?('amazon')
return ['mysql56', 'mysql56-devel.x86_64'] if major_version == '5.6' && platform?('amazon')
return ['mysql57', 'mysql57-devel.x86_64'] if major_version == '5.7' && platform?('amazon')
return ['mysql-client-5.5', 'libmysqlclient-dev'] if major_version == '5.5' && platform_family?('debian')
return ['mysql-client-5.6', 'libmysqlclient-dev'] if major_version == '5.6' && platform_family?('debian')
return ['mysql-client-5.7', 'libmysqlclient-dev'] if major_version == '5.7' && platform_family?('debian')
return 'mysql-community-server-client' if major_version == '5.6' && platform_family?('suse')
%w(mysql-community-client mysql-community-devel)
end
def default_server_package_name
return 'mysql-server' if major_version == '5.1' && el6?
return 'mysql55-server' if major_version == '5.5' && node['platform'] == 'amazon'
return 'mysql56-server' if major_version == '5.6' && node['platform'] == 'amazon'
return 'mysql57-server' if major_version == '5.7' && node['platform'] == 'amazon'
return 'mysql-server-5.5' if major_version == '5.5' && node['platform_family'] == 'debian'
return 'mysql-server-5.6' if major_version == '5.6' && node['platform_family'] == 'debian'
return 'mysql-server-5.7' if major_version == '5.7' && node['platform_family'] == 'debian'
return 'mysql-community-server' if major_version == '5.6' && node['platform_family'] == 'suse'
return 'mysql55-server' if major_version == '5.5' && platform?('amazon')
return 'mysql56-server' if major_version == '5.6' && platform?('amazon')
return 'mysql57-server' if major_version == '5.7' && platform?('amazon')
return 'mysql-server-5.5' if major_version == '5.5' && platform_family?('debian')
return 'mysql-server-5.6' if major_version == '5.6' && platform_family?('debian')
return 'mysql-server-5.7' if major_version == '5.7' && platform_family?('debian')
return 'mysql-community-server' if major_version == '5.6' && platform_family?('suse')
'mysql-community-server'
end
@@ -132,33 +132,33 @@ module MysqlCookbook
end
def run_dir
return "#{prefix_dir}/var/run/#{mysql_name}" if node['platform_family'] == 'rhel'
return "/run/#{mysql_name}" if node['platform_family'] == 'debian'
return "#{prefix_dir}/var/run/#{mysql_name}" if platform_family?('rhel')
return "/run/#{mysql_name}" if platform_family?('debian')
"/var/run/#{mysql_name}"
end
def prefix_dir
return "/opt/mysql#{pkg_ver_string}" if node['platform_family'] == 'omnios'
return '/opt/local' if node['platform_family'] == 'smartos'
return "/opt/mysql#{pkg_ver_string}" if platform_family?('omnios')
return '/opt/local' if platform_family?('smartos')
return "/opt/rh/#{scl_name}/root" if scl_package?
end
def scl_name
return unless node['platform_family'] == 'rhel'
return unless platform_family?('rhel')
return 'mysql51' if version == '5.1' && node['platform_version'].to_i == 5
return 'mysql55' if version == '5.5' && node['platform_version'].to_i == 5
end
def scl_package?
return unless node['platform_family'] == 'rhel'
return unless platform_family?('rhel')
return true if version == '5.1' && node['platform_version'].to_i == 5
return true if version == '5.5' && node['platform_version'].to_i == 5
false
end
def etc_dir
return "/opt/mysql#{pkg_ver_string}/etc/#{mysql_name}" if node['platform_family'] == 'omnios'
return "#{prefix_dir}/etc/#{mysql_name}" if node['platform_family'] == 'smartos'
return "/opt/mysql#{pkg_ver_string}/etc/#{mysql_name}" if platform_family?('omnios')
return "#{prefix_dir}/etc/#{mysql_name}" if platform_family?('smartos')
"#{prefix_dir}/etc/#{mysql_name}"
end
@@ -167,10 +167,10 @@ module MysqlCookbook
end
def system_service_name
return 'mysql51-mysqld' if node['platform_family'] == 'rhel' && scl_name == 'mysql51'
return 'mysql55-mysqld' if node['platform_family'] == 'rhel' && scl_name == 'mysql55'
return 'mysqld' if node['platform_family'] == 'rhel'
return 'mysqld' if node['platform_family'] == 'fedora'
return 'mysql51-mysqld' if platform_family?('rhel') && scl_name == 'mysql51'
return 'mysql55-mysqld' if platform_family?('rhel') && scl_name == 'mysql55'
return 'mysqld' if platform_family?('rhel')
return 'mysqld' if platform_family?('fedora')
'mysql' # not one of the above
end
@@ -191,7 +191,7 @@ module MysqlCookbook
end
def log_dir
return "/var/adm/log/#{mysql_name}" if node['platform_family'] == 'omnios'
return "/var/adm/log/#{mysql_name}" if platform_family?('omnios')
"#{prefix_dir}/var/log/#{mysql_name}"
end
@@ -258,8 +258,8 @@ EOSQL
end
def mysql_install_db_bin
return "#{base_dir}/scripts/mysql_install_db" if node['platform_family'] == 'omnios'
return "#{prefix_dir}/bin/mysql_install_db" if node['platform_family'] == 'smartos'
return "#{base_dir}/scripts/mysql_install_db" if platform_family?('omnios')
return "#{prefix_dir}/bin/mysql_install_db" if platform_family?('smartos')
'mysql_install_db'
end
@@ -273,14 +273,14 @@ EOSQL
end
def mysqladmin_bin
return "#{prefix_dir}/bin/mysqladmin" if node['platform_family'] == 'smartos'
return "#{prefix_dir}/bin/mysqladmin" if platform_family?('smartos')
return 'mysqladmin' if scl_package?
"#{prefix_dir}/usr/bin/mysqladmin"
end
def mysqld_bin
return "#{prefix_dir}/libexec/mysqld" if node['platform_family'] == 'smartos'
return "#{base_dir}/bin/mysqld" if node['platform_family'] == 'omnios'
return "#{prefix_dir}/libexec/mysqld" if platform_family?('smartos')
return "#{base_dir}/bin/mysqld" if platform_family?('omnios')
return '/usr/sbin/mysqld' if fedora? && v56plus
return '/usr/libexec/mysqld' if fedora?
return 'mysqld' if scl_package?
@@ -289,14 +289,14 @@ EOSQL
def mysql_systemd_start_pre
return '/usr/bin/mysqld_pre_systemd' if v57plus && (el7? || fedora?)
return '/usr/bin/mysql-systemd-start pre' if node['platform_family'] == 'rhel'
return '/usr/bin/mysql-systemd-start pre' if platform_family?('rhel')
return '/usr/lib/mysql/mysql-systemd-helper install' if suse?
'/usr/share/mysql/mysql-systemd-start pre'
end
def mysql_systemd
return "/usr/libexec/#{mysql_name}-wait-ready $MAINPID" if v57plus && (el7? || fedora?)
return '/usr/bin/mysql-systemd-start' if node['platform_family'] == 'rhel'
return '/usr/bin/mysql-systemd-start' if platform_family?('rhel')
return '/usr/share/mysql/mysql-systemd-start' if v57plus
"/usr/libexec/#{mysql_name}-wait-ready $MAINPID"
end
@@ -311,8 +311,8 @@ EOSQL
end
def mysqld_safe_bin
return "#{prefix_dir}/bin/mysqld_safe" if node['platform_family'] == 'smartos'
return "#{base_dir}/bin/mysqld_safe" if node['platform_family'] == 'omnios'
return "#{prefix_dir}/bin/mysqld_safe" if platform_family?('smartos')
return "#{base_dir}/bin/mysqld_safe" if platform_family?('omnios')
return 'mysqld_safe' if scl_package?
"#{prefix_dir}/usr/bin/mysqld_safe"
end

View File

@@ -123,7 +123,7 @@ module MysqlCookbook
def configure_apparmor
# Do not add these resource if inside a container
# Only valid on Ubuntu
return if ::File.exist?('/.dockerenv') || ::File.exist?('/.dockerinit') || node['platform'] != 'ubuntu'
return if ::File.exist?('/.dockerenv') || ::File.exist?('/.dockerinit') || !platform?('ubuntu')
# Apparmor
package 'apparmor' do

View File

@@ -1 +1 @@
{"name":"mysql","version":"8.7.3","description":"Provides mysql_service, mysql_config, and mysql_client resources","long_description":"","maintainer":"Sous Chefs","maintainer_email":"help@sous-chefs.org","license":"Apache-2.0","platforms":{"redhat":">= 6.0","centos":">= 6.0","scientific":">= 6.0","oracle":">= 6.0","amazon":">= 0.0.0","fedora":">= 0.0.0","debian":">= 7.0","ubuntu":">= 14.04","opensuseleap":">= 0.0.0","suse":">= 12.0"},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/sous-chefs/mysql","issues_url":"https://github.com/sous-chefs/mysql/issues","chef_version":[[">= 12.7"]],"ohai_version":[]}
{"name":"mysql","version":"8.7.4","description":"Provides mysql_service, mysql_config, and mysql_client resources","long_description":"","maintainer":"Sous Chefs","maintainer_email":"help@sous-chefs.org","license":"Apache-2.0","platforms":{"redhat":">= 6.0","centos":">= 6.0","scientific":">= 6.0","oracle":">= 6.0","amazon":">= 0.0.0","fedora":">= 0.0.0","debian":">= 7.0","ubuntu":">= 14.04","opensuseleap":">= 0.0.0","suse":">= 12.0"},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/sous-chefs/mysql","issues_url":"https://github.com/sous-chefs/mysql/issues","chef_version":[[">= 12.7"]],"ohai_version":[]}

View File

@@ -6,7 +6,7 @@ description 'Provides mysql_service, mysql_config, and mysql_client resour
source_url 'https://github.com/sous-chefs/mysql'
issues_url 'https://github.com/sous-chefs/mysql/issues'
chef_version '>= 12.7'
version '8.7.3'
version '8.7.4'
%w(redhat centos scientific oracle).each do |el|
supports el, '>= 6.0'

View File

@@ -1,5 +1,65 @@
# NodeJS Cookbook Changelog
## 7.3.3 - *2021-08-30*
- Standardise files with files in sous-chefs/repo-management
## 7.3.2 - *2021-06-01*
- Standardise files with files in sous-chefs/repo-management
## 7.3.1 - *2020-12-31*
- resolved cookstyle error: attributes/packages.rb:15:55 convention: `Layout/TrailingEmptyLines`
- resolved cookstyle error: test/cookbooks/test/recipes/resource.rb:118:1 convention: `Layout/TrailingEmptyLines`
- Enable builds for opensuse-leap-15
- Add a library method test
## 7.3.0 (2020-10-21)
- Add rspec tests for the library methods
- Update the url_invalid? method to return false if it detects an invalid uri
- Add the auto_update option to the npm_package resource. Allows turning off auto_update of npm packages.
- Allow actions and options for OS package installation to be specified as attributes
- Add the live_stream parameter to the npm_package execution to get better installation diagnostics
- Add the auto_update option to the npm_package resource. Allows turning off auto_update of npm packages.
- Update testing
## 7.2.0 (2020-10-07)
- Verify the URI of installed packages to help determine if a good URI has been installed
- Add tests that verify npm-package installed packages
- Get the example test cookbook working
- Add support for installing node on windows
## 7.1.0 (2020-10-01)
- resolved cookstyle error: recipes/nodejs_from_binary.rb:19:1 refactor: `ChefCorrectness/IncorrectLibraryInjection`
- resolved cookstyle error: recipes/nodejs_from_source.rb:21:1 refactor: `ChefCorrectness/IncorrectLibraryInjection`
- resolved cookstyle error: recipes/npm_from_source.rb:21:1 refactor: `ChefCorrectness/IncorrectLibraryInjection`
- Have ark setup node and npm binaries into PATH
- Add `node_env` to `npm_package` in order to set `NODE_ENV` (useful for some packages)
- Include `npx` as a binary in addition to `npm`, it has been [included since `npm` v5.2.0](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b)
## 7.0.1 (2020-06-04)
- Minor readme fix
## 7.0.0 (2020-06-04)
- Require Chef Infra Client 14+ and remove the build-essential dependency
- Updated the default to Node.js v10.16.3
- Added compatibility with Chef Infra Client 16.2+
- Removed Foodcritic testing
- Updated ChefSpec and Kitchen platforms
- Resolved multiple minor cookstyle issues in the cookbook
- Added a vscode editor config
## 6.0.0 (2018-10-11)
- Use the build_essential resource in the source install recipe instead of the build-essential::default recipe. This way we can use the new built-in build_essential resource in Chef 14+
- Set default version to Node.js v8.12.0
## 5.0.0 (2017-11-15)
- nodejs_npm resource has been converted to a custom resource and renamed to npm_package. The existing resource name will continue to function, but over time code should be updated for the new name. This name change has been made so we can eventually merge this resource into the chef-client.
@@ -102,34 +162,34 @@
- implement installation from package on RedHat - ([@vaskas])
## v1.1.3:
## v1.1.3
- update default version of node to 0.10.13 - and npm - v1.3.4 ([@jodosha][])
## v1.1.2:
## v1.1.2
- update default version of node to 0.10.2 - ([@bakins])
- fully migrated to test-kitchen 1.alpha and vagrant 1.1.x/berkshelf 1.3.1
## v1.1.1:
## v1.1.1
- update default versions to the latest: node - v0.10.0 and npm - v1.2.14
- `make_thread` is now a real attribute - ([@ChrisLundquist])
## v1.1.0:
## v1.1.0
- rewrite the package install; remove rpm support since there are no longer any packages available anywhere
- add support to install `legacy_packages` from ubuntu repo as well as the latest 0.10.x branch (this is default).
## v1.0.4:
## v1.0.4
- add support for binary installation method ([@JulesAU])
## v1.0.3:
## v1.0.3
- unreleased
- 7.3.1 - *2020-12-31*
## v1.0.2:
## v1.0.2
- add smartos support for package install ([@sax])
- support to compile with all processors available (default 2 if unknown) - ([@ChrisLundquist])
@@ -137,12 +197,12 @@
- ensure npm recipe honours the 'source' or 'package' setting - ([@markbirbeck])
- updated the default versions to the latest stable node/npm
## v1.0.1:
## v1.0.1
- fixed bug that prevented overwritting the node/npm versions (moved the `src_url`s as local variables instead of attributes) - ([@johannesbecker])
- updated the default versions to the latest node/npm
## v1.0.0:
## v1.0.0
- added packages installation support ([@smith])

Some files were not shown because too many files have changed in this diff Show More