Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
add build_deps parameter to optionally skip the package setup
Browse files Browse the repository at this point in the history
resolves #44
resolves #43
references #41
  • Loading branch information
Ma27 committed Jan 12, 2017
1 parent 6eb9292 commit 2b24c10
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ class { '::composer':
}
```

### Repairing duplicated packages

As described in [#44](https://github.com/willdurand/puppet-composer/issues/44) in several cases it's possible that the catalogue crashes because of duplicate package declarations.

In order to skip the installation of `wget` from this module, you can use the `build_deps` argument:

``` puppet
class { '::composer':
build_deps => false,
}
```

### Global composer configs

One feature of composer are [global configuration parameters](https://getcomposer.org/doc/06-config.md#config).
Expand Down
7 changes: 6 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,20 @@
$version = undef,
$group = undef,
$download_timeout = '0',
$build_deps = true,
) {
validate_string($target_dir)
validate_string($command_name)
validate_string($user)
validate_bool($auto_update)
validate_string($version)
validate_string($group)
validate_bool($build_deps)

if $build_deps {
ensure_packages(['wget'])
}

ensure_packages(['wget'])
include composer::params

$composer_target_dir = $target_dir ? {
Expand Down
6 changes: 6 additions & 0 deletions spec/classes/composer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,10 @@
.with_timeout('25') \
}
end

describe 'with build_deps=false' do
let(:params) {{ :build_deps => false }}

it { should_not contain_package('wget') }
end
end

0 comments on commit 2b24c10

Please sign in to comment.