Skip to content

Commit

Permalink
Merge pull request #18 from fervidus/pr11_fixes
Browse files Browse the repository at this point in the history
Pr11 fixes
  • Loading branch information
bryanjbelanger authored Aug 27, 2020
2 parents 2470443 + cd672a0 commit 907ad67
Show file tree
Hide file tree
Showing 11 changed files with 201 additions and 96 deletions.
65 changes: 0 additions & 65 deletions CHANGELOG

This file was deleted.

84 changes: 84 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Changelog

2020-08-26 Release 3.0.1

* Fix for PR 11

2020-16-05 Release 3.0.0

* Thanks to fraenki

* Add support for Artifactory 7

2020-06-04 Release 2.2.8

Several fixes by Tim Meusel.

* Litmus testing added
* Add PostGres example

2019-22-08 Release 2.2.7

Several fixes by Ron Aughenbaugh from University of Maryland. Go Terrapins.

* Manage db.properties with augeas
* Added optional params to db.properties with augeas
* Fix hardcoding of paths

2019-14-08 Release 2.2.5

* Alexander Hermes bumped java dependency
* Frank Wall fixed bug where service restarted on .temp.db.properties change

2019-20-05 Release 2.1.0

* Database secrets are now read from a temporary file, allowing for encrypted passwords
* Master key for database can now be specified to re-use an existing database
* Module can now provision a Mysql database and connect it to Artifactory
* Smoothed out install script for better compatability with database

2018-22-08 Release 2.0.16

* Refactored for PDK and ensured all test pass.

2018-13-08 Release 2.0.14

* Refactored for PDK and ensured all test pass.

2018-03--14 Release 2.0.13

* Remove OJDBC JAR file and ha-node prop files
* Make artifactory version configurable

2018-02-28 Release 2.0.12

* Added fix for manage_java = false dependency
* Added enhancement for derby usage

2017-03-21 Release 2.0.9

* Fix simple puppet linter problems

2017-03-21 Release 2.0.8

* Change from wget to file type to grab binary drivers

2016-08-14 Release 2.0.7

* Fix JDBC permissions

2016-08-14 Release 2.0.5

* JDBC driver added as owner root, not artifactory

2016-07-26 Release 2.0.0

* Remove db_hostname and db_port. Use db_url instead.

2016-07-22 Release 1.0.5

* Added active management of java to module

2016-07-22 Release 1.0.3

