chef 17.2.29-universal-mingw32 → 17.5.22-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -5
- data/chef.gemspec +3 -0
- data/lib/chef/application/base.rb +11 -1
- data/lib/chef/application.rb +3 -1
- data/lib/chef/client.rb +2 -3
- data/lib/chef/compliance/default_attributes.rb +5 -3
- data/lib/chef/compliance/input.rb +115 -0
- data/lib/chef/compliance/input_collection.rb +139 -0
- data/lib/chef/compliance/profile.rb +122 -0
- data/lib/chef/compliance/profile_collection.rb +109 -0
- data/lib/chef/compliance/reporter/automate.rb +1 -1
- data/lib/chef/compliance/runner.rb +62 -6
- data/lib/chef/compliance/waiver.rb +115 -0
- data/lib/chef/compliance/waiver_collection.rb +143 -0
- data/lib/chef/data_bag.rb +1 -2
- data/lib/chef/data_bag_item.rb +1 -2
- data/lib/chef/deprecated.rb +10 -4
- data/lib/chef/dsl/compliance.rb +38 -0
- data/lib/chef/dsl/reader_helpers.rb +51 -0
- data/lib/chef/dsl/recipe.rb +4 -2
- data/lib/chef/dsl/render_helpers.rb +44 -0
- data/lib/chef/dsl/secret.rb +62 -0
- data/lib/chef/dsl/toml.rb +116 -0
- data/lib/chef/dsl/universal.rb +7 -0
- data/lib/chef/dsl.rb +1 -0
- data/lib/chef/event_dispatch/base.rb +44 -2
- data/lib/chef/exceptions.rb +20 -0
- data/lib/chef/formatters/doc.rb +60 -13
- data/lib/chef/formatters/error_mapper.rb +2 -2
- data/lib/chef/formatters/minimal.rb +6 -5
- data/lib/chef/handler/slow_report.rb +1 -1
- data/lib/chef/http/basic_client.rb +15 -7
- data/lib/chef/http.rb +12 -8
- data/lib/chef/json_compat.rb +1 -1
- data/lib/chef/policy_builder/policyfile.rb +88 -45
- data/lib/chef/provider/execute.rb +1 -1
- data/lib/chef/provider/file.rb +4 -2
- data/lib/chef/provider/group/dscl.rb +1 -1
- data/lib/chef/provider/launchd.rb +6 -6
- data/lib/chef/provider/link.rb +2 -2
- data/lib/chef/provider/lwrp_base.rb +1 -1
- data/lib/chef/provider/package/habitat.rb +168 -0
- data/lib/chef/provider/package/powershell.rb +5 -0
- data/lib/chef/provider/registry_key.rb +3 -2
- data/lib/chef/provider/remote_file/http.rb +1 -1
- data/lib/chef/provider/subversion.rb +4 -4
- data/lib/chef/provider/support/yum_repo.erb +1 -1
- data/lib/chef/provider/systemd_unit.rb +17 -16
- data/lib/chef/provider/template.rb +1 -1
- data/lib/chef/provider/user/mac.rb +3 -3
- data/lib/chef/provider/yum_repository.rb +27 -43
- data/lib/chef/provider/zypper_repository.rb +3 -3
- data/lib/chef/provider.rb +26 -1
- data/lib/chef/provider_resolver.rb +8 -2
- data/lib/chef/providers.rb +1 -0
- data/lib/chef/resource/archive_file.rb +17 -14
- data/lib/chef/resource/chef_client_config.rb +7 -2
- data/lib/chef/resource/chef_client_cron.rb +1 -1
- data/lib/chef/resource/chef_client_launchd.rb +1 -1
- data/lib/chef/resource/chef_client_scheduled_task.rb +46 -3
- data/lib/chef/resource/chef_client_systemd_timer.rb +1 -1
- data/lib/chef/resource/chef_client_trusted_certificate.rb +2 -2
- data/lib/chef/resource/chef_vault_secret.rb +2 -2
- data/lib/chef/resource/chocolatey_config.rb +13 -13
- data/lib/chef/resource/dsc_resource.rb +1 -1
- data/lib/chef/resource/execute.rb +5 -5
- data/lib/chef/resource/file/verification/json.rb +50 -0
- data/lib/chef/resource/file/verification/yaml.rb +52 -0
- data/lib/chef/resource/gem_package.rb +2 -1
- data/lib/chef/resource/habitat/_habitat_shared.rb +28 -0
- data/lib/chef/resource/habitat/habitat_package.rb +129 -0
- data/lib/chef/resource/habitat/habitat_sup.rb +329 -0
- data/lib/chef/resource/habitat/habitat_sup_systemd.rb +67 -0
- data/lib/chef/resource/habitat/habitat_sup_windows.rb +90 -0
- data/lib/chef/resource/habitat_config.rb +107 -0
- data/lib/chef/resource/habitat_install.rb +247 -0
- data/lib/chef/resource/habitat_service.rb +451 -0
- data/lib/chef/resource/habitat_user_toml.rb +92 -0
- data/lib/chef/resource/homebrew_cask.rb +1 -1
- data/lib/chef/resource/inspec_input.rb +128 -0
- data/lib/chef/resource/inspec_waiver.rb +185 -0
- data/lib/chef/resource/inspec_waiver_file_entry.rb +2 -2
- data/lib/chef/resource/launchd.rb +3 -3
- data/lib/chef/resource/lwrp_base.rb +1 -1
- data/lib/chef/resource/mount.rb +1 -1
- data/lib/chef/resource/registry_key.rb +36 -48
- data/lib/chef/resource/remote_file.rb +99 -3
- data/lib/chef/resource/rhsm_subscription.rb +5 -5
- data/lib/chef/resource/ruby_block.rb +100 -0
- data/lib/chef/resource/scm/subversion.rb +1 -1
- data/lib/chef/resource/support/HabService.dll.config.erb +19 -0
- data/lib/chef/resource/support/client.erb +8 -1
- data/lib/chef/resource/support/sup.toml.erb +179 -0
- data/lib/chef/resource/sysctl.rb +2 -2
- data/lib/chef/resource/systemd_unit.rb +3 -3
- data/lib/chef/resource/timezone.rb +2 -2
- data/lib/chef/resource/user_ulimit.rb +1 -0
- data/lib/chef/resource/windows_defender.rb +163 -0
- data/lib/chef/resource/windows_defender_exclusion.rb +125 -0
- data/lib/chef/resource/windows_printer.rb +78 -44
- data/lib/chef/resource/windows_printer_port.rb +1 -1
- data/lib/chef/resource/windows_uac.rb +3 -1
- data/lib/chef/resource/windows_update_settings.rb +259 -0
- data/lib/chef/resource/windows_user_privilege.rb +1 -1
- data/lib/chef/resource/yum_package.rb +1 -5
- data/lib/chef/resource.rb +13 -17
- data/lib/chef/resource_inspector.rb +6 -2
- data/lib/chef/resources.rb +14 -1
- data/lib/chef/run_context/cookbook_compiler.rb +112 -28
- data/lib/chef/run_context.rb +31 -1
- data/lib/chef/secret_fetcher/akeyless_vault.rb +57 -0
- data/lib/chef/secret_fetcher/aws_secrets_manager.rb +65 -0
- data/lib/chef/secret_fetcher/azure_key_vault.rb +78 -0
- data/lib/chef/secret_fetcher/base.rb +76 -0
- data/lib/chef/secret_fetcher/example.rb +46 -0
- data/lib/chef/secret_fetcher/hashi_vault.rb +100 -0
- data/lib/chef/secret_fetcher.rb +61 -0
- data/lib/chef/version.rb +1 -1
- data/spec/data/archive_file/test_archive.tar.gz +0 -0
- data/spec/functional/mixin/from_file_spec.rb +1 -1
- data/spec/functional/resource/archive_file_spec.rb +87 -0
- data/spec/functional/resource/group_spec.rb +5 -1
- data/spec/functional/resource/link_spec.rb +8 -0
- data/spec/integration/compliance/compliance_spec.rb +61 -0
- data/spec/integration/recipes/recipe_dsl_spec.rb +1 -1
- data/spec/integration/recipes/resource_action_spec.rb +6 -6
- data/spec/spec_helper.rb +3 -0
- data/spec/support/platform_helpers.rb +4 -0
- data/spec/support/ruby_installer.rb +51 -0
- data/spec/support/shared/unit/provider/file.rb +2 -8
- data/spec/unit/compliance/input_spec.rb +104 -0
- data/spec/unit/compliance/profile_spec.rb +120 -0
- data/spec/unit/compliance/runner_spec.rb +46 -2
- data/spec/unit/compliance/waiver_spec.rb +104 -0
- data/spec/unit/data_bag_item_spec.rb +2 -2
- data/spec/unit/data_bag_spec.rb +1 -1
- data/spec/unit/dsl/render_helpers_spec.rb +102 -0
- data/spec/unit/dsl/secret_spec.rb +71 -0
- data/spec/unit/formatters/doc_spec.rb +1 -1
- data/spec/unit/http/basic_client_spec.rb +30 -0
- data/spec/unit/http_spec.rb +8 -2
- data/spec/unit/policy_builder/dynamic_spec.rb +0 -5
- data/spec/unit/policy_builder/policyfile_spec.rb +144 -56
- data/spec/unit/provider/apt_update_spec.rb +3 -1
- data/spec/unit/provider/link_spec.rb +13 -7
- data/spec/unit/provider/mount/aix_spec.rb +1 -1
- data/spec/unit/provider/package/powershell_spec.rb +74 -12
- data/spec/unit/provider/remote_file/http_spec.rb +10 -0
- data/spec/unit/provider/template_spec.rb +2 -2
- data/spec/unit/provider_spec.rb +23 -0
- data/spec/unit/resource/archive_file_spec.rb +414 -3
- data/spec/unit/resource/chef_client_scheduled_task_spec.rb +69 -0
- data/spec/unit/resource/file/verification/json_spec.rb +72 -0
- data/spec/unit/resource/file/verification/yaml_spec.rb +67 -0
- data/spec/unit/resource/homebrew_cask_spec.rb +29 -11
- data/spec/unit/resource/inspec_input_spec.rb +300 -0
- data/spec/unit/resource/inspec_waiver_spec.rb +312 -0
- data/spec/unit/resource/mount_spec.rb +10 -0
- data/spec/unit/resource/rhsm_subscription_spec.rb +50 -3
- data/spec/unit/resource/systemd_unit_spec.rb +1 -1
- data/spec/unit/resource/user_ulimit_spec.rb +14 -1
- data/spec/unit/resource/windows_defender_exclusion_spec.rb +62 -0
- data/spec/unit/resource/windows_defender_spec.rb +71 -0
- data/spec/unit/resource/windows_update_settings_spec.rb +64 -0
- data/spec/unit/resource_spec.rb +19 -8
- data/spec/unit/secret_fetcher/akeyless_vault_spec.rb +37 -0
- data/spec/unit/secret_fetcher/aws_secrets_manager_spec.rb +70 -0
- data/spec/unit/secret_fetcher/azure_key_vault_spec.rb +70 -0
- data/spec/unit/secret_fetcher/hashi_vault_spec.rb +80 -0
- data/spec/unit/secret_fetcher_spec.rb +82 -0
- data/tasks/rspec.rb +2 -1
- metadata +106 -7
@@ -24,22 +24,22 @@ class Chef
|
|
24
24
|
description "Use the **chocolatey_config** resource to add or remove Chocolatey configuration keys."
|
25
25
|
introduced "14.3"
|
26
26
|
examples <<~DOC
|
27
|
-
|
27
|
+
**Set the Chocolatey cacheLocation config**:
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
29
|
+
```ruby
|
30
|
+
chocolatey_config 'Set cacheLocation config' do
|
31
|
+
config_key 'cacheLocation'
|
32
|
+
value 'C:\\temp\\choco'
|
33
|
+
end
|
34
|
+
```
|
35
35
|
|
36
|
-
|
36
|
+
**Unset a Chocolatey config**:
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
38
|
+
```ruby
|
39
|
+
chocolatey_config 'BogusConfig' do
|
40
|
+
action :unset
|
41
|
+
end
|
42
|
+
```
|
43
43
|
DOC
|
44
44
|
|
45
45
|
property :config_key, String, name_property: true,
|
@@ -74,7 +74,7 @@ class Chef
|
|
74
74
|
|
75
75
|
property :module_version, String,
|
76
76
|
introduced: "12.21",
|
77
|
-
description: "The version number of the module to use. PowerShell 5.0.10018.0 (or higher) supports having multiple versions of a module installed. This should be specified along with the module_name."
|
77
|
+
description: "The version number of the module to use. PowerShell 5.0.10018.0 (or higher) supports having multiple versions of a module installed. This should be specified along with the `module_name` property."
|
78
78
|
|
79
79
|
def property(property_name, value = nil)
|
80
80
|
unless property_name.is_a?(Symbol)
|
@@ -304,9 +304,9 @@ class Chef
|
|
304
304
|
gives a recipe full control over the command issued in a much cleaner, more
|
305
305
|
direct manner.
|
306
306
|
|
307
|
-
**Use the search
|
307
|
+
**Use the search Infra Language helper to find users**:
|
308
308
|
|
309
|
-
The following example shows how to use the `search` method in the
|
309
|
+
The following example shows how to use the `search` method in the Chef Infra Language to
|
310
310
|
search for users:
|
311
311
|
|
312
312
|
```ruby
|
@@ -515,7 +515,7 @@ class Chef
|
|
515
515
|
|
516
516
|
property :command, [ String, Array ],
|
517
517
|
name_property: true,
|
518
|
-
description: "An optional property to set the command to be executed if it differs from the resource block's name."
|
518
|
+
description: "An optional property to set the command to be executed if it differs from the resource block's name. Note: Use the **execute** resource to run a single command. Use multiple **execute** resource blocks to run multiple commands."
|
519
519
|
|
520
520
|
property :umask, [ String, Integer ],
|
521
521
|
description: "The file mode creation mask, or umask."
|
@@ -549,11 +549,11 @@ class Chef
|
|
549
549
|
desired_state: false
|
550
550
|
|
551
551
|
property :user, [ String, Integer ],
|
552
|
-
description: "The user name of the user identity with which to launch the new process. The user name may optionally be specified with a domain, i.e. `
|
552
|
+
description: "The user name of the user identity with which to launch the new process. The user name may optionally be specified with a domain, i.e. `domain\\user` or `user@my.dns.domain.com` via Universal Principal Name (UPN)format. It can also be specified without a domain simply as user if the domain is instead specified using the domain property. On Windows only, if this property is specified, the password property must be specified."
|
553
553
|
|
554
554
|
property :domain, String,
|
555
555
|
introduced: "12.21",
|
556
|
-
description: "Windows only: The domain of the user
|
556
|
+
description: "Windows only: The domain of the user specified by the user property. If not specified, the username and password specified by the `user` and `password` properties will be used to resolve that user against the domain in which the system running #{ChefUtils::Dist::Infra::PRODUCT} is joined, or if that system is not joined to a domain it will resolve the user as a local account on that system. An alternative way to specify the domain is to leave this property unspecified and specify the domain as part of the user property."
|
557
557
|
|
558
558
|
property :password, String, sensitive: true,
|
559
559
|
introduced: "12.21",
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Antony Thomas (<antonydeepak@gmail.com>)
|
3
|
+
# Copyright:: Copyright (c) Facebook, Inc. and its affiliates.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
class Chef
|
20
|
+
class Resource
|
21
|
+
class File
|
22
|
+
class Verification
|
23
|
+
|
24
|
+
#
|
25
|
+
# Extends File verification to provide Json verification
|
26
|
+
#
|
27
|
+
# Example:
|
28
|
+
# file 'foo.json' do
|
29
|
+
# content '{"foo": "bar"}'
|
30
|
+
# verify :json
|
31
|
+
# end
|
32
|
+
#
|
33
|
+
#
|
34
|
+
|
35
|
+
class Json < Chef::Resource::File::Verification
|
36
|
+
|
37
|
+
provides :json
|
38
|
+
|
39
|
+
def verify(path, opts = {})
|
40
|
+
Chef::JSONCompat.parse(IO.read(path))
|
41
|
+
true
|
42
|
+
rescue Chef::Exceptions::JSON::ParseError => e
|
43
|
+
Chef::Log.error("Json syntax verify failed with : #{e.message}")
|
44
|
+
false
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Antony Thomas (<antonydeepak@gmail.com>)
|
3
|
+
# Copyright:: Copyright (c) Chef Software Inc.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require "psych" unless defined?(Psych)
|
20
|
+
|
21
|
+
class Chef
|
22
|
+
class Resource
|
23
|
+
class File
|
24
|
+
class Verification
|
25
|
+
|
26
|
+
#
|
27
|
+
# Extends File verification to provide a Yaml verification
|
28
|
+
#
|
29
|
+
# Example:
|
30
|
+
# file 'foo.yaml' do
|
31
|
+
# content "--- foo: 'foo-"
|
32
|
+
# verify :yaml
|
33
|
+
# end
|
34
|
+
#
|
35
|
+
#
|
36
|
+
|
37
|
+
class Yaml < Chef::Resource::File::Verification
|
38
|
+
|
39
|
+
provides :yaml
|
40
|
+
|
41
|
+
def verify(path, opts = {})
|
42
|
+
Psych.parse_file(path)
|
43
|
+
true
|
44
|
+
rescue Psych::SyntaxError => e
|
45
|
+
Chef::Log.error("Yaml syntax verify failed with : #{e.message}")
|
46
|
+
false
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -83,7 +83,8 @@ class Chef
|
|
83
83
|
|
84
84
|
property :clear_sources, [ TrueClass, FalseClass, nil ],
|
85
85
|
description: "Set to `true` to download a gem from the path specified by the `source` property (and not from RubyGems).",
|
86
|
-
default: lazy { Chef::Config[:clear_gem_sources] },
|
86
|
+
default: lazy { Chef::Config[:clear_gem_sources] },
|
87
|
+
default_description: "false unless `clear_gem_sources` set to true in the `client.rb` config.", desired_state: false
|
87
88
|
|
88
89
|
property :gem_binary, String, desired_state: false,
|
89
90
|
description: "The path of a gem binary to use for the installation. By default, the same version of Ruby that is used by #{ChefUtils::Dist::Infra::PRODUCT} will be used."
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Chef Software, Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# li
|
16
|
+
|
17
|
+
def hab(*command)
|
18
|
+
# Windows shell_out does not support arrays, so manually cleaning and joining
|
19
|
+
hab_cmd = if windows?
|
20
|
+
(["hab"] + command).flatten.compact.join(" ")
|
21
|
+
else
|
22
|
+
(["hab"] + command)
|
23
|
+
end
|
24
|
+
shell_out!(hab_cmd)
|
25
|
+
rescue Errno::ENOENT
|
26
|
+
Chef::Log.fatal("'hab' binary not found, use the 'habitat_install' resource to install it first")
|
27
|
+
raise
|
28
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Chef Software Inc.
|
3
|
+
#
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require_relative "../package"
|
20
|
+
|
21
|
+
class Chef
|
22
|
+
class Resource
|
23
|
+
class HabitatPackage < Chef::Resource::Package
|
24
|
+
unified_mode true
|
25
|
+
|
26
|
+
provides :habitat_package
|
27
|
+
use "habitat_shared"
|
28
|
+
description "Use the **habitat_package** to install or remove Chef Habitat packages from Habitat Builder."
|
29
|
+
introduced "17.3"
|
30
|
+
examples <<~DOC
|
31
|
+
**Install core/redis**
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
habitat_package 'core/redis'
|
35
|
+
```
|
36
|
+
|
37
|
+
**Install specific version of a package from the unstable channel**
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
habitat_package 'core/redis' do
|
41
|
+
version '3.2.3'
|
42
|
+
channel 'unstable'
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
46
|
+
**Install a package with specific version and revision**
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
habitat_package 'core/redis' do
|
50
|
+
version '3.2.3/20160920131015'
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
54
|
+
**Install a package and force linking it's binary files to the system path**
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
habitat_package 'core/nginx' do
|
58
|
+
binlink :force
|
59
|
+
end
|
60
|
+
```
|
61
|
+
|
62
|
+
**Install a package and link it's binary files to the system path**
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
habitat_package 'core/nginx' do
|
66
|
+
options '--binlink'
|
67
|
+
end
|
68
|
+
```
|
69
|
+
|
70
|
+
**Remove package and all of it's versions**
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
habitat_package 'core/nginx'
|
74
|
+
action :remove
|
75
|
+
end
|
76
|
+
```
|
77
|
+
|
78
|
+
**Remove specified version of a package**
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
habitat_package 'core/nginx/3.2.3'
|
82
|
+
action :remove
|
83
|
+
end
|
84
|
+
```
|
85
|
+
|
86
|
+
**Remove package but retain some versions Note: Only available as of Habitat 1.5.86**
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
habitat_package 'core/nginx'
|
90
|
+
keep_latest '2'
|
91
|
+
action :remove
|
92
|
+
end
|
93
|
+
```
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
**Remove package but keep dependencies**
|
97
|
+
habitat_package 'core/nginx'
|
98
|
+
no_deps false
|
99
|
+
action :remove
|
100
|
+
end
|
101
|
+
```
|
102
|
+
DOC
|
103
|
+
|
104
|
+
property :bldr_url, String, default: "https://bldr.habitat.sh",
|
105
|
+
description: "The habitat builder url where packages will be downloaded from. **Defaults to public Habitat Builder**"
|
106
|
+
|
107
|
+
property :channel, String, default: "stable",
|
108
|
+
description: "The release channel to install your package from."
|
109
|
+
|
110
|
+
property :auth_token, String,
|
111
|
+
description: "Auth token for installing a package from a private organization on Habitat builder."
|
112
|
+
|
113
|
+
property :binlink, [true, false, :force], default: false,
|
114
|
+
description: "If habitat should attempt to binlink the package. Acceptable values: `true`, `false`, `:force`. Will fail on binlinking if set to `true` and binary or binlink exists."
|
115
|
+
|
116
|
+
property :options, String,
|
117
|
+
description: "Pass any additional parameters to the habitat package command."
|
118
|
+
|
119
|
+
property :keep_latest, String,
|
120
|
+
description: "Ability to uninstall while retaining a specified version **This feature only works in Habitat 1.5.86+.**"
|
121
|
+
|
122
|
+
property :exclude, String,
|
123
|
+
description: "Identifier of one or more packages that should not be uninstalled. (ex: core/redis, core/busybox-static/1.42.2/21120102031201)"
|
124
|
+
|
125
|
+
property :no_deps, [true, false], default: false,
|
126
|
+
description: "Remove package but retain dependencies."
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|