Merge branch 'master' into feature/145-sockethub_from_npm

This commit is contained in:
Greg Karékinian 2021-07-09 10:51:02 +02:00
commit b8ac5e1c07
465 changed files with 13043 additions and 6361 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

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "site-cookbooks/postgresql"]
path = site-cookbooks/postgresql
url = git@github.com:67P/postgresql.git

1
.ruby-version Normal file
View File

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

View File

@ -3,15 +3,14 @@
source 'https://supermarket.chef.io'
cookbook 'mediawiki',
git: 'https://github.com/67P/mediawiki-cookbook.git',
ref: '55a4680ee298199fa5f7fa51b5c589fbfa52eed0'
git: 'https://github.com/67P/mediawiki-cookbook.git',
ref: 'nginx'
cookbook 'redis',
git: 'https://github.com/phlipper/chef-redis.git',
ref: 'v0.5.6'
git: 'https://github.com/phlipper/chef-redis.git',
ref: 'v0.5.6'
cookbook 'postfix', '= 5.0.2'
cookbook 'php-fpm', '~> 0.8.0'
cookbook 'php', '~> 6.1.1'
cookbook 'composer', '~> 2.6.1'
cookbook 'php', '~> 8.0.0'
cookbook 'composer', '~> 2.7.0'
cookbook 'poise-ruby-build', '~> 1.1.0'
cookbook 'application', '~> 5.2.0'
cookbook 'application_javascript', '~> 1.0.0'
@ -29,15 +28,15 @@ cookbook 'nginx', '= 9.0.0'
# Remove when cookbooks stop depending on it, the build_essential resource is
# part of Chef 14 (https://docs.chef.io/resource_build_essential.html)
cookbook 'build-essential', '~> 8.2.1'
cookbook 'mysql', '~> 8.5.1'
cookbook 'postgresql', '= 7.1.4'
cookbook 'apt', '~> 7.0.0'
cookbook 'git', '= 6.0.0'
cookbook 'hostsfile', '= 2.4.5'
cookbook 'mysql', '~> 8.7.3'
# cookbook 'postgresql', '= 7.1.8'
cookbook 'apt', '~> 7.3.0'
cookbook 'git', '~> 10.0.0'
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', '= 3.1.0'
cookbook 'ark', '>= 5.0.0'
cookbook 'logrotate', '= 2.2.0'
cookbook 'openssl', '~> 8.5.5'
cookbook 'ntp', '= 3.4.0'
@ -47,9 +46,10 @@ cookbook 'compat_resource', '= 12.19.0'
cookbook 'homebrew', '= 3.0.0'
cookbook 'mariadb', '= 0.3.1'
cookbook 'ipfs',
git: 'https://gitea.kosmos.org/kosmos/ipfs-cookbook.git',
ref: 'v0.4.1'
git: 'https://gitea.kosmos.org/kosmos/ipfs-cookbook.git',
ref: 'v0.7.0'
cookbook 'elasticsearch', '= 4.2.0'
cookbook 'java', '~> 4.3.0'
cookbook 'ulimit', '~> 1.0.0'
cookbook 'golang', '~> 4.1.0'
cookbook 'zerotier', '~> 1.0.7'

View File

@ -3,37 +3,37 @@ DEPENDENCIES
application (~> 5.2.0)
application_git (= 1.1.0)
application_javascript (~> 1.0.0)
apt (~> 7.0.0)
ark (= 3.1.0)
apt (~> 7.3.0)
ark (>= 5.0.0)
build-essential (~> 8.2.1)
chef-sugar (= 3.3.0)
compat_resource (= 12.19.0)
composer (~> 2.6.1)
composer (~> 2.7.0)
elasticsearch (= 4.2.0)
firewall (~> 2.6.3)
git (= 6.0.0)
git (~> 10.0.0)
golang (~> 4.1.0)
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: 5c31191ff8571bc8425375fbf938913ac64aa2ee
ref: v0.4.1
revision: d7c25b6ce5fa490b6de3529fdc163fb64f1ece8a
ref: v0.7.0
java (~> 4.3.0)
logrotate (= 2.2.0)
mariadb (= 0.3.1)
mediawiki
git: https://github.com/67P/mediawiki-cookbook.git
revision: 55a4680ee298199fa5f7fa51b5c589fbfa52eed0
ref: 55a4680
mysql (~> 8.5.1)
revision: 78641e53635ba6cbd4a2a51fd597adb8fef1e8ad
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)
php (~> 6.1.1)
php-fpm (~> 0.8.0)
php (~> 8.0.0)
poise (~> 2.8.2)
poise-archive (~> 1.5.0)
poise-javascript
@ -44,7 +44,6 @@ DEPENDENCIES
poise-ruby-build (~> 1.1.0)
poise-service (~> 1.5.2)
postfix (= 5.0.2)
postgresql (= 7.1.4)
redis
git: https://github.com/phlipper/chef-redis.git
revision: 7476279fc9c8727f082b8d77b5e1922dc2ef437b
@ -52,6 +51,7 @@ DEPENDENCIES
timezone_iii (= 1.0.4)
ulimit (~> 1.0.0)
users (~> 5.3.1)
zerotier (~> 1.0.7)
GRAPH
apache2 (3.3.0)
@ -67,21 +67,19 @@ GRAPH
poise (~> 2.0)
poise-javascript (~> 1.0)
poise-service (~> 1.0)
apt (7.0.0)
ark (3.1.0)
build-essential (>= 0.0.0)
apt (7.3.0)
ark (5.0.0)
seven_zip (>= 0.0.0)
windows (>= 0.0.0)
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.6.1)
composer (2.7.0)
apt (>= 0.0.0)
php (>= 0.0.0)
windows (>= 0.0.0)
dmg (4.1.1)
elasticsearch (4.2.0)
apt (>= 0.0.0)
ark (>= 0.0.0)
@ -89,15 +87,14 @@ GRAPH
yum (>= 0.0.0)
firewall (2.6.5)
chef-sugar (>= 0.0.0)
git (6.0.0)
build-essential (>= 0.0.0)
dmg (>= 0.0.0)
yum-epel (>= 0.0.0)
git (10.0.0)
golang (4.1.0)
ark (~> 5.0)
homebrew (3.0.0)
hostname (0.4.2)
hostsfile (>= 0.0.0)
hostsfile (2.4.5)
ipfs (0.4.1)
hostsfile (3.0.1)
ipfs (0.7.0)
ark (>= 0.0.0)
java (4.3.0)
homebrew (>= 0.0.0)
@ -111,24 +108,21 @@ GRAPH
apache2 (>= 0.0.0)
nginx (>= 0.0.0)
php (>= 0.0.0)
php-fpm (>= 0.0.0)
mingw (2.1.0)
seven_zip (>= 0.0.0)
mysql (8.5.1)
mysql (8.7.3)
nginx (9.0.0)
build-essential (>= 5.0)
ohai (>= 4.1.0)
yum-epel (>= 0.0.0)
nodejs (5.0.0)
nodejs (7.3.1)
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 (6.1.1)
build-essential (>= 5.0)
php (8.0.0)
yum-epel (>= 0.0.0)
php-fpm (0.8.0)
poise (2.8.2)
poise-archive (1.5.0)
poise (~> 2.6)
@ -154,7 +148,6 @@ GRAPH
poise-service (1.5.2)
poise (~> 2.0)
postfix (5.0.2)
postgresql (7.1.4)
redis (0.5.6)
apt (>= 0.0.0)
seven_zip (3.1.1)
@ -165,3 +158,5 @@ GRAPH
windows (6.0.0)
yum (5.1.0)
yum-epel (3.3.0)
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'

View File

@ -3,253 +3,251 @@ GEM
specs:
addressable (2.7.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)
builder (3.2.4)
chef (17.2.29)
addressable
bcrypt_pbkdf (~> 1.0)
bundler (>= 1.10)
chef-config (= 15.3.14)
chef-config (= 17.2.29)
chef-utils (= 17.2.29)
chef-vault
chef-zero (>= 14.0.11)
diff-lcs (~> 1.2, >= 1.2.4)
ed25519 (~> 1.2)
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)
chef-config (17.2.29)
addressable
chef-utils (= 17.2.29)
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.0.29)
chef-config
concurrent-ruby (~> 1.0)
chef-utils (17.2.29)
concurrent-ruby
chef-vault (4.1.0)
chef-zero (15.0.4)
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)
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.2)
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.1.0)
faraday_middleware (1.0.0)
faraday (~> 1.0)
ffi (1.15.1)
ffi-libarchive (1.0.17)
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)
httpclient (2.8.3)
iniparse (1.4.4)
iniparse (1.5.0)
inspec-core (4.37.25)
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)
json (2.5.1)
knife-zero (2.3.2)
chef (>= 15.0)
libyajl2 (1.2.0)
license-acceptance (1.0.13)
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-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)
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)
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.1.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.20.1)
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.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
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.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.2)
ruby2_keywords (0.0.4)
rubyntlm (0.6.3)
rubyzip (2.3.0)
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.1.0)
tomlrb (1.3.0)
train-core (3.7.2)
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.0.0)
unicode_utils (1.4.0)
uuidtools (2.1.5)
winrm (2.3.2)
uuidtools (2.2.0)
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
DEPENDENCIES
berkshelf (~> 7.0)
chef (~> 15.3.14)
cookstyle
knife-zero
test-kitchen
BUNDLED WITH
1.17.3

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.

2
Vagrantfile vendored
View File

@ -94,6 +94,8 @@ 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-bitcoin::source'
# chef.add_recipe 'kosmos-mediawiki'
# chef.add_recipe 'kosmos-wordpress'
# chef.add_recipe 'kosmos-ejabberd'

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

