Code Monkey home page Code Monkey logo

artifactory's Introduction

Build Status Puppet Forge Puppet Forge

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with artifactory
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

Overview

This will install Artifactory OSS or PRO. 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

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

This is where Artifactory comes in. It stores all of your organizations artifacts in an organized and secure manner.

Module Description

The Artifactory module installs, configures, and manages the Artifactory open source binary repository.

The Artifactory module manages both the installation and database configuration of Artifactory OSS.

Setup

Beginning with artifactory

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:

class { '::artifactory':
  package_version => '7.4.3',

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:

class { '::artifactory':
  jdbc_driver_url                => 'puppet:///modules/my_module/mysql.jar',
  db_type                        => 'oracle',
  db_url                         => 'jdbc:oracle:thin:@somedomain.com:1521:arti001',
  db_username                    => 'my_username',
  db_password                    => 'efw23gn2j3',
  binary_provider_type           => 'filesystem',
  pool_max_active                => 100,
  pool_max_idle                  => 10,
  binary_provider_cache_maxsize  => $binary_provider_cache_maxsize,
  binary_provider_filesystem_dir => '/var/opt/jfrog/artifactory/data/filestore',
  binary_provider_cache_dir      => '/var/opt/jfrog/artifactory/',
}

Artifactory with PostgreSQL database

This installs PostgreSQL 11 and artifactory. PostgreSQL 12 isn't supported yet by Artifactory. This code is tested on CentOS 7.

class {'postgresql::globals':
  version => '11',
  manage_package_repo => true,
}
include postgresql::server

postgresql::server::db {'artifactory':
  user => 'artifactory',
  password => postgresql_password('artifactory', 'RANDOM_PASSWORD_SHOULD_BE_INSERTED_HERE'),
}
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']
}

Install commercial version

To install a commercial version of Artifactory:

class { '::artifactory':
  edition     => 'pro',
  license_key => 'ABCDEFG1234567890',
  ...
}

Usage

All interaction for the server is done via ::artifactory.

Reference

Classes

Public classes

Private classes

  • artifactory::yum: Installs yum configuration.
  • artifactory::install: Installs packages.
  • artifactory::config: Configures Artifactory.
  • artifactory::service: Manages service.
  • artifactory::mysql: Manages an automated mysql database

Parameters

artifactory

yum_name

Sets the name of the yum repository. Defaults to 'bintray-jfrog-artifactory-rpms'.

This can be changed if Artifactory needs to be setup from a different repository. Typically this is done if an organization has a 'trusted' yum repo.

yum_baseurl

Sets the base url of the yum repository to name. Defaults to 'http://jfrog.bintray.com/artifactory-rpms'.

This can be changed if Artifactory needs to be setup from a different repository. Typically this is done if an organization has a 'trusted' yum repo.

package_name

Sets the package name to install. Defaults to 'jfrog-artifactory-oss'.

This can be changed if Artifactory needs to install a differently named package. Possibly needed if na organization creates their own Artifactory package.

package_version

Sets the package version to. Defaults to 'present'.

This can be changed if you need to install a specific version. It takes the same values allowed for the ensure parameter of the standard package resource type.

root_password

Sets the root password for Puppet managed mysql database

jdbc_driver_url

Sets the location for the jdbc driver. The built-in file type is used to retrieve the driver.

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

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 allows user to add additional database and storage options to db.properties without Puppet touching.

db_automate

Set to 'true' if you want Puppet to create a database. Only works with mysql. If true, we recommend using JDBC connector version 5.1.24. NOTE: Puppet may throw an error the first run while it waits for Artifactory to connect to database

db_type

Only required for database configuration. The type of database to configure for. Valid values are 'mariadb', 'mssql', 'mysql', 'oracle', 'postgresql'.

db_url

Only required for database configuration. The url of the database.

db_username

Only required for database configuration. The username for the database account.

db_password

Only required for database configuration. The password for the database account.

binary_provider_type

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

Optional setting for the maximum number of pooled database connections. Defaults to 100.

pool_max_idle

Optional setting for the maximum number of pooled idle database connections Defaults to 10.

binary_provider_cache_maxsize

Optional setting for the maximum cache size. This value specifies the maximum cache size (in bytes) to allocate on the system for caching BLOBs.

