Update users cookbook and poise cookbooks
The poise cookbooks were incompatible with Chef 13
This commit is contained in:
1 parent
f93070c4c0
commit
ff3d062c73
65 files changed
+238
-130
No files matched your search
@@ -20,7 +20,11 @@ Batali.define do
|
||||
cookbook 'application_javascript', '~> 1.0.0'
|
||||
cookbook 'application_ruby', '~> 4.1.0'
|
||||
cookbook 'application_git', '~> 1.1.0' # 1.2.0 doesn't work with knife-solo
|
||||
cookbook 'users', '~> 5.0.0'
|
||||
cookbook 'poise', '~> 2.8.1'
|
||||
cookbook 'poise-languages', '~> 2.1.1'
|
||||
cookbook 'poise-ruby', '~> 2.3.0'
|
||||
cookbook 'poise-javascript', '~> 1.2.0'
|
||||
cookbook 'users', '~> 5.1.0'
|
||||
cookbook 'sudo', '~> 3.5.0'
|
||||
cookbook 'hostname', '~> 0.4.2'
|
||||
cookbook 'firewall', '~> 2.6.2'
|
||||
|
||||
+24
-24
@@ -574,18 +574,6 @@
|
||||
"version": "1.1.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "poise",
|
||||
"dependencies": [
|
||||
|
||||
],
|
||||
"version": "2.7.2",
|
||||
"source": {
|
||||
"type": "Batali::Source::Site",
|
||||
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/poise/versions/2.7.2/download",
|
||||
"version": "2.7.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "poise-build-essential",
|
||||
"dependencies": [
|
||||
@@ -632,11 +620,11 @@
|
||||
"~> 1.0"
|
||||
]
|
||||
],
|
||||
"version": "2.1.0",
|
||||
"version": "2.1.1",
|
||||
"source": {
|
||||
"type": "Batali::Source::Site",
|
||||
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/poise-languages/versions/2.1.0/download",
|
||||
"version": "2.1.0"
|
||||
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/poise-languages/versions/2.1.1/download",
|
||||
"version": "2.1.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -666,11 +654,11 @@
|
||||
"~> 2.0"
|
||||
]
|
||||
],
|
||||
"version": "2.2.0",
|
||||
"version": "2.3.0",
|
||||
"source": {
|
||||
"type": "Batali::Source::Site",
|
||||
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/poise-ruby/versions/2.2.0/download",
|
||||
"version": "2.2.0"
|
||||
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/poise-ruby/versions/2.3.0/download",
|
||||
"version": "2.3.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -746,11 +734,11 @@
|
||||
"~> 2.0"
|
||||
]
|
||||
],
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.0",
|
||||
"source": {
|
||||
"type": "Batali::Source::Site",
|
||||
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/poise-javascript/versions/1.1.0/download",
|
||||
"version": "1.1.0"
|
||||
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/poise-javascript/versions/1.2.0/download",
|
||||
"version": "1.2.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -838,16 +826,28 @@
|
||||
"version": "4.0.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "poise",
|
||||
"dependencies": [
|
||||
|
||||
],
|
||||
"version": "2.8.1",
|
||||
"source": {
|
||||
"type": "Batali::Source::Site",
|
||||
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/poise/versions/2.8.1/download",
|
||||
"version": "2.8.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "users",
|
||||
"dependencies": [
|
||||
|
||||
],
|
||||
"version": "5.0.0",
|
||||
"version": "5.1.0",
|
||||
"source": {
|
||||
"type": "Batali::Source::Site",
|
||||
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/users/versions/5.0.0/download",
|
||||
"version": "5.0.0"
|
||||
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/users/versions/5.1.0/download",
|
||||
"version": "5.1.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
# Poise-Javascript Changelog
|
||||
|
||||
## v1.2.0
|
||||
|
||||
* Updated Node.js versions. The default version is now the Boron LTS series.
|
||||
* Chef 13 support.
|
||||
|
||||
## v1.1.0
|
||||
|
||||
* New version list for Node.js.
|
||||
|
||||
@@ -317,7 +317,7 @@ The Poise test server infrastructure is sponsored by [Rackspace](https://rackspa
|
||||
|
||||
## License
|
||||
|
||||
Copyright 2015-2016, Noah Kantrowitz
|
||||
Copyright 2015-2017, Noah Kantrowitz
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -27,7 +27,7 @@ module PoiseJavascript
|
||||
provides(:nodejs)
|
||||
include PoiseLanguages::Static(
|
||||
# 4.x is still first here because that is what NodeJS recommends.
|
||||
versions: %w{4.5.0 6.4.0 6.3.1 6.2.2 6.1.0 6.0.0 5.11.0 5.10.1 5.9.1 5.8.0 5.7.1 5.6.0 5.5.0 5.4.1 5.3.0 5.2.0 5.1.1 5.0.0 4.4.3 4.3.2 4.2.6 4.1.1 4.0.0 0.12.7 0.11.16 0.10.40 0.9.12 0.8.28 0.7.12 0.6.21 0.5.10},
|
||||
versions: %w{6.10.2 7.9.0 7.8.0 7.7.4 7.6.0 7.5.0 7.4.0 7.3.0 7.2.1 7.1.0 7.0.0 6.9.5 6.8.1 6.7.0 6.6.0 6.5.0 6.4.0 6.3.1 6.2.2 6.0.0 5.12.0 5.11.1 5.10.1 5.9.1 5.8.0 5.7.1 5.6.0 5.5.0 5.4.1 5.3.0 5.2.0 5.0.0 4.8.2 4.7.3 4.6.2 4.5.0 4.4.7 4.3.2 4.2.6 4.1.2 4.0.0 0.12.18 0.11.16 0.10.48 0.9.12 0.8.28 0.7.12 0.6.21 0.5.10 0.4.12 0.3.8 0.2.6},
|
||||
machines: %w{linux-i686 linux-x86_64 linux-armv6l linux-armv7l linux-arm64 darwin-x86_64},
|
||||
url: 'https://nodejs.org/dist/v%{version}/node-v%{version}-%{kernel}-%{machine}.tar.gz',
|
||||
)
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -16,5 +16,5 @@
|
||||
|
||||
|
||||
module PoiseJavascript
|
||||
VERSION = '1.1.0'
|
||||
VERSION = '1.2.0'
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"name":"poise-javascript","version":"1.1.0","description":"A Chef cookbook for managing Node.js and io.js installations.","long_description":"# Poise-Javascript Cookbook\n\n[](https://travis-ci.org/poise/poise-javascript)\n[](https://rubygems.org/gems/poise-javascript)\n[](https://supermarket.chef.io/cookbooks/poise-javascript)\n[](https://codecov.io/github/poise/poise-javascript)\n[](https://gemnasium.com/poise/poise-javascript)\n[](https://www.apache.org/licenses/LICENSE-2.0)\n\nA [Chef](https://www.chef.io/) cookbook to provide a unified interface for\ninstalling server-side JavaScript runtimes like Node.js and io.js.\n\n## Quick Start\n\nTo install the latest available version of Node.js 0.12:\n\n```ruby\njavascript_runtime '0.12'\n```\n\n## Supported JavaScript Runtimes\n\nThis cookbook can install Node.js and io.js on Linux and OS X.\n\n## Requirements\n\nChef 12.1 or newer is required.\n\n## Attributes\n\nAttributes are used to configure the default recipe.\n\n* `node['poise-javascript']['install_nodejs']` – Install a Node.js runtime. *(default: true)*\n* `node['poise-javascript']['install_iojs']` – Install an io.js runtime. *(default: false)*\n\n## Recipes\n\n### `default`\n\nThe default recipe installs Node.js or io.js based on the node attributes. It is\nentirely optional and can be ignored in favor of direct use of the\n`javascript_runtime` resource.\n\n## Resources\n\n### `javascript_runtime`\n\nThe `javascript_runtime` resource installs a JavaScript interpreter.\n\n```ruby\njavascript_runtime '0.12'\n```\n\n#### Actions\n\n* `:install` – Install the JavaScript interpreter. *(default)*\n* `:uninstall` – Uninstall the JavaScript interpreter.\n\n#### Properties\n\n* `version` – Version of the runtime to install. If a partial version is given,\n use the latest available version matching that prefix. *(name property)*\n\n#### Provider Options\n\nThe `poise-javascript` library offers an additional way to pass configuration\ninformation to the final provider called \"options\". Options are key/value pairs\nthat are passed down to the `javascript_runtime` provider and can be used to control how it\ninstalls JavaScript. These can be set in the `javascript_runtime`\nresource using the `options` method, in node attributes or via the\n`javascript_runtime_options` resource. The options from all sources are merged\ntogether in to a single hash.\n\nWhen setting options in the resource you can either set them for all providers:\n\n```ruby\njavascript_runtime 'myapp' do\n version '0.10'\n options dev_package: false\nend\n```\n\nor for a single provider:\n\n```ruby\njavascript_runtime 'myapp' do\n version '0.10'\n options :system, dev_package: false\nend\n```\n\nSetting via node attributes is generally how an end-user or application cookbook\nwill set options to customize installations in the library cookbooks they are using.\nYou can set options for all installations or for a single runtime:\n\n```ruby\n# Global, for all installations.\noverride['poise-javascript']['options']['version'] = '0.10'\n# Single installation.\noverride['poise-javascript']['myapp']['version'] = 'iojs'\n```\n\nThe `javascript_runtime_options` resource is also available to set node attributes\nfor a specific installation in a DSL-friendly way:\n\n```ruby\njavascript_runtime_options 'myapp' do\n version 'iojs'\nend\n```\n\nUnlike resource attributes, provider options can be different for each provider.\nNot all providers support the same options so make sure to the check the\ndocumentation for each provider to see what options the use.\n\n### `javascript_runtime_options`\n\nThe `javascript_runtime_options` resource allows setting provider options in a\nDSL-friendly way. See [the Provider Options](#provider-options) section for more\ninformation about provider options overall.\n\n```ruby\njavascript_runtime_options 'myapp' do\n version 'iojs'\nend\n```\n\n#### Actions\n\n* `:run` – Apply the provider options. *(default)*\n\n#### Properties\n\n* `resource` – Name of the `javascript_runtime` resource. *(name property)*\n* `for_provider` – Provider to set options for.\n\nAll other attribute keys will be used as options data.\n\n### `javascript_execute`\n\nThe `javascript_execute` resource executes a JavaScript script using the configured runtime.\n\n```ruby\njavascript_execute 'myapp.js' do\n user 'myuser'\nend\n```\n\nThis uses the built-in `execute` resource and supports all the same properties.\n\n#### Actions\n\n* `:run` – Execute the script. *(default)*\n\n#### Properties\n\n* `command` Line truncated
|
||||
{"name":"poise-javascript","version":"1.2.0","description":"A Chef cookbook for managing Node.js and io.js installations.","long_description":"# Poise-Javascript Cookbook\n\n[](https://travis-ci.org/poise/poise-javascript)\n[](https://rubygems.org/gems/poise-javascript)\n[](https://supermarket.chef.io/cookbooks/poise-javascript)\n[](https://codecov.io/github/poise/poise-javascript)\n[](https://gemnasium.com/poise/poise-javascript)\n[](https://www.apache.org/licenses/LICENSE-2.0)\n\nA [Chef](https://www.chef.io/) cookbook to provide a unified interface for\ninstalling server-side JavaScript runtimes like Node.js and io.js.\n\n## Quick Start\n\nTo install the latest available version of Node.js 0.12:\n\n```ruby\njavascript_runtime '0.12'\n```\n\n## Supported JavaScript Runtimes\n\nThis cookbook can install Node.js and io.js on Linux and OS X.\n\n## Requirements\n\nChef 12.1 or newer is required.\n\n## Attributes\n\nAttributes are used to configure the default recipe.\n\n* `node['poise-javascript']['install_nodejs']` – Install a Node.js runtime. *(default: true)*\n* `node['poise-javascript']['install_iojs']` – Install an io.js runtime. *(default: false)*\n\n## Recipes\n\n### `default`\n\nThe default recipe installs Node.js or io.js based on the node attributes. It is\nentirely optional and can be ignored in favor of direct use of the\n`javascript_runtime` resource.\n\n## Resources\n\n### `javascript_runtime`\n\nThe `javascript_runtime` resource installs a JavaScript interpreter.\n\n```ruby\njavascript_runtime '0.12'\n```\n\n#### Actions\n\n* `:install` – Install the JavaScript interpreter. *(default)*\n* `:uninstall` – Uninstall the JavaScript interpreter.\n\n#### Properties\n\n* `version` – Version of the runtime to install. If a partial version is given,\n use the latest available version matching that prefix. *(name property)*\n\n#### Provider Options\n\nThe `poise-javascript` library offers an additional way to pass configuration\ninformation to the final provider called \"options\". Options are key/value pairs\nthat are passed down to the `javascript_runtime` provider and can be used to control how it\ninstalls JavaScript. These can be set in the `javascript_runtime`\nresource using the `options` method, in node attributes or via the\n`javascript_runtime_options` resource. The options from all sources are merged\ntogether in to a single hash.\n\nWhen setting options in the resource you can either set them for all providers:\n\n```ruby\njavascript_runtime 'myapp' do\n version '0.10'\n options dev_package: false\nend\n```\n\nor for a single provider:\n\n```ruby\njavascript_runtime 'myapp' do\n version '0.10'\n options :system, dev_package: false\nend\n```\n\nSetting via node attributes is generally how an end-user or application cookbook\nwill set options to customize installations in the library cookbooks they are using.\nYou can set options for all installations or for a single runtime:\n\n```ruby\n# Global, for all installations.\noverride['poise-javascript']['options']['version'] = '0.10'\n# Single installation.\noverride['poise-javascript']['myapp']['version'] = 'iojs'\n```\n\nThe `javascript_runtime_options` resource is also available to set node attributes\nfor a specific installation in a DSL-friendly way:\n\n```ruby\njavascript_runtime_options 'myapp' do\n version 'iojs'\nend\n```\n\nUnlike resource attributes, provider options can be different for each provider.\nNot all providers support the same options so make sure to the check the\ndocumentation for each provider to see what options the use.\n\n### `javascript_runtime_options`\n\nThe `javascript_runtime_options` resource allows setting provider options in a\nDSL-friendly way. See [the Provider Options](#provider-options) section for more\ninformation about provider options overall.\n\n```ruby\njavascript_runtime_options 'myapp' do\n version 'iojs'\nend\n```\n\n#### Actions\n\n* `:run` – Apply the provider options. *(default)*\n\n#### Properties\n\n* `resource` – Name of the `javascript_runtime` resource. *(name property)*\n* `for_provider` – Provider to set options for.\n\nAll other attribute keys will be used as options data.\n\n### `javascript_execute`\n\nThe `javascript_execute` resource executes a JavaScript script using the configured runtime.\n\n```ruby\njavascript_execute 'myapp.js' do\n user 'myuser'\nend\n```\n\nThis uses the built-in `execute` resource and supports all the same properties.\n\n#### Actions\n\n* `:run` – Execute the script. *(default)*\n\n#### Properties\n\n* `command` Line truncated
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## v2.1.1
|
||||
|
||||
* Fix the SCL repository enable command for RHEL.
|
||||
* Internal refactoring of the system package installer.
|
||||
|
||||
## v2.1.0
|
||||
|
||||
* Allow customizing properties on the system package install resource via a block
|
||||
|
||||
@@ -108,7 +108,7 @@ module PoiseLanguages
|
||||
# KNOW BY FILING A GITHUB ISSUE AT http://github.com/poise/poise-languages/issues/new.
|
||||
repo_name = "rhel-server-rhscl-#{node['platform_version'][0]}-rpms"
|
||||
execute "subscription-manager repos --enable #{repo_name}" do
|
||||
not_if { shell_out!('subscription-manager repos --list').stdout.include?(repo_name) }
|
||||
not_if { shell_out!('subscription-manager repos --list-enabled').stdout.include?(repo_name) }
|
||||
end
|
||||
else
|
||||
package 'centos-release-scl-rh' do
|
||||
|
||||
@@ -97,60 +97,86 @@ module PoiseLanguages
|
||||
#
|
||||
# @return [void]
|
||||
def action_install
|
||||
run_package_action(:install)
|
||||
notifying_block do
|
||||
install_packages
|
||||
run_action_hack
|
||||
end
|
||||
end
|
||||
|
||||
# The `upgrade` action for the `poise_languages_system` resource.
|
||||
#
|
||||
# @return [void]
|
||||
def action_upgrade
|
||||
run_package_action(:upgrade)
|
||||
notifying_block do
|
||||
upgrade_packages
|
||||
run_action_hack
|
||||
end
|
||||
end
|
||||
|
||||
# The `uninstall` action for the `poise_languages_system` resource.
|
||||
#
|
||||
# @return [void]
|
||||
def action_uninstall
|
||||
action = node.platform_family?('debian') ? :purge : :remove
|
||||
package_resources(action).each do |resource|
|
||||
resource.run_action(action)
|
||||
new_resource.updated_by_last_action(true) if resource.updated_by_last_action?
|
||||
notifying_block do
|
||||
uninstall_packages
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Create package resource objects for all needed packages. These are created
|
||||
# directly and not added to the resource collection.
|
||||
# Install the needed language packages.
|
||||
#
|
||||
# @return [Array<Chef::Resource::Package>]
|
||||
def package_resources(action)
|
||||
# @api private
|
||||
# @return [Array<Chef::Resource>]
|
||||
def install_packages
|
||||
packages = {new_resource.package_name => new_resource.package_version}
|
||||
# If we are supposed to install the dev package, grab it using the same
|
||||
# version as the main package.
|
||||
if new_resource.dev_package
|
||||
packages[new_resource.dev_package] = new_resource.package_version
|
||||
end
|
||||
|
||||
Chef::Log.debug("[#{new_resource.parent}] Building package resource using #{packages.inspect}.")
|
||||
|
||||
# Check for multi-package support.
|
||||
package_resource_class = Chef::Resource.resource_for_node(:package, node)
|
||||
@package_resource ||= if node.platform_family?('rhel', 'fedora', 'amazon', 'mac_os_x')
|
||||
# @todo Can't use multi-package mode with yum pending https://github.com/chef/chef/issues/3476.
|
||||
packages.map do |name, version|
|
||||
package_resource_class.new(name, run_context).tap do |r|
|
||||
r.version(version)
|
||||
r.action(action)
|
||||
r.declared_type = :package
|
||||
r.retries(5)
|
||||
end
|
||||
package_provider_class = package_resource_class.new('multipackage_check', run_context).provider_for_action(:install)
|
||||
package_resources = if package_provider_class.respond_to?(:use_multipackage_api?) && package_provider_class.use_multipackage_api?
|
||||
package packages.keys do
|
||||
version packages.values
|
||||
end
|
||||
else
|
||||
[package_resource_class.new(packages.keys, run_context).tap do |r|
|
||||
r.version(packages.values)
|
||||
r.action(action)
|
||||
r.declared_type = :package
|
||||
r.retries(5)
|
||||
end]
|
||||
# Fallback for non-multipackage.
|
||||
packages.map do |pkg_name, pkg_version|
|
||||
package pkg_name do
|
||||
version pkg_version
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Apply some settings to all of the resources.
|
||||
Array(package_resources).each do |res|
|
||||
res.retries(5)
|
||||
res.define_singleton_method(:apply_action_hack?) { true }
|
||||
end
|
||||
end
|
||||
|
||||
# Upgrade the needed language packages.
|
||||
#
|
||||
# @api private
|
||||
# @return [Array<Chef::Resource>]
|
||||
def upgrade_packages
|
||||
install_packages.each do |res|
|
||||
res.action(:upgrade)
|
||||
end
|
||||
end
|
||||
|
||||
# Uninstall the needed language packages.
|
||||
#
|
||||
# @api private
|
||||
# @return [Array<Chef::Resource>]
|
||||
def uninstall_packages
|
||||
install_packages.each do |res|
|
||||
res.action(node.platform_family?('debian') ? :purge : :remove)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -161,21 +187,34 @@ module PoiseLanguages
|
||||
#
|
||||
# @param action [Symbol] Action to run on all package resources.
|
||||
# @return [void]
|
||||
def run_package_action(action)
|
||||
package_resources(action).each do |resource|
|
||||
# Reset it so we have a clean baseline.
|
||||
resource.updated_by_last_action(false)
|
||||
# Grab the provider.
|
||||
provider = resource.provider_for_action(action)
|
||||
provider.action = action
|
||||
# Check the candidate version if needed. With a manual package_version
|
||||
# you get whatever you asked for.
|
||||
patch_load_current_resource!(provider, new_resource.version) unless new_resource.package_version
|
||||
# Run our action.
|
||||
Chef::Log.debug("[#{new_resource.parent}] Running #{provider} with #{action}")
|
||||
provider.run_action(action)
|
||||
# Check updated flag.
|
||||
new_resource.updated_by_last_action(true) if resource.updated_by_last_action?
|
||||
def run_action_hack
|
||||
# If new_resource.package_version is set, skip this madness.
|
||||
return if new_resource.package_version
|
||||
|
||||
# Process every resource in the current collection, which is bounded
|
||||
# by notifying_block.
|
||||
run_context.resource_collection.each do |resource|
|
||||
# Only apply to things we tagged above.
|
||||
next unless resource.respond_to?(:apply_action_hack?) && resource.apply_action_hack?
|
||||
|
||||
Array(resource.action).each do |action|
|
||||
# Reset it so we have a clean baseline.
|
||||
resource.updated_by_last_action(false)
|
||||
# Grab the provider.
|
||||
provider = resource.provider_for_action(action)
|
||||
provider.action = action
|
||||
# Inject our check for the candidate version. This will actually
|
||||
# get run during run_action below.
|
||||
patch_load_current_resource!(provider, new_resource.version)
|
||||
# Run our action.
|
||||
Chef::Log.debug("[#{new_resource.parent}] Running #{provider} with #{action}")
|
||||
provider.run_action(action)
|
||||
# Check updated flag.
|
||||
new_resource.updated_by_last_action(true) if resource.updated_by_last_action?
|
||||
end
|
||||
|
||||
# Make sure the resource doesn't run again when notifying_block ends.
|
||||
resource.action(:nothing)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -16,5 +16,5 @@
|
||||
|
||||
|
||||
module PoiseLanguages
|
||||
VERSION = '2.1.0'
|
||||
VERSION = '2.1.1'
|
||||
end
|
||||
@@ -1 +1 @@
|
||||
{"name":"poise-languages","version":"2.1.0","description":"A Chef cookbook to help writing language cookbooks.","long_description":"# Poise-Languages Cookbook\n\n[](https://travis-ci.org/poise/poise-languages)\n[](https://rubygems.org/gems/poise-languages)\n[](https://supermarket.chef.io/cookbooks/poise-languages)\n[](https://codecov.io/github/poise/poise-languages)\n[](https://gemnasium.com/poise/poise-languages)\n[](https://www.apache.org/licenses/LICENSE-2.0)\n\nShared support code for Poise's language cookbooks like poise-ruby and\npoise-python.\n\n## License\n\nCopyright 2015-2017, Noah Kantrowitz\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","maintainer":"Noah Kantrowitz","maintainer_email":"noah@coderanger.net","license":"Apache 2.0","platforms":{},"dependencies":{"poise":"~> 2.5","poise-archive":"~> 1.0"},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/poise/poise-languages","issues_url":"https://github.com/poise/poise-languages/issues","chef_version":[["< 14",">= 12.1"],[]],"ohai_version":[[]]}
|
||||
{"name":"poise-languages","version":"2.1.1","description":"A Chef cookbook to help writing language cookbooks.","long_description":"# Poise-Languages Cookbook\n\n[](https://travis-ci.org/poise/poise-languages)\n[](https://rubygems.org/gems/poise-languages)\n[](https://supermarket.chef.io/cookbooks/poise-languages)\n[](https://codecov.io/github/poise/poise-languages)\n[](https://gemnasium.com/poise/poise-languages)\n[](https://www.apache.org/licenses/LICENSE-2.0)\n\nShared support code for Poise's language cookbooks like poise-ruby and\npoise-python.\n\n## License\n\nCopyright 2015-2017, Noah Kantrowitz\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","maintainer":"Noah Kantrowitz","maintainer_email":"noah@coderanger.net","license":"Apache-2.0","platforms":{"aix":">= 0.0.0","amazon":">= 0.0.0","arch":">= 0.0.0","centos":">= 0.0.0","chefspec":">= 0.0.0","debian":">= 0.0.0","dragonfly4":">= 0.0.0","fedora":">= 0.0.0","freebsd":">= 0.0.0","gentoo":">= 0.0.0","ios_xr":">= 0.0.0","mac_os_x":">= 0.0.0","nexus":">= 0.0.0","omnios":">= 0.0.0","openbsd":">= 0.0.0","opensuse":">= 0.0.0","oracle":">= 0.0.0","raspbian":">= 0.0.0","redhat":">= 0.0.0","slackware":">= 0.0.0","smartos":">= 0.0.0","solaris2":">= 0.0.0","suse":">= 0.0.0","ubuntu":">= 0.0.0","windows":">= 0.0.0"},"dependencies":{"poise":"~> 2.5","poise-archive":"~> 1.0"},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/poise/poise-languages","issues_url":"https://github.com/poise/poise-languages/issues","chef_version":[["< 14",">= 12.1"]],"ohai_version":[]}
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## v2.3.0
|
||||
|
||||
* Chef 13 support.
|
||||
|
||||
## v2.2.0
|
||||
|
||||
* Add support for Ubuntu 16.04 system packages.
|
||||
|
||||
@@ -290,7 +290,7 @@ The Poise test server infrastructure is sponsored by [Rackspace](https://rackspa
|
||||
|
||||
## License
|
||||
|
||||
Copyright 2015-2016, Noah Kantrowitz
|
||||
Copyright 2015-2017, Noah Kantrowitz
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -128,7 +128,7 @@ module PoiseRuby
|
||||
#
|
||||
# @return [String]
|
||||
def bundler_binary
|
||||
@bundler_binary ||= ::File.join(gem_bindir, 'bundle')
|
||||
@bundler_binary ||= ::File.join(poise_gem_bindir, 'bundle')
|
||||
end
|
||||
|
||||
# Find the absolute path to the Gemfile. This mirrors bundler's internal
|
||||
@@ -168,8 +168,12 @@ module PoiseRuby
|
||||
# the required configuration on the resource combined with gem having
|
||||
# terrible output formats.
|
||||
#
|
||||
# Renamed from #gem_bindir in 2.3.0 because of a conflict with a method
|
||||
# of the same name in Chef::Mixin::PathSanity (which is pulled in via
|
||||
# ShellOut) added in 13.0.
|
||||
#
|
||||
# @return [String]
|
||||
def gem_bindir
|
||||
def poise_gem_bindir
|
||||
cmd = ruby_shell_out!(new_resource.gem_binary, 'environment')
|
||||
# Parse a line like:
|
||||
# - EXECUTABLE DIRECTORY: /usr/local/bin
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -16,5 +16,5 @@
|
||||
|
||||
|
||||
module PoiseRuby
|
||||
VERSION = '2.2.0'
|
||||
VERSION = '2.3.0'
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"name":"poise-ruby","version":"2.2.0","description":"A Chef cookbook for managing Ruby installations.","long_description":"# Poise-Ruby Cookbook\n\n[](https://travis-ci.org/poise/poise-ruby)\n[](https://rubygems.org/gems/poise-ruby)\n[](https://supermarket.chef.io/cookbooks/poise-ruby)\n[](https://codecov.io/github/poise/poise-ruby)\n[](https://gemnasium.com/poise/poise-ruby)\n[](https://www.apache.org/licenses/LICENSE-2.0)\n\nA [Chef](https://www.chef.io/) cookbook to provide a unified interface for\ninstalling Ruby and running things with it. This README covers the 2.x version\nof the cookbook, the 1.x version is very different and no longer supported.\n\n## Quick Start\n\nTo install the latest available version of Ruby 2.x and then use it to install\nsome gems:\n\n```ruby\nruby_runtime '2'\n\nruby_gem 'rake'\n\nbundle_install '/path/to/Gemfile' do\n without 'development'\n deployment true\nend\n```\n\n## Requirements\n\nChef 12.1 or newer is required.\n\n## Attributes\n\nAttributes are used to configure the default recipe.\n\n* `node['poise-ruby']['install_ruby']` – Install a Ruby runtime. *(default: true)*\n* `node['poise-ruby']['install_chef_ruby']` – Create a `ruby_runtime` using\n the `:chef` provider. Doesn't actually install anything. *(default: true)*\n\n## Recipes\n\n### `default`\n\nThe default recipe installs Ruby based on the node attributes. It is entirely\noptional and can be ignored in favor of direct use of the `ruby_runtime`\nresource.\n\n## Resources\n\n### `ruby_runtime`\n\nThe `ruby_runtime` resource installs a Ruby interpreter.\n\n```ruby\nruby_runtime 'any' do\n version ''\nend\n```\n\n#### Actions\n\n* `:install` – Install the Ruby interpreter. *(default)*\n* `:uninstall` – Uninstall the Ruby interpreter.\n\n#### Properties\n\n* `version` – Version of Ruby to install. If a partial version is given, use the\n latest available version matching that prefix. *(name properties)*\n\n#### Provider Options\n\nThe `poise-ruby` library offers an additional way to pass configuration\ninformation to the final provider called \"options\". Options are key/value pairs\nthat are passed down to the ruby_runtime provider and can be used to control how it\ninstalls Ruby. These can be set in the `ruby_runtime`\nresource using the `options` method, in node attributes or via the\n`ruby_runtime_options` resource. The options from all sources are merged\ntogether in to a single hash.\n\nWhen setting options in the resource you can either set them for all providers:\n\n```ruby\nruby_runtime 'myapp' do\n version '2.1'\n options dev_package: false\nend\n```\n\nor for a single provider:\n\n```ruby\nruby_runtime 'myapp' do\n version '2.1'\n options :system, dev_package: false\nend\n```\n\nSetting via node attributes is generally how an end-user or application cookbook\nwill set options to customize installations in the library cookbooks they are using.\nYou can set options for all installations or for a single runtime:\n\n```ruby\n# Global, for all installations.\noverride['poise-ruby']['options']['dev_package'] = false\n# Single installation.\noverride['poise-ruby']['myapp']['version'] = '2.2'\n```\n\nThe `ruby_runtime_options` resource is also available to set node attributes\nfor a specific installation in a DSL-friendly way:\n\n```ruby\nruby_runtime_options 'myapp' do\n version '2.2'\nend\n```\n\nUnlike resource attributes, provider options can be different for each provider.\nNot all providers support the same options so make sure to the check the\ndocumentation for each provider to see what options the use.\n\n### `ruby_runtime_options`\n\nThe `ruby_runtime_options` resource allows setting provider options in a\nDSL-friendly way. See [the Provider Options](#provider-options) section for more\ninformation about provider options overall.\n\n```ruby\nruby_runtime_options 'myapp' do\n version '2.2'\nend\n```\n\n#### Actions\n\n* `:run` – Apply the provider options. *(default)*\n\n#### Properties\n\n* `resource` – Name of the `ruby_runtime` resource. *(name property)*\n* `for_provider` – Provider to set options for.\n\nAll other property keys will be used as options data.\n\n### `ruby_execute`\n\nThe `ruby_execute` resource executes a Ruby script using the configured runtime.\n\n```ruby\nruby_execute 'myapp.rb' do\n user 'myuser'\nend\n```\n\nThis uses the built-in `execute` resource and supports all the same properties.\n\n#### Actions\n\n* `:run` – Execute the script. *(default)*\n\n#### Properties\n\n* `command` – Script and arguments to run. Must not include the `ruby`. *(name prLine truncated
|
||||
{"name":"poise-ruby","version":"2.3.0","description":"A Chef cookbook for managing Ruby installations.","long_description":"# Poise-Ruby Cookbook\n\n[](https://travis-ci.org/poise/poise-ruby)\n[](https://rubygems.org/gems/poise-ruby)\n[](https://supermarket.chef.io/cookbooks/poise-ruby)\n[](https://codecov.io/github/poise/poise-ruby)\n[](https://gemnasium.com/poise/poise-ruby)\n[](https://www.apache.org/licenses/LICENSE-2.0)\n\nA [Chef](https://www.chef.io/) cookbook to provide a unified interface for\ninstalling Ruby and running things with it. This README covers the 2.x version\nof the cookbook, the 1.x version is very different and no longer supported.\n\n## Quick Start\n\nTo install the latest available version of Ruby 2.x and then use it to install\nsome gems:\n\n```ruby\nruby_runtime '2'\n\nruby_gem 'rake'\n\nbundle_install '/path/to/Gemfile' do\n without 'development'\n deployment true\nend\n```\n\n## Requirements\n\nChef 12.1 or newer is required.\n\n## Attributes\n\nAttributes are used to configure the default recipe.\n\n* `node['poise-ruby']['install_ruby']` – Install a Ruby runtime. *(default: true)*\n* `node['poise-ruby']['install_chef_ruby']` – Create a `ruby_runtime` using\n the `:chef` provider. Doesn't actually install anything. *(default: true)*\n\n## Recipes\n\n### `default`\n\nThe default recipe installs Ruby based on the node attributes. It is entirely\noptional and can be ignored in favor of direct use of the `ruby_runtime`\nresource.\n\n## Resources\n\n### `ruby_runtime`\n\nThe `ruby_runtime` resource installs a Ruby interpreter.\n\n```ruby\nruby_runtime 'any' do\n version ''\nend\n```\n\n#### Actions\n\n* `:install` – Install the Ruby interpreter. *(default)*\n* `:uninstall` – Uninstall the Ruby interpreter.\n\n#### Properties\n\n* `version` – Version of Ruby to install. If a partial version is given, use the\n latest available version matching that prefix. *(name properties)*\n\n#### Provider Options\n\nThe `poise-ruby` library offers an additional way to pass configuration\ninformation to the final provider called \"options\". Options are key/value pairs\nthat are passed down to the ruby_runtime provider and can be used to control how it\ninstalls Ruby. These can be set in the `ruby_runtime`\nresource using the `options` method, in node attributes or via the\n`ruby_runtime_options` resource. The options from all sources are merged\ntogether in to a single hash.\n\nWhen setting options in the resource you can either set them for all providers:\n\n```ruby\nruby_runtime 'myapp' do\n version '2.1'\n options dev_package: false\nend\n```\n\nor for a single provider:\n\n```ruby\nruby_runtime 'myapp' do\n version '2.1'\n options :system, dev_package: false\nend\n```\n\nSetting via node attributes is generally how an end-user or application cookbook\nwill set options to customize installations in the library cookbooks they are using.\nYou can set options for all installations or for a single runtime:\n\n```ruby\n# Global, for all installations.\noverride['poise-ruby']['options']['dev_package'] = false\n# Single installation.\noverride['poise-ruby']['myapp']['version'] = '2.2'\n```\n\nThe `ruby_runtime_options` resource is also available to set node attributes\nfor a specific installation in a DSL-friendly way:\n\n```ruby\nruby_runtime_options 'myapp' do\n version '2.2'\nend\n```\n\nUnlike resource attributes, provider options can be different for each provider.\nNot all providers support the same options so make sure to the check the\ndocumentation for each provider to see what options the use.\n\n### `ruby_runtime_options`\n\nThe `ruby_runtime_options` resource allows setting provider options in a\nDSL-friendly way. See [the Provider Options](#provider-options) section for more\ninformation about provider options overall.\n\n```ruby\nruby_runtime_options 'myapp' do\n version '2.2'\nend\n```\n\n#### Actions\n\n* `:run` – Apply the provider options. *(default)*\n\n#### Properties\n\n* `resource` – Name of the `ruby_runtime` resource. *(name property)*\n* `for_provider` – Provider to set options for.\n\nAll other property keys will be used as options data.\n\n### `ruby_execute`\n\nThe `ruby_execute` resource executes a Ruby script using the configured runtime.\n\n```ruby\nruby_execute 'myapp.rb' do\n user 'myuser'\nend\n```\n\nThis uses the built-in `execute` resource and supports all the same properties.\n\n#### Actions\n\n* `:run` – Execute the script. *(default)*\n\n#### Properties\n\n* `command` – Script and arguments to run. Must not include the `ruby`. *(name prLine truncated
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2015-2016, Noah Kantrowitz
|
||||
# Copyright 2015-2017, Noah Kantrowitz
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
# Changelog
|
||||
|
||||
## v2.8.1
|
||||
|
||||
* Fix a missing `require` when using `subclass_providers!` on Chef 12.3.
|
||||
|
||||
## v2.8.0
|
||||
|
||||
* Chef 13 compatibility.
|
||||
* Passing a symbol for the parent now works with the `include Poise(:name)`
|
||||
shortcut.
|
||||
* Fixed `subclass_providers!` on older versions of Chef.
|
||||
|
||||
## v2.7.2
|
||||
|
||||
* Test harness fixes for Chef.
|
||||
|
||||
@@ -69,7 +69,7 @@ end
|
||||
# include Poise(container: true)
|
||||
def Poise(options={})
|
||||
# Allow passing a class as a shortcut
|
||||
if options.is_a?(Class)
|
||||
if options.is_a?(Class) || options.is_a?(Symbol)
|
||||
options = {parent: options}
|
||||
end
|
||||
|
||||
|
||||
@@ -99,6 +99,8 @@ module Poise
|
||||
raise Poise::Error.new("Parser must be a Proc or Symbol: #{parser.inspect}") if parser && !(parser.is_a?(Proc) || parser.is_a?(Symbol))
|
||||
# Cast to a set at definition time.
|
||||
forced_keys = Set.new(forced_keys) unless forced_keys.is_a?(Set)
|
||||
# Never allow name to be called accidentally since it does really wonky things.
|
||||
forced_keys.add(:name)
|
||||
# Unlike LWRPBase.attribute, I don't care about Ruby 1.8. Worlds tiniest violin.
|
||||
define_method(name.to_sym) do |arg=nil, &block|
|
||||
iv_sym = :"@#{name}"
|
||||
|
||||
@@ -14,6 +14,12 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
begin
|
||||
require 'chef/chef_class'
|
||||
rescue LoadError
|
||||
# This space left intentionally blank, fallback is below.
|
||||
end
|
||||
|
||||
require 'poise/error'
|
||||
require 'poise/helpers/resource_name'
|
||||
|
||||
@@ -39,7 +45,12 @@ module Poise
|
||||
# Deal with the node maps.
|
||||
node_maps = {}
|
||||
node_maps['handler map'] = Chef.provider_handler_map if defined?(Chef.provider_handler_map)
|
||||
node_maps['priority map'] = Chef.provider_priority_map if defined?(Chef.provider_priority_map)
|
||||
node_maps['priority map'] = if defined?(Chef.provider_priority_map)
|
||||
Chef.provider_priority_map
|
||||
else
|
||||
require 'chef/platform/provider_priority_map'
|
||||
Chef::Platform::ProviderPriorityMap.instance.send(:priority_map)
|
||||
end
|
||||
# Patch anything in the descendants tracker.
|
||||
Chef::Provider.descendants.each do |provider|
|
||||
node_maps["#{provider} node map"] = provider.node_map if defined?(provider.node_map)
|
||||
|
||||
@@ -16,5 +16,5 @@
|
||||
|
||||
|
||||
module Poise
|
||||
VERSION = '2.7.2'
|
||||
VERSION = '2.8.1'
|
||||
end
|
||||
@@ -1 +1 @@
|
||||
{"name":"poise","version":"2.7.2","description":"Helpers for writing extensible Chef cookbooks.","long_description":"# Poise\n\n[](https://travis-ci.org/poise/poise)\n[](https://rubygems.org/gems/poise)\n[](https://supermarket.chef.io/cookbooks/poise)\n[](https://codecov.io/github/poise/poise)\n[](https://gemnasium.com/poise/poise)\n[](https://www.apache.org/licenses/LICENSE-2.0)\n\n## What is Poise?\n\nThe poise cookbook is a set of libraries for writing reusable cookbooks. It\nprovides helpers for common patterns and a standard structure to make it easier to create flexible cookbooks.\n\n## Writing your first resource\n\nRather than LWRPs, Poise promotes the idea of using normal, or \"heavy weight\"\nresources, while including helpers to reduce much of boilerplate needed for this. Each resource goes in its own file under `libraries/` named to match\nthe resource, which is in turn based on the class name. This means that the file `libraries/my_app.rb` would contain `Chef::Resource::MyApp` which maps to the resource `my_app`.\n\nAn example of a simple shell to start from:\n\n```ruby\nrequire 'poise'\nrequire 'chef/resource'\nrequire 'chef/provider'\n\nmodule MyApp\n class Resource < Chef::Resource\n include Poise\n provides(:my_app)\n actions(:enable)\n\n attribute(:path, kind_of: String)\n # Other attribute definitions.\n end\n\n class Provider < Chef::Provider\n include Poise\n provides(:my_app)\n\n def action_enable\n notifying_block do\n ... # Normal Chef recipe code goes here\n end\n end\n end\nend\n```\n\nStarting from the top, first we require the libraries we will be using. Then we\ncreate a module to hold our resource and provider. If your cookbook declares\nmultiple resources and/or providers, you might want additional nesting here.\nThen we declare the resource class, which inherits from `Chef::Resource`. This\nis similar to the `resources/` file in an LWRP, and a similar DSL can be used.\nWe then include the `Poise` mixin to load our helpers, and then call\n`provides(:my_app)` to tell Chef this class will implement the `my_app`\nresource. Then we use the familiar DSL, though with a few additions we'll cover\nlater.\n\nThen we declare the provider class, again similar to the `providers/` file in an\nLWRP. We include the `Poise` mixin again to get access to all the helpers and\ncall `provides()` to tell Chef what provider this is. Rather than use the\n`action :enable do ... end` DSL from LWRPs, we just define the action method\ndirectly. The implementation of action comes from a block of recipe code\nwrapped with `notifying_block` to capture changes in much the same way as\n`use_inline_resources`, see below for more information about all the features of\n`notifying_block`.\n\nWe can then use this resource like any other Chef resource:\n\n```ruby\nmy_app 'one' do\n path '/tmp'\nend\n```\n\n## Helpers\n\nWhile not exposed as a specific method, Poise will automatically set the\n`resource_name` based on the class name.\n\n### Notifying Block\n\nAs mentioned above, `notifying_block` is similar to `use_inline_resources` in LWRPs. Any Chef resource created inside the block will be converged in a sub-context and if any have updated it will trigger notifications on the current resource. Unlike `use_inline_resources`, resources inside the sub-context can still see resources outside of it, with lookups propagating up sub-contexts until a match is found. Also any delayed notifications are scheduled to run at the end of the main converge cycle, instead of the end of this inner converge.\n\nThis can be used to write action methods using the normal Chef recipe DSL, while still offering more flexibility through subclassing and other forms of code reuse.\n\n### Include Recipe\n\nIn keeping with `notifying_block` to implement action methods using the Chef DSL, Poise adds an `include_recipe` helper to match the method of the same name in recipes. This will load and converge the requested recipe.\n\n### Resource DSL\n\nTo make writing resource classes easier, Poise exposes a DSL similar to LWRPs for defining actions and attributes. Both `actions` and\n`default_action` are just like in LWRPs, though `default_action` is rarely needed as the first action becomes the default. `attribute` is also available just like in LWRPs, but with some enhancements noted below.\n\nOne notable difference over the standard DSL method is that Poise attributes\ncan take a block argument.\n\n#### Template Content\n\nA common pattern with resources is to allow passing either a template filename or raw file content to be usLine truncated
|
||||
{"name":"poise","version":"2.8.1","description":"Helpers for writing extensible Chef cookbooks.","long_description":"# Poise\n\n[](https://travis-ci.org/poise/poise)\n[](https://rubygems.org/gems/poise)\n[](https://supermarket.chef.io/cookbooks/poise)\n[](https://codecov.io/github/poise/poise)\n[](https://gemnasium.com/poise/poise)\n[](https://www.apache.org/licenses/LICENSE-2.0)\n\n## What is Poise?\n\nThe poise cookbook is a set of libraries for writing reusable cookbooks. It\nprovides helpers for common patterns and a standard structure to make it easier to create flexible cookbooks.\n\n## Writing your first resource\n\nRather than LWRPs, Poise promotes the idea of using normal, or \"heavy weight\"\nresources, while including helpers to reduce much of boilerplate needed for this. Each resource goes in its own file under `libraries/` named to match\nthe resource, which is in turn based on the class name. This means that the file `libraries/my_app.rb` would contain `Chef::Resource::MyApp` which maps to the resource `my_app`.\n\nAn example of a simple shell to start from:\n\n```ruby\nrequire 'poise'\nrequire 'chef/resource'\nrequire 'chef/provider'\n\nmodule MyApp\n class Resource < Chef::Resource\n include Poise\n provides(:my_app)\n actions(:enable)\n\n attribute(:path, kind_of: String)\n # Other attribute definitions.\n end\n\n class Provider < Chef::Provider\n include Poise\n provides(:my_app)\n\n def action_enable\n notifying_block do\n ... # Normal Chef recipe code goes here\n end\n end\n end\nend\n```\n\nStarting from the top, first we require the libraries we will be using. Then we\ncreate a module to hold our resource and provider. If your cookbook declares\nmultiple resources and/or providers, you might want additional nesting here.\nThen we declare the resource class, which inherits from `Chef::Resource`. This\nis similar to the `resources/` file in an LWRP, and a similar DSL can be used.\nWe then include the `Poise` mixin to load our helpers, and then call\n`provides(:my_app)` to tell Chef this class will implement the `my_app`\nresource. Then we use the familiar DSL, though with a few additions we'll cover\nlater.\n\nThen we declare the provider class, again similar to the `providers/` file in an\nLWRP. We include the `Poise` mixin again to get access to all the helpers and\ncall `provides()` to tell Chef what provider this is. Rather than use the\n`action :enable do ... end` DSL from LWRPs, we just define the action method\ndirectly. The implementation of action comes from a block of recipe code\nwrapped with `notifying_block` to capture changes in much the same way as\n`use_inline_resources`, see below for more information about all the features of\n`notifying_block`.\n\nWe can then use this resource like any other Chef resource:\n\n```ruby\nmy_app 'one' do\n path '/tmp'\nend\n```\n\n## Helpers\n\nWhile not exposed as a specific method, Poise will automatically set the\n`resource_name` based on the class name.\n\n### Notifying Block\n\nAs mentioned above, `notifying_block` is similar to `use_inline_resources` in LWRPs. Any Chef resource created inside the block will be converged in a sub-context and if any have updated it will trigger notifications on the current resource. Unlike `use_inline_resources`, resources inside the sub-context can still see resources outside of it, with lookups propagating up sub-contexts until a match is found. Also any delayed notifications are scheduled to run at the end of the main converge cycle, instead of the end of this inner converge.\n\nThis can be used to write action methods using the normal Chef recipe DSL, while still offering more flexibility through subclassing and other forms of code reuse.\n\n### Include Recipe\n\nIn keeping with `notifying_block` to implement action methods using the Chef DSL, Poise adds an `include_recipe` helper to match the method of the same name in recipes. This will load and converge the requested recipe.\n\n### Resource DSL\n\nTo make writing resource classes easier, Poise exposes a DSL similar to LWRPs for defining actions and attributes. Both `actions` and\n`default_action` are just like in LWRPs, though `default_action` is rarely needed as the first action becomes the default. `attribute` is also available just like in LWRPs, but with some enhancements noted below.\n\nOne notable difference over the standard DSL method is that Poise attributes\ncan take a block argument.\n\n#### Template Content\n\nA common pattern with resources is to allow passing either a template filename or raw file content to be usLine truncated
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
This file is used to list changes made in each version of the users cookbook.
|
||||
|
||||
## 5.1.0 (2017-05-30)
|
||||
|
||||
- Keep ssh keys out of the chef logs
|
||||
- Improve docs and examples
|
||||
- Remove class_eval and require Chef 12.7+ as class_eval causes issues with later Chef 12 releases
|
||||
|
||||
## 5.0.0 (2017-04-17)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
@@ -10,8 +10,6 @@ This cookbook is concerned with the management of OS users and groups from datab
|
||||
|
||||
## Requirements
|
||||
|
||||
A data bag populated with user objects must exist. The default data bag in this recipe is `users`. See USAGE.
|
||||
|
||||
### Platforms
|
||||
|
||||
The following platforms have been tested with Test Kitchen:
|
||||
@@ -45,7 +43,7 @@ or to pin to a specific version of the users cookbook, in this case any version
|
||||
depends 'users', '~> 2'
|
||||
```
|
||||
|
||||
Then in a recipe:
|
||||
Then in a recipe use the `user_manage` resource to add all users in the defined group to the system:
|
||||
|
||||
```ruby
|
||||
users_manage 'GROUPNAME' do
|
||||
@@ -86,6 +84,16 @@ A sample user object in a users databag would look like:
|
||||
}
|
||||
```
|
||||
|
||||
A sample user to remove from a system would like like:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "mwaddams",
|
||||
"action": "remove",
|
||||
"groups": [ "testgroup", "nfsgroup" ]
|
||||
}
|
||||
```
|
||||
|
||||
### Databag Key Definitions
|
||||
|
||||
- `id`: _String_ specifies the username, as well as the data bag object id.
|
||||
@@ -262,21 +270,29 @@ And then change the action to "remove":
|
||||
```
|
||||
|
||||
- Note only user bags with the "action : remove" and a search-able "group" attribute will be purged by the :remove action.
|
||||
- As of v2.0.3 you can use the force parameter within the user data bag object for users with action remove. As per [user docs](https://docs.chef.io/resource_user.html) this may leave the system in an inconsistent state. For example, a user account will be removed even if the user is logged in. A user’s home directory will be removed, even if that directory is shared by multiple users.
|
||||
- As of v2.0.3 you can use the force parameter within the user data bag object for users with action remove. As per [user docs](https://docs.chef.io/resource_user.html) this may leave the system in an inconsistent state. For example, a user account will be removed even if the user is logged in. A user's home directory will be removed, even if that directory is shared by multiple users.
|
||||
|
||||
If you have different requirements, for example:
|
||||
|
||||
- You want to search a different data bag specific to a role such as
|
||||
- mail. You may change the data_bag searched.
|
||||
|
||||
- data_bag `mail`
|
||||
|
||||
- You want to search for a different group attribute named
|
||||
|
||||
- `postmaster`. You may change the search_group attribute. This
|
||||
|
||||
- attribute defaults to the LWRP resource name.
|
||||
|
||||
- search_group `postmaster`
|
||||
|
||||
- You want to add the users to a security group other than the
|
||||
|
||||
- lightweight resource name. You may change the group_name attribute.
|
||||
|
||||
- This attribute also defaults to the LWRP resource name.
|
||||
|
||||
- group_name `wheel`
|
||||
|
||||
Putting these requirements together our recipe might look like this:
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"name":"users","version":"5.0.0","description":"Creates users from a databag search","long_description":"# users Cookbook\n\n[](http://travis-ci.org/chef-cookbooks/users) [](https://supermarket.chef.io/cookbooks/users)\n\nManages OS users from databags.\n\n## Scope\n\nThis cookbook is concerned with the management of OS users and groups from databags. It also manages the distribution of ssh keys to a user's home directory.\n\n## Requirements\n\nA data bag populated with user objects must exist. The default data bag in this recipe is `users`. See USAGE.\n\n### Platforms\n\nThe following platforms have been tested with Test Kitchen:\n\n- Debian / Ubuntu derivatives\n- RHEL and derivatives\n- Fedora\n- openSUSE / SUSE Linux Enterprises\n- FreeBSD / OpenBSD\n- Mac OS X\n\n### Chef\n\n- Chef 12.5+\n\n### Cookbooks\n\n- none\n\n## Usage\n\nTo use the resource `users_manage`, make sure to add the dependency on the users cookbook by the following line to your wrapper cookbook's [metadata.rb](https://docs.chef.io/config_rb_metadata.html):\n\n```\ndepends 'users'\n```\n\nor to pin to a specific version of the users cookbook, in this case any version of 2.X:\n\n```\ndepends 'users', '~> 2'\n```\n\nThen in a recipe:\n\n```ruby\nusers_manage 'GROUPNAME' do\n group_id GROUPID\n action [:create]\n data_bag 'DATABAG_NAME'\nend\n```\n\nExample:\n\n```ruby\nusers_manage 'testgroup' do\n group_id 3000\n action [:create]\n data_bag 'test_home_dir'\nend\n```\n\n**Note**: If you do not specify the data_bag, the default will be to look for a databag called users.\n\n## Databag Definition\n\nA sample user object in a users databag would look like:\n\n```json\n{\n \"id\": \"test_user\",\n \"password\": \"$1$5cE1rI/9$4p0fomh9U4kAI23qUlZVv/\",\n \"ssh_keys\": [\n \"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU\\nGPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3\\nPbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA\\nt3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/En\\nmZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbx\\nNrRFi9wrf+M7Q== chefuser@mylaptop.local\",\n \"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU\\nGPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3\\nPbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA\\nt3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/En\\nmZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbx\\nNQCPO0ZZEa1== chefuser@mylaptop.local\"\n ],\n \"groups\": [ \"testgroup\", \"nfsgroup\" ],\n \"uid\": 9001,\n \"shell\": \"\\/bin\\/bash\",\n \"comment\": \"Test User\"\n}\n```\n\n### Databag Key Definitions\n\n- `id`: _String_ specifies the username, as well as the data bag object id.\n- `password`: _String_ specifies the user's password.\n- `ssh_keys`: _Array_ an array of authorized keys that will be managed by Chef to the user's home directory in .ssh/authorized_keys\n- `groups`: _Array_ an array of groups that the user will be added to\n- `uid`: _Integer_ a unique identifier for the user\n- `shell`: _String_ the user's shell\n- `comment`:_String_ the [GECOS field](https://en.wikipedia.org/wiki/Gecos_field), generally the User's full name.\n\nOther potential fields:\n\n- `home`: _String_ User's home directory. If not assigned, will be set based on platform and username.\n- `action`: _String_ Supported actions are one's supported by the [user](https://docs.chef.io/resource_user.html#actions) resource. If not specified, the default action is `create`.\n- `ssh_private_key`: _String_ manages user's private key generally ~/.ssh/id_*\n- `ssh_public_key`: _String_ manages user's public key generally ~/.ssh/id_*.pub\n\n## Resources Overview\n\n### users_manage\n\nThe `users_manage` resource manages users and groups based off of a data bag search and specified action.\n\n#### Examples\n\nCreates the `sysadmin` group and users defined in the `users` databag.\n\n```ruby\nusers_manage 'sysadmin' do\n group_id 2300\n action [:create]\nend\n```\n\nCreates the `testgroup` group, and users defined in the `test_home_dir` databag.\n\n```ruby\nusers_manage 'testgroup' do\n group_id 3000\n action [:create]\n data_bag 'test_home_dir'\nend\n```\n\nCreates the `nfsgroup` group, and users defined in the `test_home_dir` databag and does not manage nfs home directories.\n\n```ruby\nusers_manage 'nfsgroup' do\n group_id 4000\n action [:create]\n data_bag 'test_home_dir'\n manage_nfs_home_dirs false\nend\n```\n\n#### Parameters\n\n- `data_bag` _String_ is the data bag to search\n- `search_group` _String_ groups name to search for, defaults to resource name\n- `group_name` _String_ name of the group to create, defaults to resource name\nLine truncated
|
||||
{"name":"users","version":"5.1.0","description":"Creates users from a databag search","long_description":"# users Cookbook\n\n[](http://travis-ci.org/chef-cookbooks/users) [](https://supermarket.chef.io/cookbooks/users)\n\nManages OS users from databags.\n\n## Scope\n\nThis cookbook is concerned with the management of OS users and groups from databags. It also manages the distribution of ssh keys to a user's home directory.\n\n## Requirements\n\n### Platforms\n\nThe following platforms have been tested with Test Kitchen:\n\n- Debian / Ubuntu derivatives\n- RHEL and derivatives\n- Fedora\n- openSUSE / SUSE Linux Enterprises\n- FreeBSD / OpenBSD\n- Mac OS X\n\n### Chef\n\n- Chef 12.5+\n\n### Cookbooks\n\n- none\n\n## Usage\n\nTo use the resource `users_manage`, make sure to add the dependency on the users cookbook by the following line to your wrapper cookbook's [metadata.rb](https://docs.chef.io/config_rb_metadata.html):\n\n```\ndepends 'users'\n```\n\nor to pin to a specific version of the users cookbook, in this case any version of 2.X:\n\n```\ndepends 'users', '~> 2'\n```\n\nThen in a recipe use the `user_manage` resource to add all users in the defined group to the system:\n\n```ruby\nusers_manage 'GROUPNAME' do\n group_id GROUPID\n action [:create]\n data_bag 'DATABAG_NAME'\nend\n```\n\nExample:\n\n```ruby\nusers_manage 'testgroup' do\n group_id 3000\n action [:create]\n data_bag 'test_home_dir'\nend\n```\n\n**Note**: If you do not specify the data_bag, the default will be to look for a databag called users.\n\n## Databag Definition\n\nA sample user object in a users databag would look like:\n\n```json\n{\n \"id\": \"test_user\",\n \"password\": \"$1$5cE1rI/9$4p0fomh9U4kAI23qUlZVv/\",\n \"ssh_keys\": [\n \"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU\\nGPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3\\nPbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA\\nt3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/En\\nmZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbx\\nNrRFi9wrf+M7Q== chefuser@mylaptop.local\",\n \"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU\\nGPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3\\nPbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA\\nt3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/En\\nmZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbx\\nNQCPO0ZZEa1== chefuser@mylaptop.local\"\n ],\n \"groups\": [ \"testgroup\", \"nfsgroup\" ],\n \"uid\": 9001,\n \"shell\": \"\\/bin\\/bash\",\n \"comment\": \"Test User\"\n}\n```\n\nA sample user to remove from a system would like like:\n\n```json\n{\n \"id\": \"mwaddams\",\n \"action\": \"remove\",\n \"groups\": [ \"testgroup\", \"nfsgroup\" ]\n}\n```\n\n### Databag Key Definitions\n\n- `id`: _String_ specifies the username, as well as the data bag object id.\n- `password`: _String_ specifies the user's password.\n- `ssh_keys`: _Array_ an array of authorized keys that will be managed by Chef to the user's home directory in .ssh/authorized_keys\n- `groups`: _Array_ an array of groups that the user will be added to\n- `uid`: _Integer_ a unique identifier for the user\n- `shell`: _String_ the user's shell\n- `comment`:_String_ the [GECOS field](https://en.wikipedia.org/wiki/Gecos_field), generally the User's full name.\n\nOther potential fields:\n\n- `home`: _String_ User's home directory. If not assigned, will be set based on platform and username.\n- `action`: _String_ Supported actions are one's supported by the [user](https://docs.chef.io/resource_user.html#actions) resource. If not specified, the default action is `create`.\n- `ssh_private_key`: _String_ manages user's private key generally ~/.ssh/id_*\n- `ssh_public_key`: _String_ manages user's public key generally ~/.ssh/id_*.pub\n\n## Resources Overview\n\n### users_manage\n\nThe `users_manage` resource manages users and groups based off of a data bag search and specified action.\n\n#### Examples\n\nCreates the `sysadmin` group and users defined in the `users` databag.\n\n```ruby\nusers_manage 'sysadmin' do\n group_id 2300\n action [:create]\nend\n```\n\nCreates the `testgroup` group, and users defined in the `test_home_dir` databag.\n\n```ruby\nusers_manage 'testgroup' do\n group_id 3000\n action [:create]\n data_bag 'test_home_dir'\nend\n```\n\nCreates the `nfsgroup` group, and users defined in the `test_home_dir` databag and does not manage nfs home directories.\n\n```ruby\nusers_manage 'nfsgroup' do\n group_id 4000\n action [:create]\n data_bag 'test_home_dir'\n manage_nfs_home_dirs false\nend\n```\n\n#### Parameters\n\n- `data_bag` _String_ is the data bag to search\n- `search_gLine truncated
|
||||
@@ -97,6 +97,7 @@ action :create do
|
||||
owner u['uid'] ? validate_id(u['uid']) : u['username']
|
||||
group validate_id(u['gid']) if u['gid']
|
||||
mode '0600'
|
||||
sensitive true
|
||||
variables ssh_keys: u['ssh_keys']
|
||||
only_if { !!(u['ssh_keys']) }
|
||||
end
|
||||
@@ -157,7 +158,7 @@ action :remove do
|
||||
end
|
||||
end
|
||||
|
||||
action_class.class_eval do
|
||||
action_class do
|
||||
include ::Users::Helpers
|
||||
include ::Users::OsxHelper
|
||||
|
||||
|
||||
Reference in new issue
Block a user