diff --git a/.rubocop.yml b/.rubocop.yml index f453713..fd3e59f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -33,9 +33,9 @@ Style/SignalException: Enabled: false # We enjoy parameters lining up for visual comprehension -Style/SingleSpaceBeforeFirstArg: +Layout/SpaceBeforeFirstArg: Enabled: false # Only enforce a wordlist for 5 or longer lists. Style/WordArray: - MinSize: 5 \ No newline at end of file + MinSize: 5 diff --git a/.travis.yml b/.travis.yml index 10ef878..93fece5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: ruby rvm: - - 2.0.0 + - 2.2.0 bundler_args: --without dev script: bundle exec rake test diff --git a/CHANGELOG.md b/CHANGELOG.md index 533bafc..376215e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ appdynamics CHANGELOG This file is used to list changes made in each version of the appdynamics cookbook. +0.4.1 +----- +- [dkoepke] - Switch from deprecated `python` cookbook to `poise-python` +- [dkoepke] - Bump versions, require at least Chef 12.5 + 0.4.0 ----- - [spuder] - Loosen windows cookbook version pin diff --git a/Gemfile b/Gemfile index 7ae2213..44b05a7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,13 +1,14 @@ source 'https://rubygems.org' -gem 'rake' gem 'berkshelf' +gem 'chef' gem 'chefspec' -gem 'rubocop', '0.33.0' -gem 'rspec' gem 'foodcritic' +gem 'rake' +gem 'rspec' +gem 'rubocop' group :dev do - gem 'test-kitchen' gem 'kitchen-vagrant' + gem 'test-kitchen' end diff --git a/Gemfile.lock b/Gemfile.lock index 667a452..61d84d8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,30 +1,33 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.3.8) - ast (2.1.0) - astrolabe (1.3.1) - parser (~> 2.2) - berkshelf (3.3.0) - addressable (~> 2.3.4) - berkshelf-api-client (~> 1.2) + addressable (2.5.1) + public_suffix (~> 2.0, >= 2.0.2) + artifactory (2.8.2) + ast (2.3.0) + backports (3.8.0) + berkshelf (4.3.5) + addressable (~> 2.3, >= 2.3.4) + berkshelf-api-client (~> 2.0, >= 2.0.2) buff-config (~> 1.0) buff-extensions (~> 1.0) buff-shell_out (~> 0.1) - celluloid (~> 0.16.0) + celluloid (= 0.16.0) celluloid-io (~> 0.16.1) cleanroom (~> 1.0) - faraday (~> 0.9.0) - httpclient (~> 2.6.0) - minitar (~> 0.5.4) - octokit (~> 3.0) + faraday (~> 0.9) + httpclient (~> 2.7) + minitar (~> 0.5, >= 0.5.4) + mixlib-archive (~> 0.1) + octokit (~> 4.0) retryable (~> 2.0) - ridley (~> 4.0) - solve (~> 1.1) + ridley (~> 4.5) + solve (~> 2.0) thor (~> 0.19) - berkshelf-api-client (1.3.0) - faraday (~> 0.9.0) - httpclient (~> 2.6.0) + berkshelf-api-client (2.0.2) + faraday (~> 0.9.1) + httpclient (~> 2.7.0) + ridley (~> 4.5) buff-config (1.0.1) buff-extensions (~> 1.0) varia_model (~> 0.4) @@ -33,338 +36,240 @@ GEM buff-ruby_engine (0.1.0) buff-shell_out (0.2.0) buff-ruby_engine (~> 0.1.0) - builder (3.2.2) + builder (3.2.3) celluloid (0.16.0) timers (~> 4.0.0) celluloid-io (0.16.2) celluloid (>= 0.16.0) nio4r (>= 1.1.0) - chef (12.4.0) - chef-config (= 12.4.0) - chef-zero (~> 4.2, >= 4.2.2) + chef (12.8.1) + bundler (>= 1.10) + chef-config (= 12.8.1) + chef-zero (~> 4.5) diff-lcs (~> 1.2, >= 1.2.4) erubis (~> 2.7) ffi-yajl (~> 2.2) highline (~> 1.6, >= 1.6.9) - mixlib-authentication (~> 1.3) + mixlib-authentication (~> 1.4) mixlib-cli (~> 1.4) mixlib-log (~> 1.3) - mixlib-shellout (>= 2.0.0.rc.0, < 3.0) - net-ssh (~> 2.6) - net-ssh-multi (~> 1.1) - ohai (~> 8.0) - plist (~> 3.1.0) - pry (~> 0.9) - rspec-core (~> 3.2) - rspec-expectations (~> 3.2) - rspec-mocks (~> 3.2) - rspec_junit_formatter (~> 0.2.0) - serverspec (~> 2.7) - specinfra (~> 2.10) - syslog-logger (~> 1.6) - chef (12.4.0-universal-mingw32) - chef-config (= 12.4.0) - chef-zero (~> 4.2, >= 4.2.2) - diff-lcs (~> 1.2, >= 1.2.4) - erubis (~> 2.7) - ffi (~> 1.9) - ffi-yajl (~> 2.2) - highline (~> 1.6, >= 1.6.9) - mixlib-authentication (~> 1.3) - mixlib-cli (~> 1.4) - mixlib-log (~> 1.3) - mixlib-shellout (>= 2.0.0.rc.0, < 3.0) - net-ssh (~> 2.6) - net-ssh-multi (~> 1.1) - ohai (~> 8.0) - plist (~> 3.1.0) - pry (~> 0.9) - rspec-core (~> 3.2) - rspec-expectations (~> 3.2) - rspec-mocks (~> 3.2) - rspec_junit_formatter (~> 0.2.0) - serverspec (~> 2.7) - specinfra (~> 2.10) - syslog-logger (~> 1.6) - win32-api (~> 1.5.3) - win32-dir (~> 0.5.0) - win32-event (~> 0.6.1) - win32-eventlog (~> 0.6.2) - win32-mmap (~> 0.4.1) - win32-mutex (~> 0.4.2) - win32-process (~> 0.7.5) - win32-service (= 0.8.6) - windows-api (~> 0.4.4) - windows-pr (~> 1.2.4) - wmi-lite (~> 1.0) - chef (12.4.0-x86-mingw32) - chef-config (= 12.4.0) - chef-zero (~> 4.2, >= 4.2.2) - diff-lcs (~> 1.2, >= 1.2.4) - erubis (~> 2.7) - ffi (~> 1.9) - ffi-yajl (~> 2.2) - highline (~> 1.6, >= 1.6.9) - mixlib-authentication (~> 1.3) - mixlib-cli (~> 1.4) - mixlib-log (~> 1.3) - mixlib-shellout (>= 2.0.0.rc.0, < 3.0) - net-ssh (~> 2.6) + mixlib-shellout (~> 2.0) + net-ssh (>= 2.9, < 4.0) net-ssh-multi (~> 1.1) - ohai (~> 8.0) + ohai (>= 8.6.0.alpha.1, < 9) plist (~> 3.1.0) - pry (~> 0.9) - rspec-core (~> 3.2) - rspec-expectations (~> 3.2) - rspec-mocks (~> 3.2) + proxifier (~> 1.0) + rspec-core (~> 3.4) + rspec-expectations (~> 3.4) + rspec-mocks (~> 3.4) rspec_junit_formatter (~> 0.2.0) serverspec (~> 2.7) specinfra (~> 2.10) syslog-logger (~> 1.6) - win32-api (~> 1.5.3) - win32-dir (~> 0.5.0) - win32-event (~> 0.6.1) - win32-eventlog (~> 0.6.2) - win32-mmap (~> 0.4.1) - win32-mutex (~> 0.4.2) - win32-process (~> 0.7.5) - win32-service (= 0.8.6) - windows-api (~> 0.4.4) - windows-pr (~> 1.2.4) - wmi-lite (~> 1.0) - chef-config (12.4.0) + uuidtools (~> 2.1.5) + chef-config (12.8.1) mixlib-config (~> 2.0) mixlib-shellout (~> 2.0) - chef-zero (4.3.0) + chef-zero (4.5.0) ffi-yajl (~> 2.2) - hashie (~> 2.0) + hashie (>= 2.0, < 4.0) mixlib-log (~> 1.3) rack uuidtools (~> 2.1) - chefspec (4.3.0) + chefspec (4.7.0) chef (>= 11.14) - fauxhai (~> 2.0) + fauxhai (~> 3.2) rspec (~> 3.0) cleanroom (1.0.0) - coderay (1.1.0) - dep-selector-libgecode (1.0.2) - dep_selector (1.0.3) - dep-selector-libgecode (~> 1.0) - ffi (~> 1.9) - diff-lcs (1.2.5) + cucumber-core (2.0.0) + backports (~> 3.6) + gherkin (~> 4.0) + diff-lcs (1.3) erubis (2.7.0) - faraday (0.9.1) + faraday (0.9.2) multipart-post (>= 1.2, < 3) - fauxhai (2.3.0) + fauxhai (3.6.0) net-ssh - ohai - ffi (1.9.10) - ffi (1.9.10-x86-mingw32) - ffi-yajl (2.2.2) + ffi (1.9.18) + ffi-yajl (2.2.3) libyajl2 (~> 1.2) - foodcritic (4.0.0) + foodcritic (6.3.0) + cucumber-core (>= 1.3) erubis - gherkin (~> 2.11) - nokogiri (~> 1.5) + nokogiri (>= 1.5, < 2.0) rake rufus-lru (~> 1.0) treetop (~> 1.4) yajl-ruby (~> 1.1) - gherkin (2.12.2) - multi_json (~> 1.3) - gherkin (2.12.2-x86-mingw32) - multi_json (~> 1.3) - hashie (2.1.2) - highline (1.7.6) - hitimes (1.2.3) - hitimes (1.2.3-x86-mingw32) - httpclient (2.6.0.1) - ipaddress (0.8.0) - json (1.8.3) - kitchen-vagrant (0.18.0) + gherkin (4.1.3) + hashie (3.5.6) + highline (1.7.8) + hitimes (1.2.5) + httpclient (2.7.2) + ipaddress (0.8.3) + json (2.1.0) + kitchen-vagrant (1.1.0) test-kitchen (~> 1.4) libyajl2 (1.2.0) - method_source (0.8.2) - mime-types (2.6.2) - mini_portile (0.6.2) - minitar (0.5.4) - mixlib-authentication (1.3.0) + mini_portile2 (2.1.0) + minitar (0.6.1) + mixlib-archive (0.4.1) mixlib-log - mixlib-cli (1.5.0) - mixlib-config (2.2.1) - mixlib-log (1.6.0) - mixlib-shellout (2.2.1) - mixlib-shellout (2.2.1-universal-mingw32) - win32-process (~> 0.7.5) - mixlib-shellout (2.2.1-x86-mingw32) - win32-process (~> 0.7.5) - multi_json (1.11.2) + mixlib-authentication (1.4.1) + mixlib-log + mixlib-cli (1.7.0) + mixlib-config (2.2.4) + mixlib-install (2.1.12) + artifactory + mixlib-shellout + mixlib-versioning + thor + mixlib-log (1.7.1) + mixlib-shellout (2.2.7) + mixlib-versioning (1.1.0) + molinillo (0.4.5) + multi_json (1.12.1) multipart-post (2.0.0) - net-http-persistent (2.9.4) net-scp (1.2.1) net-ssh (>= 2.6.5) - net-ssh (2.9.2) - net-ssh-gateway (1.2.0) + net-ssh (3.2.0) + net-ssh-gateway (1.3.0) net-ssh (>= 2.6.5) net-ssh-multi (1.2.1) net-ssh (>= 2.6.5) net-ssh-gateway (>= 1.2.0) net-telnet (0.1.1) - nio4r (1.1.1) - nokogiri (1.6.6.2) - mini_portile (~> 0.6.0) - nokogiri (1.6.6.2-x86-mingw32) - mini_portile (~> 0.6.0) - octokit (3.8.0) - sawyer (~> 0.6.0, >= 0.5.3) - ohai (8.5.1) + nio4r (1.2.1) + nokogiri (1.6.8.1) + mini_portile2 (~> 2.1.0) + octokit (4.7.0) + sawyer (~> 0.8.0, >= 0.5.3) + ohai (8.17.1) + chef-config (>= 12.5.0.alpha.1, < 13) ffi (~> 1.9) ffi-yajl (~> 2.2) ipaddress - mime-types (~> 2.0) mixlib-cli mixlib-config (~> 2.0) mixlib-log mixlib-shellout (~> 2.0) - rake (~> 10.1) + plist (~> 3.1) systemu (~> 2.6.4) wmi-lite (~> 1.0) - parser (2.2.2.6) - ast (>= 1.1, < 3.0) + parallel (1.12.0) + parser (2.4.0.0) + ast (~> 2.2) plist (3.1.0) polyglot (0.3.5) powerpack (0.1.1) - pry (0.10.1) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - pry (0.10.1-x86-mingw32) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - win32console (~> 1.3) - rack (1.6.4) - rainbow (2.0.0) - rake (10.4.2) - retryable (2.0.2) - ridley (4.2.0) + proxifier (1.0.3) + public_suffix (2.0.5) + rack (1.6.8) + rainbow (2.2.2) + rake + rake (12.0.0) + retryable (2.0.4) + ridley (4.6.1) addressable buff-config (~> 1.0) buff-extensions (~> 1.0) - buff-ignore (~> 1.1) + buff-ignore (~> 1.1.1) buff-shell_out (~> 0.1) celluloid (~> 0.16.0) celluloid-io (~> 0.16.1) + chef-config (>= 12.5.0) erubis faraday (~> 0.9.0) - hashie (>= 2.0.2, < 3.0.0) + hashie (>= 2.0.2, < 4.0.0) + httpclient (~> 2.7) json (>= 1.7.7) mixlib-authentication (>= 1.3.0) - net-http-persistent (>= 2.8) retryable (~> 2.0) semverse (~> 1.1) - varia_model (~> 0.4) - rspec (3.3.0) - rspec-core (~> 3.3.0) - rspec-expectations (~> 3.3.0) - rspec-mocks (~> 3.3.0) - rspec-core (3.3.2) - rspec-support (~> 3.3.0) - rspec-expectations (3.3.1) + varia_model (~> 0.4.0) + rspec (3.6.0) + rspec-core (~> 3.6.0) + rspec-expectations (~> 3.6.0) + rspec-mocks (~> 3.6.0) + rspec-core (3.6.0) + rspec-support (~> 3.6.0) + rspec-expectations (3.6.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.3.0) + rspec-support (~> 3.6.0) rspec-its (1.2.0) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.3.2) + rspec-mocks (3.6.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.3.0) - rspec-support (3.3.0) + rspec-support (~> 3.6.0) + rspec-support (3.6.0) rspec_junit_formatter (0.2.3) builder (< 4) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (0.33.0) - astrolabe (~> 1.3) - parser (>= 2.2.2.5, < 3.0) + rubocop (0.49.1) + parallel (~> 1.10) + parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) - ruby-progressbar (~> 1.4) - ruby-progressbar (1.7.5) - rufus-lru (1.0.5) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + ruby-progressbar (1.8.1) + rufus-lru (1.1.0) safe_yaml (1.0.4) - sawyer (0.6.0) - addressable (~> 2.3.5) - faraday (~> 0.8, < 0.10) + sawyer (0.8.1) + addressable (>= 2.3.5, < 2.6) + faraday (~> 0.8, < 1.0) semverse (1.2.1) - serverspec (2.24.0) + serverspec (2.39.1) multi_json rspec (~> 3.0) rspec-its - specinfra (~> 2.43) - sfl (2.2) - slop (3.6.0) - solve (1.2.1) - dep_selector (~> 1.0) + specinfra (~> 2.68) + sfl (2.3) + solve (2.0.3) + molinillo (~> 0.4.2) semverse (~> 1.1) - specinfra (2.43.6) + specinfra (2.70.0) net-scp - net-ssh (~> 2.7) + net-ssh (>= 2.7, < 5.0) net-telnet sfl syslog-logger (1.6.8) systemu (2.6.5) - test-kitchen (1.4.2) + test-kitchen (1.16.0) + mixlib-install (>= 1.2, < 3.0) mixlib-shellout (>= 1.2, < 3.0) net-scp (~> 1.1) - net-ssh (~> 2.7, < 2.10) + net-ssh (>= 2.9, < 5.0) + net-ssh-gateway (~> 1.2) safe_yaml (~> 1.0) - thor (~> 0.18) + thor (~> 0.19, < 0.19.2) thor (0.19.1) timers (4.0.4) hitimes - treetop (1.6.3) + treetop (1.6.8) polyglot (~> 0.3) + unicode-display_width (1.3.0) uuidtools (2.1.5) - varia_model (0.4.0) + varia_model (0.4.1) buff-extensions (~> 1.0) - hashie (>= 2.0.2, < 3.0.0) - win32-api (1.5.3-universal-mingw32) - win32-api (1.5.3-x86-mingw32) - win32-dir (0.5.0) - ffi (>= 1.0.0) - win32-event (0.6.1) - win32-ipc (>= 0.6.0) - win32-eventlog (0.6.3) - ffi - win32-ipc (0.6.6) - ffi - win32-mmap (0.4.1) - ffi - win32-mutex (0.4.2) - win32-ipc (>= 0.6.0) - win32-process (0.7.5) - ffi (>= 1.0.0) - win32-service (0.8.6) - ffi - win32console (1.3.2-x86-mingw32) - windows-api (0.4.4) - win32-api (>= 1.4.5) - windows-pr (1.2.4) - win32-api (>= 1.4.5) - windows-api (>= 0.4.0) + hashie (>= 2.0.2, < 4.0.0) wmi-lite (1.0.0) - yajl-ruby (1.2.1) + yajl-ruby (1.3.0) PLATFORMS ruby - x86-mingw32 DEPENDENCIES berkshelf + chef chefspec foodcritic kitchen-vagrant rake rspec - rubocop (= 0.33.0) + rubocop test-kitchen + +BUNDLED WITH + 1.15.3 diff --git a/README.md b/README.md index a7f8718..89b4e8b 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ Learn more about AppDynamics at: ## Requirements -* Chef >= 0.10.0 -* python cookbook +* Chef >= 0.12.5 +* poise-python cookbook * nodejs cookbook * windows cookbook * java cookbook diff --git a/Rakefile b/Rakefile index c2e0490..d7bb76e 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,4 @@ -gem 'rubocop', '0.33.0' +gem 'rubocop' require 'rspec/core/rake_task' require 'rubocop/rake_task' diff --git a/attributes/default.rb b/attributes/default.rb index da2477b..0648f25 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -2,7 +2,7 @@ default['appdynamics']['app_name'] = nil default['appdynamics']['tier_name'] = nil -default['appdynamics']['node_name'] = "#{node['hostname']}" +default['appdynamics']['node_name'] = node['hostname'] default['appdynamics']['controller']['host'] = nil default['appdynamics']['controller']['port'] = nil diff --git a/attributes/nodejs_agent.rb b/attributes/nodejs_agent.rb index 735b56c..2a6b9c0 100644 --- a/attributes/nodejs_agent.rb +++ b/attributes/nodejs_agent.rb @@ -7,4 +7,4 @@ default['appdynamics']['nodejs_agent']['template']['source'] = 'nodejs/appd.js.erb' default['appdynamics']['nodejs_agent']['template']['user'] = 'root' default['appdynamics']['nodejs_agent']['template']['group'] = 'root' -default['appdynamics']['nodejs_agent']['template']['mode'] = 0644 +default['appdynamics']['nodejs_agent']['template']['mode'] = 0o0644 diff --git a/metadata.rb b/metadata.rb index 4131516..ae0a81c 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,5 +1,5 @@ name 'appdynamics' -version '0.4.0' +version '0.4.1' maintainer 'AppDynamics' maintainer_email 'help@appdynamics.com' @@ -8,8 +8,8 @@ source_url 'https://github.com/appdynamics/appdynamics-cookbooks' if respond_to?(:source_url) issues_url 'https://github.com/appdynamics/appdynamics-cookbooks/issues' if respond_to?(:issues_url) -depends 'windows', '>= 1.44.3' -depends 'python', '~> 1.4.6' +depends 'windows', '~> 1.44.3' +depends 'poise-python', '~> 1.6.0' depends 'nodejs', '~> 2.4.4' depends 'java', '~> 1.42.0' depends 'apt', '~> 3.0.0' diff --git a/recipes/dotnet_agent.rb b/recipes/dotnet_agent.rb index bd70d18..299173d 100644 --- a/recipes/dotnet_agent.rb +++ b/recipes/dotnet_agent.rb @@ -24,17 +24,17 @@ # MSDTC Service service 'MSDTC' do - action [:enable, :start] + action %i[enable start] end # WMI Service service 'Winmgmt' do - action [:enable, :start] + action %i[enable start] end # COM+ Service is not required in 4.1+ service 'COMSysApp' do - action [:enable, :start] + action %i[enable start] only_if { version < '4.1' } end @@ -69,7 +69,7 @@ end service 'AppDynamics.Agent.Coordinator_service' do - action [:enable, :start] + action %i[enable start] end if agent['standalone_apps'] diff --git a/recipes/machine_agent.rb b/recipes/machine_agent.rb index 20595d6..ae44086 100644 --- a/recipes/machine_agent.rb +++ b/recipes/machine_agent.rb @@ -12,17 +12,16 @@ package_source = "#{node['appdynamics']['packages_site']}/machine/#{version}/" if agent['use_bundled_package'] - package_source << 'machineagent-bundle-' - if node['kernel']['machine'] == 'x86_64' - package_source << '64bit-' - else - package_source << '32bit-' - end - - package_source << value_for_platform_family( - %w(mswin windows) => 'windows', - %w(darwin mac_os_x) => 'osx', - %w(omnios opensolaris solaris solaris2 smartos) => 'solaris', + bitness = if node['kernel']['machine'] == 'x86_64' + '64bit' + else + '32bit' + end + + package_source << 'machineagent-bundle-' << bitness << '-' << value_for_platform_family( + %w[mswin windows] => 'windows', + %w[darwin mac_os_x] => 'osx', + %w[omnios opensolaris solaris solaris2 smartos] => 'solaris', 'default' => 'linux' ) else @@ -107,6 +106,6 @@ end service 'appdynamics_machine_agent' do - supports [:start, :stop, :restart] - action [:enable, :start] + supports %i[start stop restart] + action %i[enable start] end diff --git a/recipes/python_agent.rb b/recipes/python_agent.rb index dd78b24..4dc057f 100644 --- a/recipes/python_agent.rb +++ b/recipes/python_agent.rb @@ -5,7 +5,7 @@ agent_version = agent['version'] || node['appdynamics']['version'] fail 'You must specify either node[\'appdynamics\'][\'version\'] or node[\'appdynamics\'][\'python_agent\'][\'version\']' unless agent_version -python_pip 'appdynamics' do +python_package 'appdynamics' do virtualenv agent['virtualenv'] if agent['virtualenv'] action agent['action'] version agent_version diff --git a/verify.sh b/verify.sh old mode 100644 new mode 100755