binary_provider_base_data_dir

Optional setting for the artifactory filestore base location. Defaults to '$ARTIFACTORY_HOME/data'.

binary_provider_filesystem_dir

Optional setting for the artifactory filestore location. If the binary.provider.type is set to filesystem this value specifies the location of the binaries in combination with binary_provider_base_data_dir. Defaults to 'filestore'.

binary_provider_cache_dir

Optional setting for the location of the cache. This should be set to your $ARTIFACTORY_HOME directory directly (not on the NFS).

master_key

Optional setting for the master key that Artifactory uses to connect to the database. If specified, it ensures that if your node terminates, a new one can be spun up that can connect to the same database as before. Otherwise, Artifactory will generate a new master key on first run.

config_owner

Optional argument to set the ownership of the configuration files.

config_group

Optional argument to set the group of the configuration files.

Limitations

This module has been tested on:

  • RedHat Enterprise Linux 5, 6, 7, 8
  • CentOS 5, 6, 7, 8

Development

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.

artifactory's People

Stargazers

 avatar  avatar

Watchers

 avatar

artifactory's Issues

Need some help on artifactory.lic

Hi friends,
I am trying to build my own artifactory module to apply on my existing running artifactory.
Thanks for the hint of re-encrypted db.properties password, I managed to overcome keep restarting issue.
Currently, I am so close to the end. One thing I have not understood is:

if ($::artifactory::license_key) {

  1. Do we really need artifactory.lic? It does not exist in my artifactory folder but instead I have artifactory.cluster.license
  2. Everytime artifactory restarts, the new created artifactory.lic disappears. And the next puppet run detects the missing file, it will create and restart artifactory again. I am having a very hard time finding out what is exactly the usage for this file. I commented out the block to ensure this license file, my artifactory is still happy.
  3. I am using Artifactory Version 6.11.1 Enterprise and in HA

Any help would be much appreciated !

binarystore.xml - Creation fails, missing parent dir

Module version: 3.0.0
Artifactory Version 7.4.3

Issue: /var/opt/jfrog/artifactory/etc/artifactory is not created until Artifactory service is started for the first time.

Error:

Notice: /Stage[main]/Artifactory::Yum/Yumrepo[bintray-jfrog-artifactory-rpms]/ensure: created (corrective)
Info: Yumrepobintray-jfrog-artifactory-rpms: changing mode of /etc/yum.repos.d/bintray-jfrog-artifactory-rpms.repo from 600 to 644
Notice: /Stage[main]/Artifactory::Install/Package[jfrog-artifactory-oss]/ensure: created (corrective)
Info: /Stage[main]/Artifactory::Install/Package[jfrog-artifactory-oss]: Scheduling refresh of Exec[/usr/sbin/katello-package-upload]
Error: Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir - /var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml20200807-3546-1yaddh8.lock (file: /var/cache/puppet/environments/raughenb/modules-r10k/artifactory/manifests/config.pp, line: 238)
Error: Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir - /var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml20200807-3546-1yaddh8.lock (file: /var/cache/puppet/environments/raughenb/modules-r10k/artifactory/manifests/config.pp, line: 238)
Wrapped exception:
No such file or directory @ dir_s_mkdir - /var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml20200807-3546-1yaddh8.lock
Error: /Stage[main]/Artifactory::Config/File[/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml]/ensure: change from 'absent' to 'file' failed: Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir - /var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml20200807-3546-1yaddh8.lock (file: /var/cache/puppet/environments/raughenb/modules-r10k/artifactory/manifests/config.pp, line: 238) (corrective)
Notice: /Stage[main]/Artifactory::Service/Service[artifactory]: Dependency File[/var/opt/jfrog/artifactory/etc/artifactory/binarystore.xml] has failures: true
Warning: /Stage[main]/Artifactory::Service/Service[artifactory]: Skipping because of failed dependencies

Resolution:
If you want to create binarystore.xml before starting service for first time need to create /var/opt/jfrog/artifactory/etc/artifactory after package install, and before binarystore.xml resource.

master.key location

I see in commit 0afb68a44 the location of master.key was changed from ${::artifactory::artifactory_home}/etc/security/master.key" to "${_security_dir}/master.key" (_security_dir = ${::artifactory::artifactory_home}/etc/artifactory/security).
Reviewing 6.x to 7x upgrade instructions the only change in location for master.key is from ARTIFACTORY_HOME to JFROG_HOME, but is not moved from etc/security to etc/artifactory/security subdirectory.

If you look at an example system.yaml ie..system.basic-template.yaml or system.full-template.yaml
you will find that master.key location still indicates default of JFROG_HOME/artifactory/var/etc/security/master.key

I have not verified, however looking in my JFROG_HOME
/var/opt/jfrog/artifactory/etc/artifactory/security
I do not see a master.key generated by Artifactory (7.4.3), so I am making the assumption that the default location as specified in system.yaml example files is the location still being used for master.key.
I do not have a .secrets dir so I can not comment on that.

I am still using 2.2.7 and was running noop against 3.0.0 to see changes and picked up the change regarding master.key.

make a new release?

Hi,
the last release happended some time ago. Could you consider making a new one? (maybe with #9 included)

Need system java

Recently (actually not that recently ;-) ) support was removed for system Java because of artifactory bundling Java 11 anyway.

I NEED support for system Java mainly because of automatic certificate distribution.

Why does the module install java 8?

Hi,
I noticed that the module purges Java 6 and 7 and installs Java 8 afterwards. Could you please explain why? Artifactory shipps a bundled java:

[root@centos7-64-1 ~]# /opt/jfrog/artifactory/app/third-party/java/bin/java --version
openjdk 11.0.2 2019-01-15
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.2+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.2+9, mixed mode)
[root@centos7-64-1 ~]#