@ -0,0 +1,4 @@
{
"name": "akkounts-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0LKcqydrG3zgtmThEg+q\nOcw8QvIB2usMkF4kNMFeqhhdr2q/AtRcq4RJ0u0MiZbkHduGWfG9QZpjmbFZcEke\nURJbddqSDPHFAtrK2+BpcMqNN/mSp59f4MJf6wdLnBoeZCF5pCCXibyj+/754Ly+\nEJNiB1sf1Lu82YW2YM7iLhOLk1QQD2DTfBGbj9swdPrgKK+1npQ4A7O8sOB5gDjb\n9QVLCvCEoYFi+9is0vw/YryEr6tfnNw+CroP2uDfyVfWznF8oPUuttAcHgqDA3CV\n7lCRk9yVt1FKwuq2lFcsMqZ7wO4EoxpzCz/XTnpFPFvgeVinyXjSPsQCBAdwJe5T\nWQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@ -0,0 +1,4 @@
{
"name": "barnard.kosmos.org",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5Rr+3giLkr0xqZPRPn9Z\ngxvmAaUo6VSs1qnMfznNNN/CGCYett0ndEJp4wI8xp2fq75b2TSm4jqhqjtgYVVD\nEeSOKTZEnoE7YSssodGTAK5YnrVIPNyWd61Ih/NkHzCjlcuVX6sJD7z/pgK+WMao\nAAxzMrefvHALFBmJIxbugakru/nvDcQeV8DOF+UjzsO5CTC0BUzCFeXBG7HD3W+6\nP2wQlMKteM9uQU6Agx7XegeWS2Lfnxg1em5TNbw1PbLofROwr1pCUPfVzQ0CAVxm\nXLzmA2xtMqCT2j83DU9WleZPYiS0rg+r9T1jsDX0TyH4NTV8gO2SJ9BMUNcX+3Ox\nmQIDAQAB\n-----END PUBLIC KEY-----\n"
}

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

@ -0,0 +1,4 @@
{
"name": "bitcoin-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuNy0NZUQo93anCe3YkGI\nGTzHnH1SUqc7315ShEEgp9GC9ghEaFe9YX6fdYma4KLfehi1LNoYhibpaVvF6qMB\n5p2pCk4eM9EjRYve3byqt0ZJZzLEcR4zfoiqJHLMBfB1tDiGj3BbahY6LJ0WH/q2\nTek61LOp2nB/9HYSIRlYz8EJtt2YyjV57oqQD5rnEDCJyBf34VI81SZFBeSHCeHQ\nUDALdnkro840FHfFKMUTdUmtpq/bhBA13EkFqVObnc0xZQP3eW6pRNeZ5oUpBLK3\nbAXahd8YEW6c6XerK3JqROs/l2ZRXmfmOMB5RjzmTEuCDsZFuCnJDQEY1nWCyUmu\nhQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@ -0,0 +1,4 @@
{
"name": "centaurus.kosmos.org",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsVV0j8DQSlefAAAmafjx\nyT1j1idLQF0oltTp2p4jFEsnEdFeP4Plpluy+detra1gM9sBBBuvRKGt8NP+Yoc7\nbnn7qU13E/nWUQh9n15+jjgUirXg7CxluKfj2VvsdchJRIvzDwwZz5sqITiGG7/S\n2r2KBBBnuGlGShQJZhhcLW4P+3YgxW8DUgUsRdvreVuvF1hcnaSymldfos1CqYL8\nawtsZ2rtdZHmZxfguXl91WBCu2OxsT13i3kInnDQsFB0tYKq+TFSLAHxneKTYPRW\ngYgP9RSBZ51iQ+6R1CenYsr4SePVCmwaZGb8bmd0QLvGKlBhjX29a5bE5tjzeoBD\nuwIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@ -0,0 +1,4 @@
{
"name": "draco.kosmos.org",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqJiREO7WJyKWzOltXREs\n6bCMBzHTeyBSLxK/50xPvk43A8e+8qW1V52oO/uQkHh8YJ8BCDdSsWTNTudTuMhm\nEFLYP7n+ESYyz7nBgcwLX19lSo3dGnyuQBwlno6W/F1uEdTxfY6MtxJdiPZQDIt0\noijEwOF4ZhA5A+kqx6fpp+rX48r9wdidjdhrJimQixL0SsJFkoStc17BxrnqPpv9\n/sd4xYKgK9hEmEovhghBN3ULsxDOj63cGmM4uWLjbO4ZpL6g1lZRJR5kmcziL9KH\n23M7ShaJu90PnPiFSCUFgNN24zA7aKTkKulNs4g2OYovWVG/z8WglGqHNY83dBP0\nLwIDAQAB\n-----END PUBLIC KEY-----\n"
}

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

@ -0,0 +1,4 @@
{
"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"
}

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

@ -0,0 +1,4 @@
{
"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/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/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-3.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "postgres-3",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPsFwxISCjy38kw78N2I\nhkxK6S0uARkPggE+OP7jWwZqHtnz1O+ZUbM/o9i/dWgm0Xl+hQ6grPtjS57VzXJq\nlwsVDGTkyb5T6wAcZao/koQbA9ZABknLH/ra52gny+7j3b2q5RIdyhddTYZwsbIG\n9y2BfcUW0Z1mPVkR2NxzFloj0ulsrJs6/5GhqbREqPz5BsyBJlwFsREK2Dy6m2nm\nVMp+GIQlRdhy/D09s/BZ/Ejwe8D3tv3jJT5CRXkndwa5qIc96E1uzRQpyyKvXZDK\nYvUdQwniW4EBNHEo/se+OqP+Du/M1dReX6aTq9axbhKiVWoD3FtMVtGqE3uf/i4I\n0QIDAQAB\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"
}

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

@ -0,0 +1,4 @@
{
"name": "uploads-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwJwWaz8TeGv3SFlKzLMx\nqN8GTL/c0N9ppBvv8xNSS/yF9Y40SbL418uxYzm9hIhOXgIygIgLT2EKIXX32t+R\neOJCdYycQFM3At2fhMkjhuUW0gmDRcYBcBJLC5hLh2EZ+A8V7k4qgrBpPLOjEv48\nhQY0vuAw2DGndWr4QLh5NLUmQiOrfuzcZSSNCBOTIgUZgNmRd9QcCHDq4WDH3poa\nosJo4a9JGEGUL1irOivvEdyJPwEd2f++nYAdWwj8pjCYgpRshQlLhxOlylMx7MxB\nQt2bgJC9sahfbfJCOqdlCU3DMJL0bRUiuxK77WeSsxWBJmrsiF3+Ljs2Ix+s7fnS\nywIDAQAB\n-----END PUBLIC KEY-----\n"
}

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

@ -0,0 +1,4 @@
{
"name": "wiki-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3LprIvOWrnsywbvFGXtK\nsbd6xmILw/W/dSogLi0DQBXxPsOipH8pL4K6IeZmMeU3TXaW7faf/54KrMnh+4s1\nLEXpWSATvCaw1LzihzoXELpVLNvBLHZjAAO2TJ5ay1knTlA92hqN8qZOKzRtfHBX\n49dIgJgY95UIIJqSk4425llgQY/tntEWPjSduPIyST/PKkuW+RbUj4XyKm/qrASV\nXrbDK0dZAD0kJrOEjKspUyBQjyutFy+hkv0ldiGogcpCNPDaDsJqnw+Gp0gv6w7V\n92omCx8oJuXoqL1SIB6ayHV3q1pEWC9VbDRdcSYBjbRPFITEj6Er0m6OhJjlOyyR\nfwIDAQAB\n-----END PUBLIC KEY-----\n"
}

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

@ -0,0 +1,4 @@
{
"name": "zerotier-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx59liuiEXuAykaiQhjvO\nMimzWH2MOE/GdfPdlGG0IupDtGbDgpsu6lHB/Tc8ct+SEsj55KuamEmUew3EzWRQ\ngVWAPjWtlk6gqVlpU+8eJjTAxT1vaEOvetzliPDNzRBk1AAzS0IkMQwPAIqOD2Vm\nz+QDrTiEFNnbKyBDQ54uY9jBtEgTHgzZyc9KHTjcodJu/oCmOuO0ieTtMS4CDWVl\no2auyABpXX6PzW3hFvH/GB0IlVC5IBa7XS6JrbIFbZCvoAYf/egcQUTToNiKH45e\n2tPZbFpOt955zwInKTioW+Ak3qVVEPvCZ9IBTN7jZkSQuP4Ob5SA4+IbDJcXGulG\nZQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@ -2,6 +2,34 @@
This file is used to list changes made in each version of the apt cookbook.
## 7.3.0 (2020-05-01)
- Cookstyle fixes - [@tas50](https://github.com/tas50)
- Remove unnecessary Foodcritic comments - [@tas50](https://github.com/tas50)
- Simplify the metadata.rb to resolve cookstyle warnings - [@tas50](https://github.com/tas50)
- Prevent helper collisions in Chef Infra Client 16 - [@tas50](https://github.com/tas50)
## 7.2.0 (2019-08-05)
- Allow you to specify dpkg options just for unattended upgrades - [@majormoses](https://github.com/majormoses)
- Adding documentation and tests for setting dpkg options unattended upgrades - [@majormoses](https://github.com/majormoses)
- Test on Chef 15 + Chef Workstation - [@tas50](https://github.com/tas50)
- Remove tests of the resources now built into Chef - [@tas50](https://github.com/tas50)
- Remove respond_to from the metadata - [@tas50](https://github.com/tas50)
- Remove the recipe description from the metadata as these aren't used - [@tas50](https://github.com/tas50)
- Replace Chef 12 testing with 13.3 - [@tas50](https://github.com/tas50)
- Remove Ubuntu 14.04 / Debian 8 testing and add Debian 10 testing - [@tas50](https://github.com/tas50)
## 7.1.1 (2018-10-11)
- Allow to customize sender email for unattended-upgrades
## 7.1.0 (2018-09-05)
- Add the installation of dirmngr and gnupg to the apt default cookbook to support secure repositories
- Added support for the unattended-upgrade SyslogEnable configuration feature
- Added support for the unattended-upgrade SyslogFacility configuration feature
## 7.0.0 (2018-04-06)
### Breaking Change
@ -16,7 +44,7 @@ This file is used to list changes made in each version of the apt cookbook.
## 6.1.3 (2017-07-19)
- Fixed typo in readme
- Fixed config namespace in the 10dpkg-options file
- Fixed config namespace in the 10dpkg-options file
## 6.1.2 (2017-06-20)

View File

@ -83,7 +83,7 @@ For example, to prevent caching and directly connect to the repository at `downl
"cacher_server": {
"cache_bypass": {
"download.oracle.com": "http",
"nginx.org": "https"
"nginx.org": "https"
}
}
}
@ -129,11 +129,15 @@ To pull just security updates, set `origins_patterns` to something like `["origi
- `['apt']['unattended_upgrades']['minimal_steps']` - Split the upgrade into the smallest possible chunks. This makes the upgrade a bit slower but it has the benefit that shutdown while a upgrade is running is possible (with a small delay). Defaults to false.
- `['apt']['unattended_upgrades']['install_on_shutdown']` - Install upgrades when the machine is shuting down instead of doing it in the background while the machine is running. This will (obviously) make shutdown slower. Defaults to false.
- `['apt']['unattended_upgrades']['mail']` - Send email to this address for problems or packages upgrades. Defaults to no email.
- `['apt']['unattended_upgrades']['sender']` - Send email from this address for problems or packages upgrades. Defaults to 'root'.
- `['apt']['unattended_upgrades']['mail_only_on_error']` - If set, email will only be set on upgrade errors. Otherwise, an email will be sent after each upgrade. Defaults to true.
- `['apt']['unattended_upgrades']['remove_unused_dependencies']` Do automatic removal of new unused dependencies after the upgrade. Defaults to false.
- `['apt']['unattended_upgrades']['automatic_reboot']` - Automatically reboots _without confirmation_ if a restart is required after the upgrade. Defaults to false.
- `['apt']['unattended_upgrades']['dl_limit']` - Limits the bandwidth used by apt to download packages. Value given as an integer in kb/sec. Defaults to nil (no limit).
- `['apt']['unattended_upgrades']['random_sleep']` - Wait a random number of seconds up to this value before running daily periodic apt actions. System default is 1800 seconds (30 minutes).
- `['apt']['unattended_upgrades']['syslog_enable']` - Enable logging to syslog. Defaults to false.
- `['apt']['unattended_upgrades']['syslog_facility']` - Specify syslog facility. Defaults to 'daemon'.
- `['apt']['unattended_upgrades']['dpkg_options']` An array of dpkg options to be used specifically only for unattended upgrades. Defaults to `[]` which will prevent it from being rendered from the template in the resulting file.
### Configuration for APT

View File

@ -2,7 +2,7 @@
# Cookbook:: apt
# Attributes:: default
#
# Copyright:: 2009-2017, Chef Software, Inc.
# Copyright:: 2009-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.
@ -41,12 +41,17 @@ default['apt']['unattended_upgrades']['auto_fix_interrupted_dpkg'] = false
default['apt']['unattended_upgrades']['minimal_steps'] = false
default['apt']['unattended_upgrades']['install_on_shutdown'] = false
default['apt']['unattended_upgrades']['mail'] = nil
default['apt']['unattended_upgrades']['sender'] = nil
default['apt']['unattended_upgrades']['mail_only_on_error'] = true
default['apt']['unattended_upgrades']['remove_unused_dependencies'] = false
default['apt']['unattended_upgrades']['automatic_reboot'] = false
default['apt']['unattended_upgrades']['automatic_reboot_time'] = 'now'
default['apt']['unattended_upgrades']['dl_limit'] = nil
default['apt']['unattended_upgrades']['random_sleep'] = nil
default['apt']['unattended_upgrades']['syslog_enable'] = false
default['apt']['unattended_upgrades']['syslog_facility'] = 'daemon'
default['apt']['unattended_upgrades']['dpkg_options'] = []
default['apt']['confd']['force_confask'] = false
default['apt']['confd']['force_confdef'] = false

View File

@ -2,7 +2,7 @@
# Cookbook:: apt
# Library:: helpers
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-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.
@ -24,13 +24,13 @@ module Apt
#
# @return [Boolean]
def apt_installed?
!which('apt-get').nil?
!apt_which('apt-get').nil?
end
# Finds a command in $PATH
#
# @return [String, nil]
def which(cmd)
def apt_which(cmd)
ENV['PATH'] = '' if ENV['PATH'].nil?
paths = (ENV['PATH'].split(::File::PATH_SEPARATOR) + %w(/bin /usr/bin /sbin /usr/sbin))
@ -44,6 +44,6 @@ module Apt
end
end
Chef::Recipe.send(:include, ::Apt::Helpers)
Chef::Resource.send(:include, ::Apt::Helpers)
Chef::Provider.send(:include, ::Apt::Helpers)
Chef::Recipe.include ::Apt::Helpers
Chef::Resource.include ::Apt::Helpers
Chef::Provider.include ::Apt::Helpers

File diff suppressed because one or more lines are too long

13
cookbooks/apt/metadata.rb Normal file
View File

@ -0,0 +1,13 @@
name 'apt'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache-2.0'
description 'Configures apt and apt caching.'
version '7.3.0'
supports 'ubuntu'
supports 'debian'
source_url 'https://github.com/chef-cookbooks/apt'
issues_url 'https://github.com/chef-cookbooks/apt/issues'
chef_version '>= 13.3'

View File

@ -2,7 +2,7 @@
# Cookbook:: apt
# Recipe:: cacher-client
#
# Copyright:: 2011-2017, Chef Software, Inc.
# Copyright:: 2011-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.
@ -49,4 +49,4 @@ else
t.run_action(:create) if node['apt']['compiletime']
end
include_recipe 'apt::default'
include_recipe 'apt::default' # rubocop: disable ChefModernize/IncludingAptDefaultRecipe

View File

@ -2,7 +2,7 @@
# Cookbook:: apt
# Recipe:: cacher-ng
#
# Copyright:: 2008-2017, Chef Software, Inc.
# Copyright:: 2008-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,8 +2,8 @@
# Cookbook:: apt
# Recipe:: default
#
# Copyright:: 2008-2017, Chef Software, Inc.
# Copyright:: 2009-2017, Bryan McLellan <btm@loftninjas.org>
# Copyright:: 2008-2019, Chef Software, Inc.
# Copyright:: 2009-2019, Bryan McLellan <btm@loftninjas.org>
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
@ -42,8 +42,7 @@ apt_update 'periodic' do
end
# For other recipes to call to force an update
execute 'apt-get update' do
command 'apt-get update'
execute 'apt-get update' do # rubocop: disable ChefModernize/ExecuteAptUpdate
ignore_failure true
action :nothing
notifies :touch, 'file[/var/lib/apt/periodic/update-success-stamp]', :immediately
@ -93,6 +92,6 @@ template '/etc/apt/apt.conf.d/10recommends' do
only_if { apt_installed? }
end
package 'apt-transport-https' do
package %w(apt-transport-https gnupg dirmngr) do
only_if { apt_installed? }
end

View File

@ -2,7 +2,7 @@
# Cookbook:: apt
# Recipe:: unattended-upgrades
#
# Copyright:: 2014-2017, Chef Software, Inc.
# Copyright:: 2014-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

@ -25,7 +25,7 @@ Unattended-Upgrade::Package-Blacklist {
};
// This option allows you to control if on a unclean dpkg exit
// unattended-upgrades will automatically run
// unattended-upgrades will automatically run
// dpkg --force-confold --configure -a
// The default is true, to ensure updates keep getting installed
Unattended-Upgrade::AutoFixInterruptedDpkg "<%= node['apt']['unattended_upgrades']['auto_fix_interrupted_dpkg'] ? 'true' : 'false' %>";
@ -41,14 +41,20 @@ Unattended-Upgrade::MinimalSteps "<%= node['apt']['unattended_upgrades']['minima
// This will (obviously) make shutdown slower
Unattended-Upgrade::InstallOnShutdown "<%= node['apt']['unattended_upgrades']['install_on_shutdown'] ? 'true' : 'false' %>";
<% if node['apt']['unattended_upgrades']['mail'] -%>
// Send email to this address for problems or packages upgrades
// If empty or unset then no email is sent, make sure that you
// have a working mail setup on your system. A package that provides
// 'mailx' must be installed.
<% if node['apt']['unattended_upgrades']['mail'] -%>
Unattended-Upgrade::Mail "<%= node['apt']['unattended_upgrades']['mail'] %>";
<% end -%>
<% if node['apt']['unattended_upgrades']['sender'] -%>
// This option allows to customize the email address used in the
// 'From' header. unattended-upgrades will use "root" if unset.
Unattended-Upgrade::Sender "<%= node['apt']['unattended_upgrades']['sender'] %>";
<% end -%>
// Set this value to "true" to get emails only on errors. Default
// is to always send a mail if Unattended-Upgrade::Mail is set
Unattended-Upgrade::MailOnlyOnError "<%= node['apt']['unattended_upgrades']['mail_only_on_error'] ? 'true' : 'false' %>";
@ -57,19 +63,42 @@ Unattended-Upgrade::MailOnlyOnError "<%= node['apt']['unattended_upgrades']['mai
// (equivalent to apt-get autoremove)
Unattended-Upgrade::Remove-Unused-Dependencies "<%= node['apt']['unattended_upgrades']['remove_unused_dependencies'] ? 'true' : 'false' %>";
// Automatically reboot *WITHOUT CONFIRMATION* if a
// the file /var/run/reboot-required is found after the upgrade
// Automatically reboot *WITHOUT CONFIRMATION* if a
// the file /var/run/reboot-required is found after the upgrade
Unattended-Upgrade::Automatic-Reboot "<%= node['apt']['unattended_upgrades']['automatic_reboot'] ? 'true' : 'false' %>";
// If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately
// Default: "now"
<% if node['apt']['unattended_upgrades']['automatic_reboot'] -%>
// If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately. Default is "now"
Unattended-Upgrade::Automatic-Reboot-Time "<%= node['apt']['unattended_upgrades']['automatic_reboot_time'] %>";
<% end %>
<% if node['apt']['unattended_upgrades']['dl_limit'] -%>
// Use apt bandwidth limit feature, this example limits the download
// speed to 70kb/sec
<% if node['apt']['unattended_upgrades']['dl_limit'] -%>
// Acquire::http::Dl-Limit "70";
Acquire::http::Dl-Limit "<%= node['apt']['unattended_upgrades']['dl_limit'] %>";
<% end -%>
// Enable logging to syslog. Default is False
Unattended-Upgrade::SyslogEnable "<%= node['apt']['unattended_upgrades']['syslog_enable'] ? 'true' : 'false' %>";
// Specify syslog facility. Default is daemon
Unattended-Upgrade::SyslogFacility "<%= node['apt']['unattended_upgrades']['syslog_facility'] %>";
// specify any dpkg options you want to run
// for example if you wanted to upgrade and use
// the installed version of config files when
// resolving conflicts during an upgrade you
// typically need:
// Dpkg::Options {
// "--force-confdef";
// "--force-confold";
//};
<% unless node['apt']['unattended_upgrades']['dpkg_options'].empty? -%>
Dpkg::Options {
<% node['apt']['unattended_upgrades']['dpkg_options'].each do |option|%>
"<%= option %>";
<% end -%>
};
<% end -%>

View File

@ -1 +0,0 @@
~FC016

View File

@ -2,6 +2,27 @@
This file is used to list changes made in each version of the ark cookbook.
## 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)
- Use Ruby classes in resource properties - [@tas50](https://github.com/tas50)
- Simplify the platform check logic - [@tas50](https://github.com/tas50)
- Remove the .foocritic file - [@tas50](https://github.com/tas50)
- Remove long_description and recipe metadata - [@tas50](https://github.com/tas50)
- Expand testing - [@tas50](https://github.com/tas50)
- Remove Ubuntu 14.04 testing - [@tas50](https://github.com/tas50)
## 4.0.0 (2018-07-25)
- Support append_env_path property on Windows, which increases the minimum required Chef release to Chef 13.4
## 3.1.1 (2018-07-24)
- Remove ChefSpec matchers since these are autogenerated now
- Update specs to the latest platform versions
- Remove template out of defaults directory
- Remove dependency on the Windows cookbook
## 3.1.0 (2017-05-06)
- Ensure the dependencies get installed on Chef 13 Amazon Linux systems
@ -12,7 +33,7 @@ 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,15 +0,0 @@
<!-- This is a generated file. Please do not edit directly -->
# Maintainers
This file lists how this cookbook project is maintained. When making changes to the system, this file tells you who needs to review your patch - you need a review from an existing maintainer for the cookbook to provide a :+1: on your pull request. Additionally, you need to not receive a veto from a Lieutenant or the Project Lead.
Check out [How Cookbooks are Maintained](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD) for details on the process and how to become a maintainer or the project lead.
# Project Maintainer
* [Tim Smith](https://github.com/tas50)
# Maintainers
* [Jennifer Davis](https://github.com/sigje)
* [Tim Smith](https://github.com/tas50)
* [Thom May](https://github.com/thommay)

View File

@ -25,7 +25,7 @@ The `ark` resource will:
By default, the ark will not run again if the `:path` is not empty. Ark provides many actions to accommodate different use cases, such as `:dump`, `:cherry_pick`, `:put`, and `:install_with_make`.
At this time ark only handles files available from URLs using the [remote_file](http://docs.chef.io/resource_remote_file.html) provider. It does handle local files using the `file://` protocol.
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.
## Requirements
@ -36,7 +36,7 @@ At this time ark only handles files available from URLs using the [remote_file](
- Fedora
- FreeBSD
- SmartOS
- Mac OS X
- macOS
- openSUSE / SUSE Linux Enterprises
- Windows
@ -44,13 +44,11 @@ Should work on common Unix/Linux systems with typical userland utilities like ta
### Chef
- Chef 12.7+
- Chef 14+
### Cookbooks
- build-essential
- seven_zip
- windows
## Attributes
@ -66,7 +64,7 @@ Customize the attributes to suit site specific conventions and defaults.
## Resources
- `ark` - does the extract/build/configure
- `ark` - does the extract/build/configure
### Actions

View File

@ -58,7 +58,6 @@ module Ark
new_resource.path = defaults.path
new_resource.release_file = defaults.release_file
end
# rubocop:enable Metrics/AbcSize
def set_put_paths
new_resource.extension = defaults.extension

View File

@ -1,44 +0,0 @@
if defined?(ChefSpec)
ChefSpec.define_matcher :ark
def install_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :install, resource_name)
end
def dump_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :dump, resource_name)
end
def cherry_pick_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :cherry_pick, resource_name)
end
def put_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :put, resource_name)
end
def install_with_make_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :install_with_make, resource_name)
end
def configure_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :configure, resource_name)
end
def setup_py_build_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :setup_py_build, resource_name)
end
def setup_py_install_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :setup_py_install, resource_name)
end
def setup_py_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :setup_py, resource_name)
end
def unzip_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :unzip, resource_name)
end
end

View File

@ -25,9 +25,7 @@ module Ark
end
def sevenzip_command
if resource.strip_components <= 0
return sevenzip_command_builder(resource.path, 'x')
end
return sevenzip_command_builder(resource.path, 'x') if resource.strip_components <= 0
tmpdir = make_temp_directory.tr('/', '\\')
cmd = sevenzip_command_builder(tmpdir, 'x')

File diff suppressed because one or more lines are too long

16
cookbooks/ark/metadata.rb Normal file
View File

@ -0,0 +1,16 @@
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'
%w(ubuntu debian redhat centos suse opensuse opensuseleap scientific oracle amazon windows mac_os_x smartos freebsd).each do |os|
supports os
end
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'

View File

@ -18,6 +18,6 @@
# limitations under the License.
#
package node['ark']['package_dependencies'] unless %w(windows mac_os_x).include?(node['platform_family'])
package node['ark']['package_dependencies'] unless platform_family?('windows', 'mac_os_x')
include_recipe 'seven_zip' if node['platform_family'] == 'windows'
include_recipe 'seven_zip' if platform_family?('windows')

View File

@ -83,8 +83,16 @@ action :install do
action :nothing
end
# usually on windows there is no central directory with executables where the applications are linked
unless node['platform_family'] == 'windows'
if platform_family?('windows')
# usually on windows there is no central directory with executables where the applications are linked
# so ignore has_binaries for now
# Add to PATH permanently on Windows if append_env_path
windows_path "#{new_resource.path}/bin" do
action :add
only_if { new_resource.append_env_path }
end
else
# symlink binaries
new_resource.has_binaries.each do |bin|
link ::File.join(new_resource.prefix_bin, ::File.basename(bin)) do

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
# CN8M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berqJb2qr5Ke6U1mPV1T6G6TGdctKGCAg8wggIL
# 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

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2012-2017 David Joos
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -159,7 +159,7 @@ end
## License and Authors
Author: David Joos <development@davidjoos.com>
Copyright: 2016, David Joos
Copyright: 2016-2017, David Joos
Author: David Joos <david.joos@escapestudios.com>
Author: Escape Studios Development <dev@escapestudios.com>

View File

@ -14,7 +14,7 @@ if node['platform'] == 'windows'
default['composer']['global_install']['install_dir'] = 'C:\\Program\ Files\\Composer'
default['composer']['global_install']['bin_dir'] = 'C:\\ProgramData\\Composer'
else
default['composer']['url'] = 'http://getcomposer.org/composer.phar'
default['composer']['url'] = 'http://getcomposer.org/composer-stable.phar'
default['composer']['install_dir'] = '/usr/local/bin'
default['composer']['bin'] = "#{node['composer']['install_dir']}/composer"
default['composer']['install_globally'] = true
@ -27,3 +27,4 @@ end
default['composer']['global_configs'] = {}
default['composer']['home_dir'] = nil
default['composer']['php_recipe'] = 'php::default'
default['composer']['self_update_channel'] = nil

File diff suppressed because one or more lines are too long

View File

@ -4,9 +4,10 @@ maintainer_email 'development@davidjoos.com'
license 'MIT'
description 'Installs/Configures Composer'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '2.6.1'
version '2.7.0'
chef_version '>= 0.10.0' if respond_to?(:chef_version)
%w(debian ubuntu redhat centos fedora scientific amazon windows).each do |os|
%w[debian ubuntu redhat centos fedora scientific amazon windows].each do |os|
supports os
end

View File

@ -13,17 +13,14 @@ end
action :install do
install_global_install
new_resource.updated_by_last_action(true)
end
action :remove do
install_global_remove
new_resource.updated_by_last_action(true)
end
action :update do
install_global_update
new_resource.updated_by_last_action(true)
end
def install_global_install

View File

@ -13,7 +13,6 @@ end
action :install do
make_execute 'install'
new_resource.updated_by_last_action(true)
end
action :require do
@ -22,12 +21,10 @@ end
action :update do
make_execute 'update'
new_resource.updated_by_last_action(true)
end
action :dump_autoload do
make_execute 'dump-autoload'
new_resource.updated_by_last_action(true)
end
action :remove do

View File

@ -10,9 +10,9 @@ include_recipe node['composer']['php_recipe']
if node['platform'] == 'windows'
windows_package 'Composer - PHP Dependency Manager' do
source node['composer']['url']
options %w(
options %w[
/VERYSILENT
).join(' ')
].join(' ')
end
install_dir = "#{node['composer']['install_dir'].tr('/', '\\')}\\bin"

View File

@ -7,9 +7,15 @@
include_recipe 'composer::install'
channel = if node['composer']['self_update_channel'].nil?
''
else
" --#{node['composer']['self_update_channel']}"
end
execute 'composer-self_update' do
cwd node['composer']['install_dir']
command 'composer self-update'
command 'composer self-update' + channel
environment 'COMPOSER_HOME' => Composer.home_dir(node)
action :run
ignore_failure true

View File

@ -17,8 +17,3 @@ attribute :quiet, :kind_of => [TrueClass, FalseClass], :default => true
attribute :optimize_autoloader, :kind_of => [TrueClass, FalseClass], :default => false
attribute :prefer_dist, :kind_of => [TrueClass, FalseClass], :default => false
attribute :prefer_source, :kind_of => [TrueClass, FalseClass], :default => false
def initialize(*args)
super
@action = :install
end

View File

@ -22,8 +22,3 @@ attribute :user, :kind_of => String, :default => 'root'
attribute :group, :kind_of => String, :default => 'root'
attribute :umask, :kind_of => [String, Integer], :default => '0002'
attribute :environment, :kind_of => Hash, :default => {}
def initialize(*args)
super
@action = :install
end

View File

@ -1,142 +0,0 @@
# dmg Cookbook CHANGELOG
This file is used to list changes made in each version of the dmg cookbook.
## 4.1.1 (2018-04-06)
- The dmg_package resource is now included in Chef 14 and this cookbook has been deprecated. We highly recommend updating to Chef 14 so you can use this resource without the need for a cookbook dependency.
- Validate the type field in the resource
- Remove the now autogenerated ChefSpec matchers
## 4.1.0 (2017-11-15)
- Adds allow_untrusted property for older packages that aren't signed
- Resolve Chef 14 deprecation warnings
- Minor testing updates and cleanup
## 4.0.0 (2017-04-27)
- Converted the existing LWRP to a custom resource which increases the required chef-client release to 12.5+
- Added Test Kitchen config with private atlas boxes for 10.10 and 10.11
- Added a test recipe to installed Tunnelblick
- Added an Inspec test to confirm that Tunnelblick actually installs
- Remove unused attributes and the entire attributes file
- Add a warning if you include the default recipe on your runlist
- Update specs to run on 10.12 and against the test recipe since dmg::default is empty and the existing spec tested nothing
## 3.1.1 (2017-04-11)
- Cookstyle updates
- Test with Local Delivery and not Rake
- Update apache2 license string
- Remove foodcritic exclusions
## 3.1.0 (2017-01-18)
- Fixed pkg,mpkg installation when it was using mounted app name while it was actually mounted under different name for some applications
- Cookstyle fixes
## 3.0.0 (2016-09-06)
- Add chef_version metadata
- Run the specs against a mock of OS X
- Testing updates
- Require Chef 12+
## v2.4.0 (2016-04-26)
- Added support for local .dmg files with the file property. See the readme for details
- Resolved all rubocop warnings
## v2.3.0 (2015-10-20)
- Add new headers property to the LWRP for custom http headers. See the readme for more information
- Removed pivotal tracker example in the readme
- Added travis and cookbook version badges to the readme
- Added a .foodcritic file to exclude rules
- Updated chefignore and .gitignore files
- Updated platforms in Test Kitchen
- Added standard Rubocop file
- Updated Travis to test using ChefDK for the latest deps
- Added a Berksfile
- Updated contributing and testing docs
- Updated Gemfile with the latest testing deps
- Added maintainers.md and maintainers.toml
- Added rakefile for simplified testing
- Added source_url and issues_url metadata
- Added basic converge chefspec
## v2.2.2 (2014-11-12)
- # 23, add chefspec matchers
## v2.2.0 (2014-02-25)
- [COOK-4285] Accept long EULAs
## v2.1.4 (2014-01-26)
- [COOK-4157] - dmg_package LWRP broken due to "puts" instead of "system"
- [COOK-4065] - dmg cookbook outputs the name of packages when checking if they are installed
## v2.1.2
Cleaning up merge errors
## v2.1.0
### Bug
- **[COOK-3946](https://tickets.chef.io/browse/COOK-3946)** - Syntax error in resources/package.rb
- **[COOK-2672](https://tickets.chef.io/browse/COOK-2672)** - EULA for package is displayed instead accepted
## v2.0.8
Adding a Chef 10 compatibility check in provider
## v2.0.6
# BUG
- [COOK-3302] - Sometimes hdiutil detach fails due to cfprefsd running in background
# IMPROVEMENT
- Adding foodcritic and rubocop to .travis.yml
## v2.0.4
### Bug
- **[COOK-3331](https://tickets.chef.io/browse/COOK-3331)** - Fix an issue where `dmg_package` with no source raises an exception
## v2.0.2
### Bug
- **[COOK-3578](https://tickets.chef.io/browse/COOK-3578)** - Support `package_id`s with spaces
- **[COOK-3302](https://tickets.chef.io/browse/COOK-3302)** - Fix an issue where `hdiutil detach` fails due to `cfprefsd` running in the background
## v2.0.0
### Bug
- **[COOK-3389](https://tickets.chef.io/browse/COOK-3389)** - Use `rsync` instead of `cp` (potentially a breaking change on some systems)
## v1.1.0
- [COOK-1847] - accept owner parameter for installing packages
## v1.0.0
- [COOK-852] - Support "pkg" in addition to "mpkg" package types
## v0.7.0
- [COOK-854] - use `cp -R` instead of `cp -r`
- [COOK-855] - specify a file or directory to check for prior install
## v0.6.0
- option to install software that is an .mpkg inside a .dmg
- ignore failure on chmod in case mode is already set, or is root owned

View File

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

View File

@ -1,149 +0,0 @@
The dmg_package resource is now included in Chef 14 and this cookbook has been deprecated. We highly recommend updating to Chef 14 so you can use this resource without the need for a cookbook dependency.
# dmg Cookbook
[![Build Status](https://travis-ci.org/chef-cookbooks/dmg.svg?branch=master)](https://travis-ci.org/chef-cookbooks/dmg) [![Cookbook Version](https://img.shields.io/cookbook/v/dmg.svg)](https://supermarket.chef.io/cookbooks/dmg)
Resource to install OS X applications (.app) from dmg files.
## Requirements
### Platforms
- macOS
### Chef
- Chef 12.5+
### Cookbooks
- none
## Resources/Providers
### dmg_package
This resource will install a DMG "Package". It will retrieve the DMG from a remote URL, mount it using OS X's `hdid`, copy the application (.app directory) to the specified destination (/Applications), and detach the image using `hdiutil`. The dmg file will be stored in the `Chef::Config[:file_cache_path]`. If you want to install an application that has already been downloaded (not using the `source` parameter), copy it to the appropriate location. You can find out what directory this is with the following command on the node to run chef:
```bash
knife exec -E 'p Chef::Config[:file_cache_path]' -c /etc/chef/client.rb
```
Optionally, the LWRP can install an "mpkg" or "pkg" package using installer(8).
#### Actions
- :install - Installs the application.
#### Parameter attributes:
- `app` - This is the name of the application used by default for the /Volumes directory and the .app directory copied to /Applications.
- `source` - remote URL for the dmg to download if specified. Default is nil.
- `file` - local dmg full file path. Default is nil.
- `owner` - owner that should own the package installation.
- `destination` - directory to copy the .app into. Default is /Applications.
- `checksum` - sha256 checksum of the dmg to download. Default is nil.
- `type` - type of package, "app", "pkg" or "mpkg". Default is "app". When using "pkg" or "mpkg", the destination must be /Applications.
- `volumes_dir` - Directory under /Volumes where the dmg is mounted. Not all dmgs are mounted into a /Volumes location matching the name of the dmg. If not specified, this will use the name attribute.
- `package_id` - Package id registered with pkgutil when a pkg or mpkg is installed
- `dmg_name` - Specify the name of the dmg if it is not the same as `app`, or if the name has spaces.
- `dmg_passphrase` - Specify a passphrase to use to unencrypt the dmg while mounting.
- `accept_eula` - Specify whether to accept the EULA. Certain dmgs require acceptance of EULA before mounting. Can be true or false, defaults to false.
- `headers` - Allows custom HTTP headers (like cookies) to be set on the remote_file resource.
- `allow_untrusted` - Allows packages with untrusted certs to be installed.
#### Examples
Install `/Applications/Tunnelblick.app` from the primary download site.
```ruby
dmg_package 'Tunnelblick' do
source 'https://tunnelblick.net/release/Tunnelblick_3.7.0_build_4790.dmg'
checksum '5053038aa8caf7dea66dcab11d6d240672216e6546eff4c2622e216c61af85e5'
action :install
end
```
Install Google Chrome. Uses the `dmg_name` because the application name has spaces. Installs in `/Applications/Google Chrome.app`.
```ruby
dmg_package 'Google Chrome' do
dmg_name 'googlechrome'
source 'https://dl-ssl.google.com/chrome/mac/stable/GGRM/googlechrome.dmg'
checksum '7daa2dc5c46d9bfb14f1d7ff4b33884325e5e63e694810adc58f14795165c91a'
action :install
end
```
Install Dropbox. Uses `volumes_dir` because the mounted directory is different than the name of the application directory. Installs in `/Applications/Dropbox.app`.
```ruby
dmg_package 'Dropbox' do
volumes_dir 'Dropbox Installer'
source 'http://www.dropbox.com/download?plat=mac'
checksum 'b4ea620ca22b0517b75753283ceb82326aca8bc3c86212fbf725de6446a96a13'
action :install
end
```
Install MacIrssi to `~/Applications` from the local file downloaded to the cache path into an Applications directory in the current user's home directory. Chef should run as a non-root user for this.
```ruby
directory "#{ENV['HOME']}/Applications"
dmg_package 'MacIrssi' do
destination "#{ENV['HOME']}/Applications"
action :install
end
```
Install Virtualbox to `/Applications` from the .mpkg:
```ruby
dmg_package 'Virtualbox' do
source 'http://dlc.sun.com.edgesuite.net/virtualbox/4.0.8/VirtualBox-4.0.8-71778-OSX.dmg'
type 'mpkg'
end
```
Install pgAdmin to `/Applications` and automatically accept the EULA:
```ruby
dmg_package 'pgAdmin3' do
source 'http://wwwmaster.postgresql.org/redir/198/h/pgadmin3/release/v1.12.3/osx/pgadmin3-1.12.3.dmg'
checksum '9435f79d5b52d0febeddfad392adf82db9df159196f496c1ab139a6957242ce9'
accept_eula true
end
```
Install Silverlight, with idempotence check based on pkgutil:
```ruby
dmg_package 'Silerlight' do
source 'http://silverlight.dlservice.microsoft.com/download/D/C/2/DC2D5838-9138-4D25-AA92-52F61F7C51E6/runtime/Silverlight.dmg'
type 'pkg'
checksum '6d4a0ad4552d9815531463eb3f467fb8cf4bffcc'
package_id 'com.microsoft.installSilverlightPlugin'
end
```
## License & Authors
**Author:** Cookbook Engineering Team ([cookbooks@chef.io](mailto:cookbooks@chef.io))
**Copyright:** 2011-2017, 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.
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.
```

File diff suppressed because one or more lines are too long

View File

@ -1,102 +0,0 @@
#
# Author:: Joshua Timberman (<jtimberman@chef.io>)
# Cookbook:: dmg
# Resource:: package
#
# Copyright:: 2011-2017, 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.
# 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.
#
property :app, String, name_property: true
property :source, String
property :file, String
property :owner, String
property :destination, String, default: '/Applications'
property :checksum, String
property :volumes_dir, String
property :dmg_name, String
property :type, String, default: 'app', equal_to: %w(app pkg mpkg)
property :installed, [true, false], default: false, desired_state: false
property :package_id, String
property :dmg_passphrase, String
property :accept_eula, [true, false], default: false
property :headers, [Hash, nil], default: nil
property :allow_untrusted, [true, false], default: false
load_current_value do |new_resource|
if ::File.directory?("#{new_resource.destination}/#{new_resource.app}.app")
Chef::Log.info "Already installed; to upgrade, remove \"#{new_resource.destination}/#{new_resource.app}.app\""
installed true
elsif shell_out("pkgutil --pkgs='#{new_resource.package_id}'").exitstatus == 0
Chef::Log.info "Already installed; to upgrade, try \"sudo pkgutil --forget '#{new_resource.package_id}'\""
installed true
else
installed false
end
end
action :install do
unless current_resource.installed
volumes_dir = new_resource.volumes_dir ? new_resource.volumes_dir : new_resource.app
dmg_name = new_resource.dmg_name ? new_resource.dmg_name : new_resource.app
dmg_file = if new_resource.file.nil?
"#{Chef::Config[:file_cache_path]}/#{dmg_name}.dmg"
else
new_resource.file
end
remote_file "#{dmg_file} - #{new_resource.name}" do
path dmg_file
source new_resource.source
headers new_resource.headers if new_resource.headers
checksum new_resource.checksum if new_resource.checksum
end if new_resource.source
passphrase_cmd = new_resource.dmg_passphrase ? "-passphrase #{new_resource.dmg_passphrase}" : ''
ruby_block "attach #{dmg_file}" do
block do
cmd = shell_out("hdiutil imageinfo #{passphrase_cmd} '#{dmg_file}' | grep -q 'Software License Agreement: true'")
software_license_agreement = cmd.exitstatus == 0
raise "Requires EULA Acceptance; add 'accept_eula true' to package resource" if software_license_agreement && !new_resource.accept_eula
accept_eula_cmd = new_resource.accept_eula ? 'echo Y | PAGER=true' : ''
shell_out!("#{accept_eula_cmd} hdiutil attach #{passphrase_cmd} '#{dmg_file}' -mountpoint '/Volumes/#{volumes_dir}' -quiet")
end
not_if "hdiutil info #{passphrase_cmd} | grep -q 'image-path.*#{dmg_file}'"
end
case new_resource.type
when 'app'
execute "rsync --force --recursive --links --perms --executability --owner --group --times '/Volumes/#{volumes_dir}/#{new_resource.app}.app' '#{new_resource.destination}'" do
user new_resource.owner if new_resource.owner
end
declare_resource(:file, "#{new_resource.destination}/#{new_resource.app}.app/Contents/MacOS/#{new_resource.app}") do
mode '755'
ignore_failure true
end
when 'mpkg', 'pkg'
install_cmd = "installation_file=$(ls '/Volumes/#{volumes_dir}' | grep '.#{new_resource.type}$') && sudo installer -pkg \"/Volumes/#{volumes_dir}/$installation_file\" -target /"
install_cmd += ' -allowUntrusted' if new_resource.allow_untrusted
execute install_cmd do
# Prevent cfprefsd from holding up hdiutil detach for certain disk images
environment('__CFPREFERENCES_AVOID_DAEMON' => '1')
end
end
execute "hdiutil detach '/Volumes/#{volumes_dir}' || hdiutil detach '/Volumes/#{volumes_dir}' -force"
end
end

View File

@ -1 +0,0 @@
~FC016

View File

@ -2,6 +2,63 @@
This file is used to list changes made in each version of the git cookbook.
## 10.0.0 (2019-10-16)
- Add testing for CentOS 8, openSUSE 15, Ubuntu 18.04 in Travis
- Require Chef Infra Client 14 or later so we can drop the dependency on build-essential
- Resolve multiple cookstyle warnings
## 9.0.1 (2018-06-02)
- Update the platforms we test on
- Remove extra attr_accessor in config and requires
- Bump git version to 2.17.1 to resolve CVE
## 9.0.0 (2018-03-08)
- Remove the dependency on the homebrew cookbook by not automatically installing homebrew in the git resource on macOS systems. Homebrew needs to be setup before this resource runs and that should probably be the very first thing you do on a macOS system
- Use the build_essential resource instead of including the default recipe. This requires version 5.0 or later of the build-essential cookbook and allows us to use the build_essential resource that will be built into Chef 14 when that ships
- Remove extra includes in the resources that weren't necessary
- Updated testing to include Fedora 27, Ubuntu 18.04, Debian 9, macOS 10.12, and Windows 2016
## 8.0.1 (2018-02-10)
- Resolve the new FC118 foodcritic warning
- Remove the ChefSpec matchers which are auto generated now
- Resolve FC104 warning
## 8.0.0 (2017-09-01)
### Breaking Changes
- macOS resource now properly executes and uses homebrew to install git instead of dmg and packages posted to SourceForge
- Default to Git 2.9.5 now, which properly compiles on Fedora / Amazon Linux
## Other Changes
- Fixed support for Amazon Linux on Chef 13
- Unified the package setup for source installs which fixes Amazon/Fedora
- Removed an entirely duplicate service provider
- Remove unused runit templates
- Properly fail when we're on an unsupported platform
## 7.0.0 (2017-09-01)
- Remove support for RHEL 5 which removes the need for the yum-epel cookbook
- Move templates out of the default directory now that we require Chef 12
- Remove support for Ubuntu 10.04
- Remove the version requirement on mac_os_x in the metadata
- Move maintainer information to the readme
- Expand Travis testing
## 6.1.0 (2017-05-30)
- Test with Local Delivery and not Rake
- Remove EOL platforms from the kitchen configs
- Use a SPDX standard license string
- Updated default versions documented in README to fix Issue #120.
- Remove class_eval and require chef 12.7+
## 6.0.0 (2017-02-14)
- Fail on deprecations is now enabled so we're fully Chef 13 compatible

View File

@ -1,15 +0,0 @@
<!-- This is a generated file. Please do not edit directly -->
# Maintainers
This file lists how this cookbook project is maintained. When making changes to the system, this file tells you who needs to review your patch - you need a review from an existing maintainer for the cookbook to provide a :+1: on your pull request. Additionally, you need to not receive a veto from a Lieutenant or the Project Lead.
Check out [How Cookbooks are Maintained](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD) for details on the process and how to become a maintainer or the project lead.
# Project Maintainer
* [Tim Smith](https://github.com/tas50)
# Maintainers
* [Jennifer Davis](https://github.com/sigje)
* [Tim Smith](https://github.com/tas50)
* [Thom May](https://github.com/thommay)

View File

@ -20,17 +20,17 @@ The following platforms have been tested with Test Kitchen:
|---------------+-------|
| centos-7 | X |
|---------------+-------|
| centos-8 | X |
|---------------+-------|
| fedora | X |
|---------------+-------|
| debian-7 | X |
| debian-9 | X |
|---------------+-------|
| debian-8 | X |
|---------------+-------|
| ubuntu-14.04 | X |
| debian-10 | X |
|---------------+-------|
| ubuntu-16.04 | X |
|---------------+-------|
| openSUSE 13.2 | X |
| ubuntu-18.04 | X |
|---------------+-------|
| openSUSE Leap | X |
|---------------+-------|
@ -38,13 +38,11 @@ The following platforms have been tested with Test Kitchen:
### Chef
- Chef 12.5+
- Chef 14+
### Cookbooks
- depends 'build-essential' - For compiling from source
- depends 'dmg' - For macOS Support
- depends 'yum-epel' - For older RHEL platform_family support
- none
## Usage
@ -60,6 +58,8 @@ Add `git::default`, `git::source` or `git::windows` to your run_list OR add `dep
The `git_client` resource manages the installation of a Git client on a machine.
`Note`: on macOS systems homebrew must first be installed on the system before running this resource. Prior to version 9.0 of this cookbook homebrew was automatically installed.
#### Example
```ruby
@ -68,6 +68,17 @@ git_client 'default' do
end
```
#### Example of source install
```ruby
git_client 'source' do
provider Chef::Provider::GitClient::Source
source_version '2.14.2'
source_checksum 'a03a12331d4f9b0f71733db9f47e1232d4ddce00e7f2a6e20f6ec9a19ce5ff61'
action :install
end
```
### git_config
The `git_config` resource manages the configuration of Git client on a machine.
@ -96,23 +107,15 @@ Currently, there are distinct sets of resource properties, used by the providers
- `source_prefix` - Defaults to '/usr/local'
- `source_url` - Defaults to a calculated URL based on source_version
- `source_version` - Defaults to 2.7.4
- `source_version` - Defaults to 2.8.1
- `source_use_pcre` - configure option for build. Defaults to false
- `source_checksum` - Defaults to a known value for the 2.7.4 source tarball
# used by OSX package providers
- `osx_dmg_app_name` - Defaults to 'git-2.7.1-intel-universal-mavericks'
- `osx_dmg_package_id` - Defaults to 'GitOSX.Installer.git271.git.pkg'
- `osx_dmg_volumes_dir` - Defaults to 'Git 2.7.1 Mavericks Intel Universal'
- `osx_dmg_url` - Defaults to Sourceforge
- `osx_dmg_checksum` - Defaults to the value for 2.7.1
- `source_checksum` - Defaults to a known value for the 2.8.1 source tarball
# used by the Windows package providers
- `windows_display_name` - Windows display name
- `windows_package_url` - Defaults to the Internet
- `windows_package_checksum` - Defaults to the value for 2.7.4
- `windows_package_checksum` - Defaults to the value for 2.8.1
## Recipes
@ -127,11 +130,6 @@ This cookbook ships with ready to use, attribute driven recipes that utilize the
- `node['git']['checksum']` - package SHA256 checksum
- `node['git']['display_name']` - `windows_package` resource Display Name (makes the package install idempotent)
### Mac OS X
- `node['git']['osx_dmg']['url']` - URL to git package
- `node['git']['osx_dmg']['checksum']` - package SHA256 checksum
### Linux
- `node['git']['prefix']` - git install directory
@ -140,11 +138,13 @@ This cookbook ships with ready to use, attribute driven recipes that utilize the
- `node['git']['checksum']` - tarball SHA256 checksum
- `node['git']['use_pcre']` - if true, builds git with PCRE enabled
## License & Authors
## Maintainers
- Author:: Joshua Timberman ([joshua@chef.io](mailto:joshua@chef.io))
- Author:: Sean OMeara ([sean@sean.io](mailto:sean@sean.io))
- Copyright:: 2009-2017, Chef Software, Inc.
This cookbook is maintained by Chef's Community Cookbook Engineering team. Our goal is to improve cookbook quality and to aid the community in contributing to cookbooks. To learn more about our team, process, and design goals see our [team documentation](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/COOKBOOK_TEAM.MD). To learn more about contributing to cookbooks like this see our [contributing documentation](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD), or if you have general questions about this cookbook come chat with us in #cookbok-engineering on the [Chef Community Slack](http://community-slack.chef.io/)
## License
**Copyright:** 2009-2017, Chef Software, Inc.
```
Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -3,7 +3,7 @@
# Cookbook:: git
# Attributes:: default
#
# Copyright:: 2008-2016, Chef Software, Inc.
# Copyright:: 2008-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.
@ -29,17 +29,11 @@ when 'windows'
end
default['git']['url'] = 'https://github.com/git-for-windows/git/releases/download/v%{version}.windows.1/Git-%{version}-%{architecture}-bit.exe'
default['git']['display_name'] = "Git version #{node['git']['version']}"
when 'mac_os_x'
default['git']['osx_dmg']['app_name'] = 'git-2.8.1-intel-universal-mavericks'
default['git']['osx_dmg']['volumes_dir'] = 'Git 2.8.1 Mavericks Intel Universal'
default['git']['osx_dmg']['package_id'] = 'GitOSX.Installer.git281Universal.git.pkg'
default['git']['osx_dmg']['url'] = 'http://sourceforge.net/projects/git-osx-installer/files/git-2.8.1-intel-universal-mavericks.dmg/download'
default['git']['osx_dmg']['checksum'] = 'c2912895a1e2018d9be4c646765d511f7c82e0114275505dbd13d1ac70c62023'
else
default['git']['prefix'] = '/usr/local'
default['git']['version'] = '2.8.1'
default['git']['version'] = '2.17.1'
default['git']['url'] = 'https://nodeload.github.com/git/git/tar.gz/v%{version}'
default['git']['checksum'] = 'e08503ecaf5d3ac10c40f22871c996a392256c8d038d16f52ebf974cba29ae42'
default['git']['checksum'] = '690f12cc5691e5adaf2dd390eae6f5acce68ae0d9bd9403814f8a1433833f02a'
default['git']['use_pcre'] = false
end

View File

@ -3,9 +3,8 @@ module GitCookbook
# linux packages default to distro offering
def parsed_package_name
return new_resource.package_name if new_resource.package_name
return 'git-core' if node['platform'] == 'ubuntu' && node['platform_version'].to_f < 10.10
return 'developer/versioning/git' if node['platform'] == 'omnios'
return 'scmgit' if node['platform'] == 'smartos'
return 'developer/versioning/git' if platform?('smartos')
return 'scmgit' if platform?('smartos')
'git'
end
@ -21,7 +20,7 @@ module GitCookbook
def parsed_source_checksum
return new_resource.source_checksum if new_resource.source_checksum
'8d53703d75890c03e26a915c7af3b7b98d8cfb94382f685a9bcbee1eeaec47b4' # 2.7.4 tarball
'690f12cc5691e5adaf2dd390eae6f5acce68ae0d9bd9403814f8a1433833f02a' # 2.17.1 tarball
end
# windows

View File

@ -1,16 +0,0 @@
if defined?(ChefSpec)
ChefSpec.define_matcher(:git_client)
ChefSpec.define_matcher(:git_service)
def set_git_config(resource_name) # rubocop:disable Style/AccessorMethodName
ChefSpec::Matchers::ResourceMatcher.new(:git_config, :set, resource_name)
end
def install_git_client(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:git_client, :install, resource_name)
end
def install_git_service(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:git_service, :install, resource_name)
end
end

View File

@ -1,12 +1,6 @@
class Chef
class Provider
class GitClient < Chef::Provider::LWRPBase
use_inline_resources
def whyrun_supported?
true
end
include GitCookbook::Helpers
end
end

View File

@ -2,20 +2,10 @@ class Chef
class Provider
class GitClient
class Osx < Chef::Provider::GitClient
include Chef::DSL::IncludeRecipe
provides :git_client, os: 'mac_os_x'
provides :git_client, platform: 'mac_os_x'
action :install do
dmg_package 'GitOSX-Installer' do
app new_resource.osx_dmg_app_name
package_id new_resource.osx_dmg_package_id
volumes_dir new_resource.osx_dmg_volumes_dir
source new_resource.osx_dmg_url
checksum new_resource.osx_dmg_checksum
type 'pkg'
action :install
end
package 'git'
end
action :delete do

View File

@ -2,14 +2,9 @@ class Chef
class Provider
class GitClient
class Package < Chef::Provider::GitClient
include Chef::DSL::IncludeRecipe
provides :git_client, os: 'linux'
action :install do
# FIXME: rhel 5
include_recipe 'yum-epel' if node['platform_family'] == 'rhel' && node['platform_version'].to_i == 5
# Software installation
package "#{new_resource.name} :create #{parsed_package_name}" do
package_name parsed_package_name

View File

@ -2,30 +2,16 @@ class Chef
class Provider
class GitClient
class Source < Chef::Provider::GitClient
include Chef::DSL::IncludeRecipe
action :install do
return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe" unless platform_family?('rhel', 'suse', 'fedora', 'debian')
raise "#{node['platform']} is not supported by the git_client source resource" unless platform_family?('rhel', 'suse', 'fedora', 'debian', 'amazon')
include_recipe 'build-essential'
include_recipe 'yum-epel' if node['platform_family'] == 'rhel' && node['platform_version'].to_i == 5
build_essential 'install compilation tools for git'
# move this to attributes.
case node['platform_family']
when 'fedora'
pkgs = %w(tar openssl-devel libcurl-devel expat-devel perl-ExtUtils-MakeMaker)
when 'rhel'
case node['platform_version'].to_i
when 5
pkgs = %w(tar expat-devel gettext-devel curl-devel openssl-devel zlib-devel)
pkgs += %w( pcre-devel ) if new_resource.source_use_pcre
when 6, 7
pkgs = %w(tar expat-devel gettext-devel libcurl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel)
pkgs += %w( pcre-devel ) if new_resource.source_use_pcre
else
pkgs = %w(expat-devel gettext-devel curl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel) if node['platform'] == 'amazon'
pkgs += %w( pcre-devel ) if new_resource.source_use_pcre
end
when 'rhel', 'fedora', 'amazon'
pkgs = %w(tar expat-devel gettext-devel libcurl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel)
pkgs += %w( pcre-devel ) if new_resource.source_use_pcre
when 'debian'
pkgs = %w(libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev)
pkgs += %w( libpcre3-dev ) if new_resource.source_use_pcre
@ -52,7 +38,7 @@ class Chef
command <<-COMMAND
(mkdir git-#{new_resource.source_version} && tar -zxf git-#{new_resource.source_version}.tar.gz -C git-#{new_resource.source_version} --strip-components 1)
(cd git-#{new_resource.source_version} && make prefix=#{new_resource.source_prefix} #{additional_make_params} install)
COMMAND
COMMAND
not_if "git --version | grep #{new_resource.source_version}"
not_if "#{new_resource.source_prefix}/bin/git --version | grep #{new_resource.source_version}"
end

View File

@ -3,8 +3,6 @@ class Chef
class Provider
class GitClient
class Windows < Chef::Provider::GitClient
include Chef::DSL::IncludeRecipe
provides :git_client, os: 'windows'
action :install do
@ -22,7 +20,7 @@ class Chef
else
ENV['ProgramW6432'] || ENV['ProgramFiles']
end
GIT_PATH = "#{PROGRAM_FILES}\\Git\\Cmd".freeze
GIT_PATH = "#{PROGRAM_FILES}\\Git\\Cmd"
# COOK-3482 - windows_path resource doesn't change the current process
# environment variables. Therefore, git won't actually be on the PATH
@ -36,7 +34,7 @@ class Chef
end
windows_path GIT_PATH do
notifies :create, 'ruby_block[Add Git Path]', :immediately
notifies :run, 'ruby_block[Add Git Path]', :immediately
action :add
end
end

View File

@ -1,19 +1,13 @@
class Chef
class Provider
class GitClient < Chef::Provider::LWRPBase
use_inline_resources
def whyrun_supported?
true
end
include Chef::DSL::IncludeRecipe
include GitCookbook::Helpers
provides :git_service, os: 'linux'
action :create do
return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe" if node['platform'] == 'windows'
return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe" if platform?('windows')
include_recipe 'git'

View File

@ -1,55 +0,0 @@
class Chef
class Provider
class GitClient < Chef::Provider::LWRPBase
use_inline_resources
def whyrun_supported?
true
end
include Chef::DSL::IncludeRecipe
include GitCookbook::Helpers
action :create do
return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe" if node['platform'] == 'windows'
include_recipe 'git'
directory new_resource.service_base_path do
owner 'root'
group 'root'
mode '0755'
end
case node['platform_family']
when 'debian'
package 'xinetd'
when 'rhel'
package 'git-daemon'
else
log 'Platform requires setting up a git daemon service script.'
log "Hint: /usr/bin/git daemon --export-all --user=nobody --group=daemon --base-path=#{new_resource.service_base_path}"
return
end
template '/etc/xinetd.d/git' do
backup false
source 'git-xinetd.d.erb'
owner 'root'
group 'root'
mode '0644'
variables(
git_daemon_binary: value_for_platform_family(
'debian' => '/usr/lib/git-core/git-daemon',
'rhel' => '/usr/libexec/git-core/git-daemon'
)
)
end
service 'xinetd' do
action [:enable, :restart]
end
end
end
end
end

File diff suppressed because one or more lines are too long

26
cookbooks/git/metadata.rb Normal file
View File

@ -0,0 +1,26 @@
name 'git'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache-2.0'
description 'Installs git and/or sets up a Git server daemon'
version '10.0.0'
supports 'amazon'
supports 'centos'
supports 'debian'
supports 'fedora'
supports 'freebsd'
supports 'mac_os_x'
supports 'omnios'
supports 'oracle'
supports 'redhat'
supports 'smartos'
supports 'scientific'
supports 'suse'
supports 'opensuseleap'
supports 'ubuntu'
supports 'windows'
source_url 'https://github.com/chef-cookbooks/git'
issues_url 'https://github.com/chef-cookbooks/git/issues'
chef_version '>= 14'

View File

@ -2,7 +2,7 @@
# Cookbook:: git
# Recipe:: default
#
# Copyright:: 2008-2016, Chef Software, Inc.
# Copyright:: 2008-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:: git
# Recipe:: package
#
# Copyright:: 2008-2016, Chef Software, Inc.
# Copyright:: 2008-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.
@ -17,17 +17,6 @@
# limitations under the License.
case node['platform']
when 'mac_os_x'
# FIXME: The resource has three distinct groups of properties used in
# different providers... should we make multiple resource types instead?
git_client 'default' do
osx_dmg_app_name node['git']['osx_dmg']['app_name']
osx_dmg_package_id node['git']['osx_dmg']['package_id']
osx_dmg_volumes_dir node['git']['osx_dmg']['volumes_dir']
osx_dmg_url node['git']['osx_dmg']['url']
osx_dmg_checksum node['git']['osx_dmg']['checksum']
action :install
end
when 'windows'
include_recipe 'git::windows'
else

View File

@ -2,7 +2,7 @@
# Cookbook:: git
# Recipe:: server
#
# Copyright:: 2009-2016, Chef Software, Inc.
# Copyright:: 2009-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:: git
# Recipe:: windows
#
# Copyright:: 2008-2016, Chef Software, Inc.
# Copyright:: 2008-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

@ -1,4 +1,4 @@
property :key, String, name_attribute: true
property :key, String, name_property: true
property :value, String
property :scope, equal_to: %w(local global system), default: 'global', desired_state: false
property :path, String, desired_state: false
@ -6,10 +6,6 @@ property :user, String, desired_state: false
property :group, String, desired_state: false
property :options, String, desired_state: false
attr_accessor :exists
require 'mixlib/shellout'
def initialize(*args)
super
@ -38,7 +34,7 @@ action :set do
end
end
action_class.class_eval do
action_class do
def config_cmd
"git config --#{new_resource.scope}"
end

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec svlogd -tt ./main

View File

@ -1,3 +0,0 @@
#!/bin/sh
exec 2>&1
exec /usr/bin/git daemon <%= node['git']['server']['export_all'] ? '--export-all' : nil %> --user=nobody --group=daemon --syslog --base-path=<%= node["git"]["server"]["base_path"] %> <%= node["git"]["server"]["base_path"] %>

View File

@ -0,0 +1,98 @@
# CHANGELOG for golang
This file is used to list changes made in each version of golang.
## 4.1.0
- Create a custom resource to install Go from source or by downloading a package
## 4.0.0
- Update testing setup:
- Use Chef Workstation instead of Rubygems
- Includes dropping `foodcritic` in favor of current `cookstyle`
- Add more recent & current distro versions
- Add very basic unit tests
- Use GitHub Actions instead of Travis CI
- Refactor minitest to Inspec
- Refactor to use current style of Chef Custom Resource
- Update default version to Go v1.14.4
- Use `build_essential` when building from source
- Requires Chef >= 14.0.0
- Omit attempting to install `bzr` on CentOS 8, they do not have that package available
- Utilize default Chef order-of-operations instead of `notifies`
- Use `ark` resource to simplify download & installation of binary & source
- Clean up unnecessary env vars from source build
- Build from source per [official Go docs](https://golang.org/doc/install/source)
- Use native resources instead of shell commands when building from source
- Set `$PATH` in `golang.sh` so that the existing values are last, per general practice
- Tighten up `golang_package` so it does not perform actions at compile time, it uses `execute` in favor of `bash` resources, and in general is more Chef-y
- Update tests to validate that non-root users can install Go and Go packages
- Refactor attributes to add ability to install a version from source that differs from the packaged version (which is needed to build from source)
## 3.0.0
- rename to `chef-golang` so that metadata name matches repositoriy name
## 2.0.0
- change attribute namespace to `node['golang']`
## 1.7.2
- Better chef12,13 support
- Ruby 2.3
- Update gems, lint
## 1.7.1
- Create a temporary directory
## 1.7.0
- Golang 1.5
## 1.6.2
- Ability to install from source
## 1.6.0
- Removed support for Ruby 1.9.3
## 1.5.1
- Fix testing with Vagrant, Test-Kitchen
- Golang 1.4
## 1.5.0
- Golang 1.3
## 1.4.0
- Add build action to LWRP
- Update default go version to 1.2.2
- Add autodetection the platform architecture
- Change package location to `http://golang.org/dl/`
## 1.3.0
## 1.2.0
## 1.1.0
- Added package LWRP
- Configurable `gopath` & `gobin`
## 1.0.2
- Lets users easily specify another install dir
## 1.0.1
- Avoid extra unpacked copy of Go
## 1.0.0
- Initial release of golang

View File

@ -0,0 +1,4 @@
# Contributing
Please refer to
[https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD)

View File

@ -0,0 +1,77 @@
# Golang (Go) Cookbook
[![Cookbook Version](https://img.shields.io/cookbook/v/golang.svg?style=flat)](https://supermarket.chef.io/cookbooks/golang)
[![CI State](https://github.com/sous-chefs/golang/workflows/ci/badge.svg)](https://github.com/sous-chefs/golang/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)
## Description
Chef cookbook for the [Go programming language](http://golang.org/).
## Requirements
### Platform
* Ubuntu >= 18.04
* Debian >= 8
* CentOS >= 7
## Usage
### golang::default
Include `golang` in your node's `run_list`:
```json
{
"name":"my_node",
"run_list": [
"recipe[golang]"
]
}
```
### golang::packages
To install Go packages using node attributes add the packages to the `['golang']['packages']` attribute:
```json
{
"name":"my_node",
"golang": {
"packages": [
"github.com/go-check/check"
]
},
"run_list": [
"recipe[golang]"
]
}
```
## Contributors
This project exists thanks to all the people who [contribute.](https://opencollective.com/sous-chefs/contributors.svg?width=890&button=false)
### Backers
Thank you to all our backers!
![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

@ -0,0 +1,15 @@
#
# Cookbook:: golang
# Attribute:: default
#
default['golang']['scm'] = true
default['golang']['scm_packages'] = value_for_platform(
'centos' => { '>= 8' => %w(git mercurial) },
'default' => %w(git mercurial bzr)
)
default['golang']['install_dir'] = '/usr/local'
default['golang']['gopath'] = '/opt/go'
default['golang']['gobin'] = '/opt/go/bin'
default['golang']['packages'] = []

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