-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
222 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This file can be used to install module dependencies for unit testing | ||
# See https://github.com/puppetlabs/puppetlabs_spec_helper#using-fixtures for details | ||
--- | ||
fixtures: | ||
forge_modules: | ||
# stdlib: "puppetlabs/stdlib" | ||
archive: "puppet/archive" | ||
stdlib: "puppetlabs/stdlib" | ||
systemd: "camptocamp/systemd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Reference | ||
<!-- DO NOT EDIT: This document was generated by Puppet Strings --> | ||
|
||
## Table of Contents | ||
|
||
**Classes** | ||
|
||
* [`nifi_toolkit`](#nifi_toolkit): Install Apache NiFi Toolkit | ||
|
||
## Classes | ||
|
||
### nifi_toolkit | ||
|
||
Install Apache NiFi Toolkit | ||
|
||
#### Examples | ||
|
||
##### Defaults | ||
|
||
```puppet | ||
include nifi_toolkit | ||
``` | ||
|
||
##### Downloading from a different repository | ||
|
||
```puppet | ||
class { 'nifi_toolkit': | ||
download_url => 'https://repo.local/nifi/nifi-toolkit-1.10.0.tar.gz', | ||
} | ||
``` | ||
|
||
#### Parameters | ||
|
||
The following parameters are available in the `nifi_toolkit` class. | ||
|
||
##### `version` | ||
|
||
Data type: `String` | ||
|
||
The version of Apache NiFi Toolkit. This must match the version in | ||
the tarball. | ||
|
||
Default value: '1.10.0' | ||
|
||
##### `download_url` | ||
|
||
Data type: `String` | ||
|
||
Where to download the binary installation tarball from. | ||
|
||
Default value: 'http://mirrors.ibiblio.org/apache/nifi/1.10.0/nifi-toolkit-1.10.0-bin.tar.gz' | ||
|
||
##### `download_checksum` | ||
|
||
Data type: `String` | ||
|
||
The expected checksum of the downloaded tarball. This is used for | ||
verifying the integrity of the downloaded tarball. | ||
|
||
Default value: 'cdea77679a6b6198a60f5b89d6d97783398b48b8d02b513b081f2456f8949ad5' | ||
|
||
##### `download_checksum_type` | ||
|
||
Data type: `String` | ||
|
||
The checksum type of the downloaded tarball. This is used for | ||
verifying the integrity of the downloaded tarball. | ||
|
||
Default value: 'sha256' | ||
|
||
##### `install_root` | ||
|
||
Data type: `Stdlib::Absolutepath` | ||
|
||
The root directory of the nifi toolkit installation. | ||
|
||
Default value: '/opt/nifi-toolkit' | ||
|
||
##### `download_tmp_dir` | ||
|
||
Data type: `Stdlib::Absolutepath` | ||
|
||
|
||
|
||
Default value: '/var/tmp' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# @summary Install Apache NiFi Toolkit | ||
# | ||
# Install Apache NiFi Toolkit | ||
# | ||
# @param version | ||
# The version of Apache NiFi Toolkit. This must match the version in | ||
# the tarball. | ||
# | ||
# @param download_url | ||
# Where to download the binary installation tarball from. | ||
# | ||
# @param download_checksum | ||
# The expected checksum of the downloaded tarball. This is used for | ||
# verifying the integrity of the downloaded tarball. | ||
# | ||
# @param download_checksum_type | ||
# The checksum type of the downloaded tarball. This is used for | ||
# verifying the integrity of the downloaded tarball. | ||
# | ||
# @param install_root | ||
# The root directory of the nifi toolkit installation. | ||
# | ||
# @example Defaults | ||
# include nifi_toolkit | ||
# | ||
# @example Downloading from a different repository | ||
# class { 'nifi_toolkit': | ||
# download_url => 'https://repo.local/nifi/nifi-toolkit-1.10.0.tar.gz', | ||
# } | ||
# | ||
class nifi_toolkit ( | ||
String $version = '1.10.0', | ||
String $download_url = 'http://mirrors.ibiblio.org/apache/nifi/1.10.0/nifi-toolkit-1.10.0-bin.tar.gz', | ||
String $download_checksum = 'cdea77679a6b6198a60f5b89d6d97783398b48b8d02b513b081f2456f8949ad5', | ||
String $download_checksum_type = 'sha256', | ||
Stdlib::Absolutepath $download_tmp_dir = '/var/tmp', | ||
Stdlib::Absolutepath $install_root = '/opt/nifi-toolkit', | ||
) { | ||
|
||
$local_tarball = "${download_tmp_dir}/nifi-toolkit-${version}.tar.gz" | ||
$software_directory = "${install_root}/nifi-toolkit-${version}" | ||
$cli = "${software_directory}/bin/cli.sh" | ||
|
||
archive { $local_tarball: | ||
source => $download_url, | ||
checksum => $download_checksum, | ||
checksum_type => $download_checksum_type, | ||
extract => true, | ||
extract_path => $install_root, | ||
creates => $software_directory, | ||
cleanup => true, | ||
} | ||
|
||
file { $install_root: | ||
ensure => directory, | ||
owner => 'root', | ||
group => 'root', | ||
mode => '0755', | ||
} | ||
|
||
exec { "permissions for ${software_directory}": | ||
path => ['/usr/bin'], | ||
command => "chown -Rh root: ${software_directory}", | ||
refreshonly => true, | ||
subscribe => Archive[$local_tarball], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require 'spec_helper' | ||
|
||
describe 'nifi_toolkit' do | ||
on_supported_os.each do |os, os_facts| | ||
context "on #{os}" do | ||
let(:facts) { os_facts } | ||
|
||
it { is_expected.to compile } | ||
end | ||
end | ||
end |