Skip to content

Commit

Permalink
move default values to module data (Hiera)
Browse files Browse the repository at this point in the history
  • Loading branch information
fraenki committed Aug 13, 2024
1 parent 78f2c6f commit a9e520b
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 112 deletions.
83 changes: 26 additions & 57 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ The following parameters are available in the `artifactory` class:
* [`pool_max_active`](#-artifactory--pool_max_active)
* [`pool_max_idle`](#-artifactory--pool_max_idle)
* [`root_password`](#-artifactory--root_password)
* [`service_name`](#-artifactory--service_name)
* [`symlink_name`](#-artifactory--symlink_name)
* [`use_temp_db_secrets`](#-artifactory--use_temp_db_secrets)
* [`yum_baseurl`](#-artifactory--yum_baseurl)
Expand All @@ -77,68 +78,62 @@ The following parameters are available in the `artifactory` class:

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

Data type: `String`
Data type: `Optional[String]`

Sets the URL of the APT repository.

Default value: `'https://releases.jfrog.io/artifactory/artifactory-debs'`
Default value: `undef`

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

Data type: `String`
Data type: `Optional[String]`

Sets the URL of the APT repository (Pro edition).

Default value: `'https://releases.jfrog.io/artifactory/artifactory-pro-debs'`
Default value: `undef`

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

Data type: `String`
Data type: `Optional[String]`

Sets the ID of the APT repository key.

Default value: `'A3D085F542F740BBD7E3A2846B219DCCD7639232'`
Default value: `undef`

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

Data type: `String`
Data type: `Optional[String]`

Sets the URL of the APT repository.

Default value: `'https://releases.jfrog.io/artifactory/api/gpg/key/public'`
Default value: `undef`

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

Data type: `String`
Data type: `Optional[String]`

Sets the names of the APT repositories to enable.

Default value: `'main'`
Default value: `undef`

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

Data type: `Stdlib::Absolutepath`

The Artifactory data directory that should be used for archive installations.

Default value: `'/opt/artifactory-data'`

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

Data type: `Stdlib::Absolutepath`

The Artifactory app directory that should be used for archive installations.

Default value: `'/opt'`

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

Data type: `String`

Specifies the main directory.

Default value: `'/var/opt/jfrog/artifactory'`

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

Data type: `Optional[String]`
Expand Down Expand Up @@ -194,28 +189,22 @@ Default value: `undef`

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

Data type: `Optional[String]`
Data type: `String`

Specifies the group owner of the configuration files.

Default value: `'artifactory'`

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

Data type: `Optional[String]`
Data type: `String`

Specifies the owner of the configuration files.

Default value: `'artifactory'`

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

Data type: `Optional[Boolean]`
Data type: `Boolean`

Set to 'true' to let Puppet create a database (instance). Only supports MySQL.

Default value: `false`

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

Data type: `Optional[String]`
Expand Down Expand Up @@ -254,48 +243,36 @@ Data type: `String`

The filename of the archive distribution.

Default value: `'jfrog-artifactory-%s-%s-linux.tar.gz'`

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

Data type: `String`

The download URL for the open-source edition.

Default value: `'https://releases.jfrog.io/artifactory/bintray-artifactory/org/artifactory/oss/jfrog-artifactory-oss/%s/%s'`

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

Data type: `String`

The download URL for the pro edition.

Default value: `'https://releases.jfrog.io/artifactory/artifactory-pro/org/artifactory/pro/jfrog-artifactory-pro/%s/%s'`

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

Data type: `Enum['oss', 'pro', 'enterprise']`

Specifies the Artifactory edition/license.

Default value: `'oss'`

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

Data type: `String`

Whether to use a package or an archive to install artifactory.

Default value: `'package'`

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

Data type: `String`

Path to the installation script of the archive distribution.

Default value: `'app/bin/installService.sh'`

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

Data type: `Optional[String]`
Expand All @@ -318,8 +295,6 @@ Data type: `Boolean`

Whether to setup required repos or disable repo management.

Default value: `true`

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

Data type: `Optional[String]`
Expand All @@ -337,24 +312,18 @@ Data type: `String`

Sets the package name to install.

Default value: `'jfrog-artifactory-oss'`

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

Data type: `String`

Sets the package name to install (Pro edition).

Default value: `'jfrog-artifactory-pro'`

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

Data type: `String`

Specifies the package version.

Default value: `'present'`

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

Data type: `Optional[Integer]`
Expand All @@ -373,11 +342,15 @@ Default value: `undef`

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

Data type: `Optional[String]`
Data type: `String`

Sets the root password for Puppet managed mysql database instance.

Default value: `'password'`
##### <a name="-artifactory--service_name"></a>`service_name`

Data type: `String`

Specifies the name of the Artifactory system service.

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

Expand All @@ -386,8 +359,6 @@ Data type: `String`
Controls the name of a version-independent symlink for the archive
installation. It will always point to the release specified by `$package_version`.

Default value: `'artifactory'`

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

Data type: `Boolean`
Expand All @@ -397,29 +368,27 @@ Set to `false` to persist the file in `$artifactory_home/etc/db.properties`,
which will allow to add database and storage options without Puppet
touching it.

Default value: `true`

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

Data type: `String`
Data type: `Optional[String]`

Sets the URL of the yum repository.

Default value: `'https://jfrog.bintray.com/artifactory-rpms'`
Default value: `undef`

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

Data type: `String`
Data type: `Optional[String]`

Sets the URL of the yum repository (Pro edition).

Default value: `'https://jfrog.bintray.com/artifactory-pro-rpms'`
Default value: `undef`

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

Data type: `String`
Data type: `Optional[String]`

Sets the name of the yum repository.

Default value: `'bintray-jfrog-artifactory-rpms'`
Default value: `undef`

6 changes: 6 additions & 0 deletions data/Debian-family.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
artifactory::apt_baseurl: 'https://releases.jfrog.io/artifactory/artifactory-debs'
artifactory::apt_baseurl_pro: 'https://releases.jfrog.io/artifactory/artifactory-pro-debs'
artifactory::apt_key_id: 'A3D085F542F740BBD7E3A2846B219DCCD7639232'
artifactory::apt_key_source: 'https://releases.jfrog.io/artifactory/api/gpg/key/public'
artifactory::apt_repos: 'main'
4 changes: 4 additions & 0 deletions data/RedHat-family.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
artifactory::yum_baseurl: 'https://jfrog.bintray.com/artifactory-rpms'
artifactory::yum_baseurl_pro: 'https://jfrog.bintray.com/artifactory-pro-rpms'
artifactory::yum_name: 'bintray-jfrog-artifactory-rpms'
22 changes: 21 additions & 1 deletion data/common.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
--- {}
---
artifactory::archive_data_dir: '/opt/artifactory-data'
artifactory::archive_install_dir: '/opt'
artifactory::artifactory_home: '/var/opt/jfrog/artifactory'
artifactory::config_group: 'artifactory'
artifactory::config_owner: 'artifactory'
artifactory::db_automate: false
artifactory::download_filename: 'jfrog-artifactory-%s-%s-linux.tar.gz'
artifactory::download_url_oss: 'https://releases.jfrog.io/artifactory/bintray-artifactory/org/artifactory/oss/jfrog-artifactory-oss/%s/%s'
artifactory::download_url_pro: 'https://releases.jfrog.io/artifactory/artifactory-pro/org/artifactory/pro/jfrog-artifactory-pro/%s/%s'
artifactory::edition: 'oss'
artifactory::install_method: 'package'
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'
artifactory::use_temp_db_secrets: true
32 changes: 21 additions & 11 deletions hiera.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,26 @@ defaults: # Used for any hierarchy level that omits these keys.
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: 'Set important hiera options'
path: "hiera_options.yaml"

- name: 'Distribution Full Version'
path: '%{facts.os.name}-%{facts.os.release.full}.yaml'

- name: 'Distribution Major Version'
path: '%{facts.os.name}-%{facts.os.release.major}.yaml'

- name: 'Distribution Name'
path: '%{facts.os.name}.yaml'

- name: 'OS Family Major Version'
path: '%{facts.os.family}-%{facts.os.release.major}-family.yaml'

- name: 'OS Family'
path: '%{facts.os.family}-family.yaml'

- name: 'OS Kernel'
path: '%{facts.kernel}.yaml'

- name: 'common'
path: 'common.yaml'
Loading

0 comments on commit a9e520b

Please sign in to comment.