Skip to content

Commit

Permalink
remove default value for $package_version
Browse files Browse the repository at this point in the history
Setting the default value to 'present' promotes the wrong approach.
The module *needs* the version number in order to enable or disable
certain incompatible configurations/features.
  • Loading branch information
fraenki committed Aug 13, 2024
1 parent e693437 commit 00df9aa
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,17 @@ This module manages the installation and configuration of Artifactory.

## Setup

### Beginning with artifactory
### Basic usage

If you want a server installed with the default options you can run
`include 'artifactory'`.

However, it is strongly recommended to specify the desired version of Artifactory:
To setup Artifactory with default options only the desired version needs to be specified:

```puppet
class { 'artifactory':
package_version => '7.4.3',
package_version => '7.90.7',
}
```

This ensures that the module behaves correctly and does not enable obsolete features for your version of Artifactory.

If you need to add database connectivity instantiate with the required parameters:
### Complex example

```puppet
class { 'artifactory':
Expand All @@ -55,6 +51,7 @@ class { 'artifactory':
db_username => 'my_username',
db_password => 'efw23gn2j3',
binary_provider_type => 'filesystem',
package_version => '7.90.7',
pool_max_active => 100,
pool_max_idle => 10,
binary_provider_cache_maxsize => $binary_provider_cache_maxsize,
Expand All @@ -69,8 +66,9 @@ To install a commercial version of Artifactory:

```puppet
class { 'artifactory':
edition => 'pro',
license_key => 'ABCDEFG1234567890',
edition => 'pro',
license_key => 'ABCDEFG1234567890',
package_version => '7.90.7',
...
}
```
Expand Down
4 changes: 3 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ Sets the package name to install (Pro edition).

Data type: `String`

Specifies the package version.
Specifies the package version. It is highly recommended to set it to
a real version number. Setting the value to `present` may lead to a
broken config.

##### <a name="-artifactory--pool_max_active"></a>`pool_max_active`

Expand Down
1 change: 0 additions & 1 deletion data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ artifactory::install_service_script: 'app/bin/installService.sh'
artifactory::manage_repo: true
artifactory::package_name: 'jfrog-artifactory-oss'
artifactory::package_name_pro: 'jfrog-artifactory-pro'
artifactory::package_version: 'present'
artifactory::root_password: 'password'
artifactory::service_name: 'artifactory'
artifactory::symlink_name: 'artifactory'
Expand Down
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@
# Sets the package name to install (Pro edition).
#
# @param package_version
# Specifies the package version.
# Specifies the package version. It is highly recommended to set it to
# a real version number. Setting the value to `present` may lead to a
# broken config.
#
# @param pool_max_active
# Maximum number of pooled database connections.
Expand Down
16 changes: 10 additions & 6 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
context 'with default parameters' do
it 'works with no errors' do
pp = <<-ARTIFACTORY_TEST
class { 'artifactory': }
class { 'artifactory':
package_version => '7.90.7',
}
ARTIFACTORY_TEST

# Run it twice and test for idempotency
Expand Down Expand Up @@ -49,12 +51,14 @@ class {'postgresql::globals':
user => 'artifactory',
password => postgresql::postgresql_password('artifactory', '45y43y58y435hitr'),
}
class { 'artifactory':
db_type => 'postgresql',
db_username => 'artifactory',
db_password => '45y43y58y435hitr',
db_url => 'jdbc:postgresql:127.0.0.1:5432/artifactory',
require => Postgresql::Server::Db['artifactory']
db_type => 'postgresql',
db_username => 'artifactory',
db_password => '45y43y58y435hitr',
db_url => 'jdbc:postgresql:127.0.0.1:5432/artifactory',
package_version => '7.90.7',
require => Postgresql::Server::Db['artifactory']
}
PUPPETCODE

Expand Down

0 comments on commit 00df9aa

Please sign in to comment.