Besides that, Java 8 is pretty old and shouldn't be used anymore? can we drop that code from the init.pp?

Unable to use S3 for binarystore

I would like to be able to configure the binarystore to use S3. Ultimately I want to use the Amazon S3 SDK Cluster Binary Provider so I need to be able to set binarystore.xml to something like this:

<config version="2">
    <chain template="cluster-s3-storage-v3"/>
    <provider id="s3-storage-v3" type="s3-storage-v3">
       <endpoint>http://s3.amazonaws.com</endpoint>
       <bucketName>bucketName</bucketName>
       <path>pathPrefix</path>
       <region>s3Region</region>
       <identity>yourIdentity</identity>
       <credential>yourCredentials</credential>
       <usePresigning>true</usePresigning>
       <signatureExpirySeconds>600</signatureExpirySeconds>
   </provider>
</config>

However the module should be updated to allow any of the valid S3 configurations.

Help with Beaker Testing

I cannot run the beaker testing and would like to submit a PR for the addition of Ubuntu support.

https://github.com/manaakiwhenua/artifactory

Here is the output of trying to run beaker.

bundler exec rake beaker
TEST_TIERS env variable not defined. Defaulting to run all tests.
/usr/bin/ruby2.5 -I/home/spethm/Work/Landcare/dev/admin-puppet-repo/artifactory/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.2/lib:/home/spethm/Work/Landcare/dev/admin-puppet-repo/artifactory/vendor/bundle/ruby/2.5.0/gems/rspec-support-3.9.3/lib /home/spethm/Work/Landcare/dev/admin-puppet-repo/artifactory/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.9.2/exe/rspec spec/acceptance
Running tests against this machine !

An error occurred while loading ./spec/acceptance/class_spec.rb.
Failure/Error: class Helper
TypeError:
  Helper is not a class
  
# ./spec/spec_helper_acceptance_local.rb:5:in `<top (required)>'
# ./spec/spec_helper_acceptance.rb:6:in `require'
# ./spec/spec_helper_acceptance.rb:6:in `<top (required)>'
# ./spec/acceptance/class_spec.rb:1:in `require'
# ./spec/acceptance/class_spec.rb:1:in `<top (required)>'
No examples found.

Finished in 0.00003 seconds (files took 0.88095 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

Any ideas what might be the problem?

I have puppet 6.1.0 installed.

Transfer to Vox Pupuli?

Hello o/

This repository appears to be inactive. Would you be interested in transferring it to the Vox Pupuli community? By doing so, we can ensure the continued maintenance of this module. If you're unsure about the process, I'm more than happy to guide you through it.

For more information on the steps involved, please refer to this documentation: Migrate Module to Vox Pupuli

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.