cookbook 'cpan', '~> 0.1.0'
cpan
(33) Versions
0.1.0
-
Follow6
CPAN modules provider (cpan_client provider LWRP)
cookbook 'cpan', '~> 0.1.0', :supermarket
knife supermarket install cpan
knife supermarket download cpan
DESCRIPTION
cpan modules resource provider
WARNING
The cpan cookbook seems does not work under recent versipon of chef ( since 12.5 ) and is no longer mainatained.
Feel free to fork the code and take up further development.
PREREQUISITES
A little prerequisites are required. Run cpan::bootstrap
recipe to satisfy
- curl
- App::cpanminus
- CPAN
- local::lib
If you only want to run bootstrap once, set the bootstrap['keep_uptodate']
attribute to false.
BASIC USAGE
cpan_client 'CGI' do
action 'install'
install_type 'cpan_module'
user 'root'
group 'root'
end
RESOURCE ACTIONS
-
install
- install module or application -
test
- test module, don't install it -
reload_cpan_index
- reload cpan client indexes
RESOURCE ATTRIBUTES
-
cwd
- specifies current working directory where installation process runs, default value is/tmp/
-
dry_run
- specifies whether to run installation process in dry-run mode or not, default value isfalse
-
environment
- specifies Hash with environment variables exported to installation process -
force
- specifies whether to run installation process in force mode, default - false -
from_cookbook
- specifies cookbook, where distributive stored at. Check out chef cookbook_file resource documentation -
user
/group
- specifies a user/group for installation process -
inc
- specifies perl @INC array -
install_base
- specifies installation base -
install_path
- specifies installation paths -
install_type
- specifies installation type : cpan_module, bundle, application; default - application -
module_name
- specifies the name of cpan module to check version against when install, useful when installing from http url or cookbook -
version
- specifies version of module to install, see alsomodule_name
parameter- if version defined as
version '0'
- installs only if module is not installed yet - if version defined as
version 'version-number'
- installs by version and higher - if version defined as
version '=version-number'
- installs exact version
- if version defined as
EXAMPLES OF USAGE
fake install
cpan_client 'CGI' do
user 'root'
group 'root'
dry_run true
install_type 'cpan_module'
action 'install'
end
does not install, only run tests
cpan_client 'CGI' do
user 'root'
group 'root'
install_type 'cpan_module'
action 'test'
end
Bundle install
cpan_client 'Bundle::LWP' do
user 'root'
group 'root'
install_type 'bundle'
action 'install'
end
force install
cpan_client 'CGI' do
user 'root'
group 'root'
force true
install_type 'cpan_module'
action 'install'
end
installs version or higher
cpan_client 'CGI' do
user 'root'
group 'root'
version '3.55'
install_type 'cpan_module'
action 'install'
end
installs only if module is not installed yet
cpan_client 'CGI' do
user 'root'
group 'root'
version '0'
install_type 'cpan_module'
action 'install'
end
installs exact version of module
# exact version installation is available only for install from cookbook or from http url
cpan_client 'http://search.cpan.org/CPAN/authors/id/M/MA/MARKSTOS/CGI.pm-3.59.tar.gz' do
user 'root'
group 'root'
module_name 'CGI'
version '=3.59'
action 'install'
end
cpan_client 'Moose-1.24.tar.gz' do
user 'root'
group 'root'
from_cookbook 'moose'
module_name 'Moose'
version '=1.24'
action 'install'
end
installs distributive stored in cookbook
cpan_client 'Moose-1.24.tar.gz' do
user 'root'
group 'root'
from_cookbook 'moose'
install_type 'cpan_module'
action 'install'
end
installs distributive stored in cookbook with version check
cpan_client 'Moose-1.24.tar.gz' do
user 'root'
group 'root'
from_cookbook 'moose'
module_name 'Moose'
version '1.24'
action 'install'
end
installs distributive strored remotely
# only http protocol now is supported:
cpan_client 'http://search.cpan.org/CPAN/authors/id/M/MA/MARKSTOS/CGI.pm-3.59.tar.gz' do
user 'root'
group 'root'
action 'install'
end
installs distributive strored remotely with version check
cpan_client 'http://search.cpan.org/CPAN/authors/id/M/MA/MARKSTOS/CGI.pm-3.58.tar.gz' do
user 'root'
group 'root'
module_name 'CGI'
version '3.59'
action 'install'
end
installs into given installation base
cpan_client 'CGI' do
user 'root'
group 'root'
install_base '/some/where/else'
install_type 'cpan_module'
action 'install'
end
installs into given installation base, relative to given cwd
# will install into '/home/alex/mydir'
cpan_client 'CGI' do
user 'root'
group 'root'
install_base 'mydir'
cwd '/home/alex/'
install_type 'cpan_module'
action 'install'
end
installs with given install paths
# will override settings for `htdocs` and `config` elements
cpan_client 'Module' do
user 'root'
group 'root'
install_path ["htdocs=#{ENV['PWD']}/htdocs/", "config=#{ENV['PWD']}/etc/"]
install_type 'cpan_module'
action 'install'
end
installs distributive unpacked in current working directory
cpan_client 'my application' do
user 'root'
group 'root'
install_type 'application'
action 'install'
end
installs under not privileged user
# will install into $PWD/cpanlib directory
cpan_client 'my application' do
install_type 'application'
user 'user'
group 'users'
install_base 'cpanlib'
action 'install'
end
reloads cpan indexes
cpan_client 'reload cpan index' do
user 'user'
group 'users'
action 'reload_cpan_index'
end
Features
Other examples (cucumber features) may be found at cpan-test project
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
0.1.0
- Update license #33
0.0.37
- Fixing my change log
0.0.36
- occasional syntax error fixed, thanks to @redterror
0.0.35
- merged PR by @abadelt to fix
undefined method
cpan_client' after update to Chef 13 ` error - #3
version 0.0.31
version 0.0.30
version 0.0.29
version 0.0.28
- berkshelf / minitest chef infrastructure has been added
- messages 'won't install without force' in log file should turn into exception
version 0.0.27
- cpan::bootstrap have been made multiplatforms - todo
- centos platform now is supported - todo
version 0.0.26
- have made bootstrap recipe more concise and clear
- cucumber tests have been moved to distinct github project - https://github.com/melezhik/cpan-test/
- few logger/output changes
version 0.0.25
- cpan index force reload
- explicit cookbook name in metadata (https://github.com/melezhik/cookbooks/pull/5)
version 0.0.24
- workaround for invalid byte sequence in UTF-8
version 0.0.23
- fix for unstrusted string hanlding commented (does not work for ruby 1.8.*)
- reload index action implemented now by
reload index
cpan client command - bootstrap list minimized
version 0.0.22
- replace Iconv by encode
- do not turn 'ERRORS/WARNINGS FOUND IN PREREQUISITES' into exception
version 0.0.21
- turning 'ERRORS/WARNINGS FOUND IN PREREQUISITES' into exception
- cpan::bootstrap - AUTOMATED_TESTING enabled (https://github.com/melezhik/cookbooks/issues/1)
version 0.0.20
- cpan::bootstrap - added some vital Modules
- cpan_client - handling untrusted strings with Iconv when grep cpan logs
version 0.0.19
- default value for cwd is '/tmp/'
version 0.0.18
- installs exact version now available
version 0.0.17
- a big refactoring
-
module_name
parameter added - version check when doing install from cookbook/url
- documentation cleaned up
version 0.0.16
- небольшой рефакторинг кода
version 0.0.15
- install from remote tarball by http/ftp url
version 0.0.14
- raise exception if found "Stopping: 'install' failed" in install_log - workaround for https://github.com/andk/cpanpm/issues/32
- does
rm -rf "/tmp/local-lib/install/#{installed_module}"
in install from tarball to delete already unpacked distro - bugfix : user, group added to :action
test
version 0.0.13
- install summary:
- improved, fixed and simplified
version 0.0.12
- cpan-client: redirect stderr to stdout
- made logs more clear
version 0.0.11
- add cucumber features
- bugfix for install_path cases
version 0.0.10
- bugfix : before install create /tmp/local-lib/install directory
version 0.0.9
- add documentation
version 0.0.8
- .modulebuildrc create in :install action instead of cpan::default recipe
- add cpan_home optional attribute
- create '/tmp/local_lib/' before doing install
version 0.0.7
- bugfix for install from tarball (forgot about cwd while refactoring)
version 0.0.6
- replace execute resource by bash resources for less verbosity in logs
- improve after-install summary
version 0.0.5
- compact log messages
version 0.0.4
- log messages are neat and at different levels
- big fix for access to log files
Collaborator Number Metric
0.1.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 failed this metric
FC016: LWRP does not declare a default action: cpan/resources/client.rb:1
FC064: Ensure issues_url is set in metadata: cpan/metadata.rb:1
FC065: Ensure source_url is set in metadata: cpan/metadata.rb:1
FC066: Ensure chef_version is set in metadata: cpan/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: cpan/providers/client.rb:247
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.0 failed this metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 failed this metric
FC016: LWRP does not declare a default action: cpan/resources/client.rb:1
FC064: Ensure issues_url is set in metadata: cpan/metadata.rb:1
FC065: Ensure source_url is set in metadata: cpan/metadata.rb:1
FC066: Ensure chef_version is set in metadata: cpan/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: cpan/providers/client.rb:247
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.0 failed this metric
FC064: Ensure issues_url is set in metadata: cpan/metadata.rb:1
FC065: Ensure source_url is set in metadata: cpan/metadata.rb:1
FC066: Ensure chef_version is set in metadata: cpan/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: cpan/providers/client.rb:247
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.0 failed this metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number