* Added shields and final travis-ci tests
18 changes: 11 additions & 7 deletions README.markdown → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* [Beginning with artifactory](#beginning-with-artifactory)
4. [Usage - Configuration options and additional functionality](#usage)
5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
5. [Limitations - OS compatibility, etc.](#limitations)
6. [Development - Guide for contributing to the module](#development)
6. [Limitations - OS compatibility, etc.](#limitations)
7. [Development - Guide for contributing to the module](#development)

## Overview

Expand All @@ -21,7 +21,7 @@ Artifactory 7+ is supported, legacy support for Artifactory 6 is still available

If you are looking for the HA installation look at:

Artifactory HA: https://forge.puppet.com/fervid/artifactory_ha
Artifactory HA: <https://forge.puppet.com/fervid/artifactory_ha>

Github and gitlab are great for storing source control, but bad at storing installers and compiled packages.

Expand Down Expand Up @@ -51,7 +51,7 @@ This ensures that the module behaves correctly and does not enable obsolete feat

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

~~~
```puppet
class { '::artifactory':
jdbc_driver_url => 'puppet:///modules/my_module/mysql.jar',
db_type => 'oracle',
Expand All @@ -65,7 +65,7 @@ class { '::artifactory':
binary_provider_filesystem_dir => '/var/opt/jfrog/artifactory/data/filestore',
binary_provider_cache_dir => '/var/opt/jfrog/artifactory/',
}
~~~
```

### Artifactory with PostgreSQL database

Expand Down Expand Up @@ -165,7 +165,7 @@ This is required if using a new data source.
##### `use_temp_db_secrets`

Set to true(default) if you want Artifactory to delete temporary db.properties file on service start.
https://www.jfrog.com/confluence/display/RTF/Configuring+Security#ConfiguringSecurity-HardeningSecurityforSecrets
<https://www.jfrog.com/confluence/display/RTF/Configuring+Security#ConfiguringSecurity-HardeningSecurityforSecrets>

Set to false if you would like db.properties file to be written to ${::artifactory::artifactory_home}/etc/db.properties
and managed with Augeas, taking into account Artifactory encrypts password field on startup. Management with Augeas
Expand Down Expand Up @@ -196,18 +196,23 @@ Only required for database configuration. The password for the database account.
Optional setting for the binary storage provider. The type of database to configure for. Valid values are 'filesystem', 'fullDb', 'cachedFS', 'S3'. Defaults to 'filesystem'.

###### filesystem (default)

This means that metadata is stored in the database, but binaries are stored in the file system. The default location is under $ARTIFACTORY_HOME/data/filestore however this can be modified.

###### fullDb

All the metadata and the binaries are stored as BLOBs in the database, objects are cached as in cachedFS.

###### cachedFS

Works the same way as filesystem but also has a binary LRU (Least Recently Used) cache for upload/download requests. Improves performance of instances with high IOPS (I/O Operations) or slow NFS access.

###### S3

This is the setting used for S3 Object Storage.

###### fullDbDirect

All the metadata and the binaries are stored as BLOBs in the database. No caching occurs.

##### `pool_max_active`
Expand Down Expand Up @@ -249,7 +254,6 @@ This module has been tested on:

Since your module is awesome, other users will want to play with it. Let them know what the ground rules for contributing are.


### Contributors

To see who's already involved, see the [list of contributors.](https://github.com/fervid/artifactory/graphs/contributors)
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--- {}
21 changes: 21 additions & 0 deletions hiera.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
version: 5

defaults: # Used for any hierarchy level that omits these keys.
datadir: data # This path is relative to hiera.yaml's directory.
data_hash: yaml_data # Use the built-in YAML backend.

hierarchy:
- name: "osfamily/major release"
paths:
# Used to distinguish between Debian and Ubuntu
- "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
- "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
# Used for Solaris
- "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
- name: "osfamily"
paths:
- "os/%{facts.os.name}.yaml"
- "os/%{facts.os.family}.yaml"
- name: 'common'
path: 'common.yaml'
13 changes: 7 additions & 6 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@

# Determine the directory for the chosen binary provider.
if ($binary_provider_type == 'file-system') and ! $::artifactory::binary_provider_filesystem_dir {
$mapped_provider_filesystem_dir = 'filestore'
} else {
$mapped_provider_filesystem_dir = $::artifactory::binary_provider_filesystem_dir
}
if $::artifactory::binary_provider_base_data_dir {
$binary_provider_filesystem_dir = "${::artifactory::binary_provider_base_data_dir}/${mapped_provider_filesystem_dir}"
if $::artifactory::binary_provider_base_data_dir {
$binary_provider_filesystem_dir = "${::artifactory::binary_provider_base_data_dir}/filestore"
} else {
$binary_provider_filesystem_dir = undef
}
} elsif ($binary_provider_type == 'file-system') and $::artifactory::binary_provider_filesystem_dir {
$binary_provider_filesystem_dir = $::artifactory::binary_provider_filesystem_dir
} else {
$binary_provider_filesystem_dir = undef
}
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fervid-artifactory",
"version": "3.0.0",
"version": "3.0.5",
"author": "Fervid",
"summary": "Installs and configures Artifactory OSS",
"license": "Apache-2.0",
Expand Down
64 changes: 61 additions & 3 deletions spec/classes/artifactory_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,77 @@
}
end

context 'artifactory class with version specified' do
context 'running a legacy version (pre v7)' do
let(:params) do
{
'package_version' => '5.9.1',
'package_version' => '6.0.0',
}
end

it { is_expected.to compile.with_all_deps }
it {
is_expected.to contain_package('jfrog-artifactory-oss').with(
'ensure' => '5.9.1',
'ensure' => '6.0.0',
)
}
it {
is_expected.to contain_file('/var/opt/jfrog/artifactory/etc/binarystore.xml').with_content(%r{chain template="file-system"})
is_expected.to contain_file('/var/opt/jfrog/artifactory/etc/binarystore.xml').without_content(%r{<provider id="file-system" type="file-system">})
is_expected.to contain_file('/var/opt/jfrog/artifactory/etc/binarystore.xml').without_content(%r{<fileStoreDir>})
is_expected.to contain_file('/var/opt/jfrog/artifactory/etc/binarystore.xml').without_content(%r{<baseDataDir>})
}
end

context 'running a current version' do
let(:params) do
{
'package_version' => '7.4.3',
}
end

it { is_expected.to compile.with_all_deps }
it {
is_expected.to contain_package('jfrog-artifactory-oss').with(
'ensure' => '7.4.3',
)
}
it {
is_expected.to contain_file('/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml').with_content(%r{chain template="file-system"})
is_expected.to contain_file('/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml').without_content(%r{<provider id="file-system" type="file-system">})
is_expected.to contain_file('/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml').without_content(%r{<fileStoreDir>})
is_expected.to contain_file('/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml').without_content(%r{<baseDataDir>})
}
end

context 'running a current version with a custom binary filesystem dir' do
let(:params) do
{
'package_version' => '7.4.3',
'binary_provider_filesystem_dir' => '/opt/artifactory-filestore',
}
end

it { is_expected.to compile.with_all_deps }
it {
is_expected.to contain_file('/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml').with_content(%r{<provider id="file-system" type="file-system">})
is_expected.to contain_file('/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml').with_content(%r{<fileStoreDir>/opt/artifactory-filestore</fileStoreDir>})
is_expected.to contain_file('/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml').without_content(%r{<baseDataDir>})
}
end

context 'running a current version with a custom binary base data dir' do
let(:params) do
{
'package_version' => '7.4.3',
'binary_provider_base_data_dir' => '/opt/artifactory-data',
}
end

it { is_expected.to compile.with_all_deps }
it {
is_expected.to contain_file('/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml').with_content(%r{<baseDataDir>/opt/artifactory-data</baseDataDir>})
is_expected.to contain_file('/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml').with_content(%r{<fileStoreDir>/opt/artifactory-data/filestore</fileStoreDir>})
}
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require 'puppet_litmus'
require 'spec_helper_acceptance_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_acceptance_local.rb'))

PuppetLitmus.configure!

require 'spec_helper_acceptance_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_acceptance_local.rb'))
9 changes: 5 additions & 4 deletions spec/spec_helper_acceptance_local.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
require 'puppet_litmus'
# frozen_string_literal: true

require 'singleton'

class Helper
include Singleton
include PuppetLitmus
end

# def some_helper_method
# Helper.instance.bolt_run_script('path/to/file')
# end
def some_helper_method
Helper.instance.bolt_run_script('path/to/file')
end
Loading

0 comments on commit 907ad67

Please sign in to comment.