diff --git a/CHANGELOG.md b/CHANGELOG.md index 260c332..5a1d03a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,22 +2,10 @@ This file is used to list changes made in each version of the habitat cookbook. -## Unreleased - - -## Unreleased - -#### Merged Pull Requests -- pipeline testing updates [#259](https://github.com/chef-cookbooks/habitat/pull/259) ([collinmcneese](https://github.com/collinmcneese)) -- Cookstyle Bot Auto Corrections with Cookstyle 7.5.2 [#257](https://github.com/chef-cookbooks/habitat/pull/257) ([cookstyle[bot]](https://github.com/cookstyle[bot])) - - -## [2.2.4](https://github.com/chef-cookbooks/habitat/tree/2.2.4) (2020-11-19) - -#### Merged Pull Requests -- Changelog [#255](https://github.com/chef-cookbooks/habitat/pull/255) ([sam1el](https://github.com/sam1el)) - +## 2.2.5 (2021-10-27) +- Fixed windows supervisor restarting on every chef run +- Made windows install respect version ## 2.2.4 (2020-11-19) @@ -596,4 +584,4 @@ This cookbook was updated to be compatible with the changes made in Habitat 0.26 ## v0.0.3 (2016-07-14) -- Initial release, includes `hab_package` and `hab_install` resources \ No newline at end of file +- Initial release, includes `hab_package` and `hab_install` resources diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 1c6a921..8f9ba56 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -3,6 +3,7 @@ driver: name: dokken privileged: true # because Docker and SystemD/Upstart chef_license: accept-no-persist + chef_version: 16 transport: name: dokken @@ -15,80 +16,80 @@ verifier: name: inspec platforms: -- name: amazonlinux - driver: - image: dokken/amazonlinux - pid_one_command: /sbin/init +# - name: amazonlinux +# driver: +# image: dokken/amazonlinux +# pid_one_command: /sbin/init -- name: amazonlinux-2 - driver: - image: dokken/amazonlinux-2 - pid_one_command: /usr/lib/systemd/systemd +# - name: amazonlinux-2 +# driver: +# image: dokken/amazonlinux-2 +# pid_one_command: /usr/lib/systemd/systemd -- name: debian-8 - driver: - image: dokken/debian-8 - pid_one_command: /bin/systemd - intermediate_instructions: - - RUN /usr/bin/apt-get update +# - name: debian-8 +# driver: +# image: dokken/debian-8 +# pid_one_command: /bin/systemd +# intermediate_instructions: +# - RUN /usr/bin/apt-get update -- name: debian-9 - driver: - image: dokken/debian-9 - pid_one_command: /bin/systemd - intermediate_instructions: - - RUN /usr/bin/apt-get update +# - name: debian-9 +# driver: +# image: dokken/debian-9 +# pid_one_command: /bin/systemd +# intermediate_instructions: +# - RUN /usr/bin/apt-get update -- name: debian-10 - driver: - image: dokken/debian-10 - pid_one_command: /bin/systemd - intermediate_instructions: - - RUN /usr/bin/apt-get update +# - name: debian-10 +# driver: +# image: dokken/debian-10 +# pid_one_command: /bin/systemd +# intermediate_instructions: +# - RUN /usr/bin/apt-get update -- name: centos-6 - driver: - image: dokken/centos-6 - pid_one_command: /sbin/init - chef_version: 16.7 # patch for chef/chef:latest not working with el6 +# - name: centos-6 +# driver: +# image: dokken/centos-6 +# pid_one_command: /sbin/init +# chef_version: 16.7 # patch for chef/chef:latest not working with el6 - name: centos-7 driver: image: dokken/centos-7 pid_one_command: /usr/lib/systemd/systemd -- name: centos-8 - driver: - image: dokken/centos-8 - pid_one_command: /usr/lib/systemd/systemd +# - name: centos-8 +# driver: +# image: dokken/centos-8 +# pid_one_command: /usr/lib/systemd/systemd -- name: oraclelinux-6 - driver: - image: dokken/oraclelinux-6 - pid_one_command: /sbin/init - chef_version: 16.7 # patch for chef/chef:latest not working with el6 +# - name: oraclelinux-6 +# driver: +# image: dokken/oraclelinux-6 +# pid_one_command: /sbin/init +# chef_version: 16.7 # patch for chef/chef:latest not working with el6 -- name: oraclelinux-7 - driver: - image: dokken/oraclelinux-7 - pid_one_command: /usr/lib/systemd/systemd +# - name: oraclelinux-7 +# driver: +# image: dokken/oraclelinux-7 +# pid_one_command: /usr/lib/systemd/systemd # - name: oraclelinux-8 # driver: # image: dokken/oraclelinux-8 # pid_one_command: /usr/lib/systemd/systemd -- name: fedora-latest - driver: - image: dokken/fedora-latest - pid_one_command: /usr/lib/systemd/systemd +# - name: fedora-latest +# driver: +# image: dokken/fedora-latest +# pid_one_command: /usr/lib/systemd/systemd -- name: ubuntu-16.04 - driver: - image: dokken/ubuntu-16.04 - pid_one_command: /bin/systemd - intermediate_instructions: - - RUN /usr/bin/apt-get update +# - name: ubuntu-16.04 +# driver: +# image: dokken/ubuntu-16.04 +# pid_one_command: /bin/systemd +# intermediate_instructions: +# - RUN /usr/bin/apt-get update - name: ubuntu-18.04 driver: @@ -97,7 +98,7 @@ platforms: intermediate_instructions: - RUN /usr/bin/apt-get update -- name: opensuse-leap-15 - driver: - image: dokken/opensuse-leap-15 - pid_one_command: /bin/systemd +# - name: opensuse-leap-15 +# driver: +# image: dokken/opensuse-leap-15 +# pid_one_command: /bin/systemd diff --git a/kitchen.yml b/kitchen.yml index 0c3f1f7..36d5b47 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -10,32 +10,34 @@ provisioner: always_update_cookbooks: true deprecations_as_errors: true chef_license: accept-no-persist + product_name: chef + product_version: 16 verifier: name: inspec platforms: - - name: amazonlinux - driver_config: - box: mvbcoding/awslinux - - name: amazonlinux-2 - - name: centos-6 + # - name: amazonlinux + # driver_config: + # box: mvbcoding/awslinux + # - name: amazonlinux-2 + # - name: centos-6 - name: centos-7 - driver: - box: bento/centos-7 - - name: centos-8 - - name: debian-9 - - name: debian-10 - - name: fedora-latest - - name: opensuse-leap-15 - - name: ubuntu-16.04 + # driver: + # box: bento/centos-7 + # - name: centos-8 + # - name: debian-9 + # - name: debian-10 + # - name: fedora-latest + # - name: opensuse-leap-15 + # - name: ubuntu-16.04 - name: ubuntu-18.04 - name: windows-2016 - driver: - box: tas50/windows_2016 - - name: windows-2019 - driver: - box: tas50/windows_2019 + # driver: + # box: tas50/windows_2016 + # - name: windows-2019 + # driver: + # box: tas50/windows_2019 suites: # Testing Linux stuff here: @@ -46,7 +48,7 @@ suites: - test/integration/package excludes: - windows-2016 - - windows-2019 + # - windows-2019 - name: service named_run_list: service verifier: @@ -54,7 +56,7 @@ suites: - test/integration/service excludes: - windows-2016 - - windows-2019 + # - windows-2019 - name: sup named_run_list: sup verifier: @@ -62,12 +64,12 @@ suites: - test/integration/sup excludes: - windows-2016 - - windows-2019 + # - windows-2019 - name: sup-toml-config named_run_list: sup_toml_config excludes: - windows-2016 - - windows-2019 + # - windows-2019 verifier: inspec_tests: - path: test/integration/sup_toml_config/default_spec.rb @@ -78,7 +80,7 @@ suites: - test/integration/install_no_user excludes: - windows-2016 - - windows-2019 + # - windows-2019 - name: install_for_chefspec named_run_list: install_for_chefspec verifier: @@ -86,7 +88,7 @@ suites: - test/integration/install_for_chefspec excludes: - windows-2016 - - windows-2019 + # - windows-2019 - name: config named_run_list: config verifier: @@ -94,7 +96,7 @@ suites: - test/integration/config excludes: - windows-2016 - - windows-2019 + # - windows-2019 - name: user-toml named_run_list: user_toml verifier: @@ -102,7 +104,7 @@ suites: - test/integration/user_toml excludes: - windows-2016 - - windows-2019 + # - windows-2019 - name: config-chef-13 named_run_list: config verifier: @@ -110,7 +112,7 @@ suites: - test/integration/config excludes: - windows-2016 - - windows-2019 + # - windows-2019 provisioner: product_name: chef product_version: 13.6.4 @@ -123,7 +125,7 @@ suites: - test/integration/win_package includes: - windows-2016 - - windows-2019 + # - windows-2019 - name: win-service named_run_list: win_service verifier: @@ -131,7 +133,7 @@ suites: - test/integration/win_service includes: - windows-2016 - - windows-2019 + # - windows-2019 - name: win-sup named_run_list: win_sup verifier: @@ -139,7 +141,7 @@ suites: - test/integration/win_sup includes: - windows-2016 - - windows-2019 + # - windows-2019 - name: win-sup-toml-config named_run_list: win_sup_toml_config verifier: @@ -147,7 +149,7 @@ suites: - test/integration/win_sup_toml_config includes: - windows-2016 - - windows-2019 + # - windows-2019 - name: win-config named_run_list: win_config verifier: @@ -155,7 +157,7 @@ suites: - test/integration/win_config includes: - windows-2016 - - windows-2019 + # - windows-2019 - name: win-user-toml named_run_list: win_user_toml verifier: @@ -163,4 +165,4 @@ suites: - test/integration/win_user_toml includes: - windows-2016 - - windows-2019 + # - windows-2019 diff --git a/libraries/resource_hab_sup_windows.rb b/libraries/resource_hab_sup_windows.rb index d1c41e8..da9c94a 100644 --- a/libraries/resource_hab_sup_windows.rb +++ b/libraries/resource_hab_sup_windows.rb @@ -71,7 +71,7 @@ class HabSupWindows < HabSup auth_token: new_resource.auth_token, gateway_auth_token: new_resource.gateway_auth_token # win_launcher: win_version - action :touch + action :create end service 'Habitat' do diff --git a/metadata.rb b/metadata.rb index 8fe175f..ff619f3 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/chef-cookbooks/habitat' issues_url 'https://github.com/chef-cookbooks/habitat/issues' chef_version '>= 12.20.3' -version '2.2.4' +version '2.2.5' %w(ubuntu debian redhat centos suse scientific oracle amazon opensuse opensuseleap windows).each do |os| supports os diff --git a/resources/install.rb b/resources/install.rb index 0b3e6fe..5982a0e 100644 --- a/resources/install.rb +++ b/resources/install.rb @@ -46,7 +46,8 @@ # TODO: Figure out how to properly validate the shasum for windows. Doesn't seem it's published # as a .sha265sum like for the linux .tar.gz - download = "#{uri}/stable/habitat/latest/hab-x86_64-windows.zip" + hab_version = new_resource.hab_version || 'latest' + download = "#{uri}/stable/habitat/#{hab_version}/hab-x86_64-windows.zip" remote_file zipfile do source download @@ -86,6 +87,7 @@ powershell_script 'installing from archive' do code <<-EOH Move-Item -Path #{Chef::Config[:file_cache_path]}/habitat/hab-*/* -Destination C:/habitat -Force + Remove-Item -Path #{Chef::Config[:file_cache_path]}/habitat -Recurse -Force EOH action :nothing end @@ -175,6 +177,7 @@ powershell_script 'installing from archive' do code <<-EOH Move-Item -Path #{Chef::Config[:file_cache_path]}/habitat/hab-*/* -Destination C:/habitat -Force + Remove-Item -Path #{Chef::Config[:file_cache_path]}/habitat -Recurse -Force EOH end diff --git a/test/fixtures/cookbooks/test/recipes/win_sup.rb b/test/fixtures/cookbooks/test/recipes/win_sup.rb index c156b12..0c2a1d1 100644 --- a/test/fixtures/cookbooks/test/recipes/win_sup.rb +++ b/test/fixtures/cookbooks/test/recipes/win_sup.rb @@ -1,8 +1,9 @@ hab_sup 'tester' do license 'accept' - bldr_url 'https://willem.habitat.sh' + bldr_url 'https://bldr.habitat.sh' listen_http '0.0.0.0:9999' listen_gossip '0.0.0.0:9998' + # sup_version '1.6.400' end ruby_block 'wait-for-sup-default-startup' do