Switch back to the upstream nginx cookbook
chef_nginx is deprecated
This commit is contained in:
@@ -1 +0,0 @@
|
||||
~FC016
|
||||
@@ -2,6 +2,22 @@
|
||||
|
||||
This file is used to list changes made in each version of the tar cookbook.
|
||||
|
||||
## 2.2.0 (2018-07-24)
|
||||
|
||||
- Enable FC016 again
|
||||
- Use dokken and swap opensuse 13 testing for debian 9
|
||||
- GH-42 Fix opensuse image name in .kitchen.yml
|
||||
- GH-42 Add freebsd 10 and 11 to tested platforms
|
||||
- GH-42 Skip tar package install on freebsd
|
||||
- GH-42 Fix default group name in tar_extract
|
||||
- GH-42 Ensure src_dir exists in tar_package
|
||||
- GH-42 Use short options for make command
|
||||
- GH-42 Use latest nano for testing purposes
|
||||
- GH-42 Add freebsd to supported platforms list
|
||||
- Update creates parameter to reflect what gets extracted by resource.
|
||||
- Remove chefspec matchers that are autogenerated
|
||||
- Use build_essential resource instead of the recipe
|
||||
|
||||
## 2.1.1 (2017-06-13)
|
||||
|
||||
- Fix metadata source and issues links.
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<!-- This is a generated file. Please do not edit directly -->
|
||||
|
||||
# Maintainers
|
||||
|
||||
This file lists how this cookbook project is maintained. When making changes to the system, this file tells you who needs to review your patch - you need a review from an existing maintainer for the cookbook to provide a :+1: on your pull request. Additionally, you need to not receive a veto from a Lieutenant or the Project Lead.
|
||||
|
||||
Check out [How Cookbooks are Maintained](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD) for details on the process and how to become a maintainer or the project lead.
|
||||
|
||||
# Project Maintainer
|
||||
* [Tim Smith](https://github.com/tas50)
|
||||
|
||||
# Maintainers
|
||||
* [Jennifer Davis](https://github.com/sigje)
|
||||
* [Tim Smith](https://github.com/tas50)
|
||||
* [Thom May](https://github.com/thommay)
|
||||
@@ -4,24 +4,37 @@
|
||||
|
||||
Installs tar and includes resources for managing remote tar files. `tar_package` handles remote source package compilation. `tar_extract` handles retrieving remote tar files and extracting them locally.
|
||||
|
||||
## Requirements
|
||||
|
||||
### Platforms
|
||||
|
||||
- Debian / Ubuntu derivatives
|
||||
- RHEL and derivatives
|
||||
- openSUSE / SUSE Linux Enterprises
|
||||
- FreeBSD
|
||||
|
||||
### Chef
|
||||
|
||||
- Chef 12.7+
|
||||
|
||||
## Resources
|
||||
|
||||
### tar_package
|
||||
|
||||
A `tar_package` LWRP provides an easy way to download remote files and compile and install them. This only works for the most basic Autoconf programs that can do `./configure && make && make install`.
|
||||
The `tar_package` resource provides an easy way to download remote files and compile and install them. This only works for the most basic Autoconf programs that can do `./configure && make && make install`.
|
||||
|
||||
#### Actions
|
||||
|
||||
- :install: Installs the package
|
||||
- `install` Installs the package
|
||||
|
||||
#### Properties
|
||||
|
||||
- source: name attribute. The source remote URL.
|
||||
- prefix: Directory to be used as the `--prefix` configure flag.
|
||||
- source_directory: Directory to which source files are download.
|
||||
- creates: A file this command creates - if the file exists, the command will not be run.
|
||||
- configure_flags: Array of additional flags to be passed to `./configure`.
|
||||
- archive_name: Specify a different name for the downloaded archive. Use it if the directory name inside the tar file is different than the name defined in the URL. Additionally, `tar_package` supports most `remote_file` [attributes](https://docs.chef.io/chef/resources.html#remote-file).
|
||||
- `source`: name attribute. The source remote URL.
|
||||
- `prefix`: Directory to be used as the `--prefix` configure flag.
|
||||
- `source_directory`: Directory to which source files are downloaded.
|
||||
- `creates`: prevent the command from running when the specified file already exists.
|
||||
- `configure_flags`: Array of additional flags to be passed to `./configure`.
|
||||
- `archive_name`: Specify a different name for the downloaded archive. Use it if the directory name inside the tar file is different than the name defined in the URL. Additionally, `tar_package` supports most `remote_file` [attributes](https://docs.chef.io/chef/resources.html#remote-file).
|
||||
|
||||
#### Example
|
||||
|
||||
@@ -36,23 +49,23 @@ This will download, compile, and install the package from the given URL and inst
|
||||
|
||||
### tar_extract
|
||||
|
||||
A `tar_extract` LWRP provides an easy way to download remote tar files and extract them to a local directory.
|
||||
The `tar_extract` resource provides an easy way to extract tar files from downloaded or local files.
|
||||
|
||||
#### Actions
|
||||
|
||||
- :extract: Extracts the tar file from a url
|
||||
- :extract_local: Extracts the tar file from a local file path
|
||||
- `extract` Extracts the tar file from a url
|
||||
- `extract_local` Extracts the tar file from a local file path
|
||||
|
||||
#### Properties
|
||||
|
||||
- source: name attribute. The source remote URL.
|
||||
- target_dir: Directory to extract into, e.g. tar xzf -C (target_dir)
|
||||
- download_dir: Directory to which tarball is downloaded (defaults to chef cache which requires root `group` and `user`).
|
||||
- creates: A file this command creates - if the file exists, the command will not be run.
|
||||
- compress_char: Flag for compression type, such as `z` for `gzip`. `man tar` for options.
|
||||
- tar_flags: Array of additional flags to be passed to tar xzf command.
|
||||
- group: Group name or group ID to extract the archive under. If set to non-root group, point to a `download_dir` the group has permission to access.
|
||||
- user: User name or user ID to extract the archive under. If set to non-root user, point to a `download_dir` the user has permission to access. Additionally, `tar_extract` supports most `remote_file` [attributes](https://docs.chef.io/chef/resources.html#remote-file).
|
||||
- `source`: name attribute. The source remote URL.
|
||||
- `target_dir`: Directory to extract into, e.g. tar xzf -C (target_dir)
|
||||
- `download_dir`: Directory to which tarball is downloaded (defaults to chef cache which requires root `group` and `user`).
|
||||
- `creates`: prevent the command from running when the specified file already exists.
|
||||
- `compress_char`: Flag for compression type, such as `z` for `gzip`. `man tar` for options.
|
||||
- `tar_flags`: Array of additional flags to be passed to tar xzf command.
|
||||
- `group`: Group name or group ID to extract the archive under. If set to non-root group, point to a `download_dir` the group has permission to access.
|
||||
- `user`: User name or user ID to extract the archive under. If set to non-root user, point to a `download_dir` the user has permission to access. Additionally, `tar_extract` supports most `remote_file` [attributes](https://docs.chef.io/chef/resources.html#remote-file).
|
||||
|
||||
#### Example
|
||||
|
||||
@@ -76,20 +89,27 @@ end
|
||||
|
||||
This will extract the contents of /tmp/mycode-1.2.3.tar.gz to /opt/myapp/mycode and use the file '/opt/myapp/mycode/lib' to determine idempotency.
|
||||
|
||||
## ChefSpec Matchers
|
||||
|
||||
ChefSpec matchers are defined for tar_package and tar_extract.
|
||||
|
||||
## LICENSE AND AUTHOR
|
||||
|
||||
Author:: Nathan L Smith ([nathan@cramerdev.com](mailto:nathan@cramerdev.com)) Author:: George Miranda ([gmiranda@chef.io](mailto:gmiranda@chef.io)) Author:: Mark Van de Vyver ([mark@@taqtiqa.com](mailto:mark@@taqtiqa.com))
|
||||
- **Author:** Nathan L Smith ([nathan@cramerdev.com](mailto:nathan@cramerdev.com))
|
||||
- **Author:** George Miranda ([gmiranda@chef.io](mailto:gmiranda@chef.io))
|
||||
- **Author:** Mark Van de Vyver ([mark@@taqtiqa.com](mailto:mark@taqtiqa.com))
|
||||
|
||||
Copyright 2011, Cramer Development, Inc. Copyright 2011, Opscode, Inc. Copyright 2013, TAQTIQA LLC.
|
||||
```text
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
||||
Copyright: 2011, Cramer Development, Inc.
|
||||
Copyright: 2013, TAQTIQA LLC.
|
||||
Copyright: 2011-2017, Chef Software, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
```
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
```
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
if defined?(ChefSpec)
|
||||
ChefSpec.define_matcher :tar_package
|
||||
ChefSpec.define_matcher :tar_extract
|
||||
|
||||
def install_tar_package(source)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:tar_package, :install, source)
|
||||
end
|
||||
|
||||
def extract_tar_extract(source)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:tar_extract, :extract, source)
|
||||
end
|
||||
|
||||
def extract_local_tar_extract(source)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:tar_extract, :extract_local, source)
|
||||
end
|
||||
end
|
||||
File diff suppressed because one or more lines are too long
@@ -19,4 +19,4 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
package 'tar'
|
||||
package 'tar' unless platform_family?('freebsd')
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
property :source, String, name_property: true
|
||||
property :checksum, String
|
||||
property :download_dir, String, default: Chef::Config[:file_cache_path]
|
||||
property :group, String, default: 'root'
|
||||
property :group, String, default: node['root_group']
|
||||
property :mode, String, default: '0755'
|
||||
property :target_dir, String
|
||||
property :creates, String
|
||||
@@ -54,7 +54,7 @@ action :extract do
|
||||
end
|
||||
|
||||
remote_file basename do
|
||||
source r.name
|
||||
source r.source
|
||||
checksum r.checksum
|
||||
path local_archive
|
||||
backup false
|
||||
@@ -80,6 +80,7 @@ end
|
||||
|
||||
action_class do
|
||||
def extract_tar(local_archive, r)
|
||||
directory r.target_dir
|
||||
execute "extract #{local_archive}" do
|
||||
flags = if r.tar_flags.is_a?(String)
|
||||
r.tar_flags
|
||||
|
||||
@@ -39,6 +39,10 @@ action :install do
|
||||
dirname = basename.chomp('.tar.gz') # Assuming .tar.gz
|
||||
src_dir = r.source_directory
|
||||
|
||||
directory src_dir do
|
||||
recursive true
|
||||
end
|
||||
|
||||
remote_file basename do
|
||||
source r.name
|
||||
path "#{src_dir}/#{basename}"
|
||||
@@ -60,7 +64,7 @@ action :install do
|
||||
|
||||
execute "compile & install #{dirname}" do
|
||||
flags = [r.prefix ? "--prefix=#{r.prefix}" : nil, *r.configure_flags].compact.join(' ')
|
||||
command "./configure --quiet #{flags} && make --quiet && make --quiet install"
|
||||
command "./configure --quiet #{flags} && make -s && make -s install"
|
||||
cwd "#{src_dir}/#{dirname}"
|
||||
creates r.creates
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user