Skip to content

Commit

Permalink
various typos in README
Browse files Browse the repository at this point in the history
unused param (port)

follow links to certificate(s)

add custom type test - dynamic for factset's FQDN

linting
  • Loading branch information
prolixalias committed Sep 30, 2022
1 parent 11f6ab1 commit 619a41f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
8 changes: 5 additions & 3 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ fixtures:
yumrepo: "puppetlabs/yumrepo_core"
apt: "puppetlabs/apt"
repositories:
bootstrap: 'https://github.com/puppetlabs/puppetlabs-bootstrap'
deploy_pe: 'https://github.com/jarretlavallee/puppet-deploy_pe'
facts: 'https://github.com/puppetlabs/puppetlabs-facts'
puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent'
provision: 'https://github.com/puppetlabs/provision'
bootstrap: 'https://github.com/puppetlabs/puppetlabs-bootstrap'
puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent'
puppet_conf: 'https://github.com/puppetlabs/puppetlabs-puppet_conf'
ruby_task_helper: 'https://[email protected]/puppetlabs/puppetlabs-ruby_task_helper'
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib'
deploy_pe: 'https://github.com/jarretlavallee/puppet-deploy_pe'
symlinks:
influxdb: "#{source_dir}" # for custom type(s)
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ influxdb::initial_bucket: 'puppet_data'
influxdb::repo_gpg_key_id: '05CE15085FC09D18E99EFB22684A14CF2582E0C5'
influxdb::repo_gpg_key_url: 'https://repos.influxdata.com/influxdb2.key https://repos.influxdata.com/influxdb.key'
influxdb::manage_repo: false
influxdb::profile::toml::version: '2.1.1'
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# @summary Installs, configures, and performs initial setup of InfluxDB 2.x
#
# @example Basic usage
# include influxdb
#
# class {'influxdb':
# initial_org => 'my_org',
# initial_bucket => 'my_bucket',
# }
#
# @param manage_repo
# Whether to manage a repository to provide InfluxDB packages. Defaults to true
# @param manage_setup
Expand Down
11 changes: 9 additions & 2 deletions manifests/profile/toml.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# @summary Installs the toml-rb gem inside Puppet server
#
# @param version
# Specific version of toml-rb gem
#
# @example Basic usage
# include influxdb::profile::toml
#

#
class influxdb::profile::toml (
String $version = '2.1.1',
){
String $version,
) {
$service_name = $facts['pe_server_version'] ? {
undef => 'puppetserver',
default => 'pe-puppetserver',
Expand Down
19 changes: 18 additions & 1 deletion spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
let(:facts) { os_facts }

it { is_expected.to compile }

it {
is_expected.to contain_influxdb_setup(Facter.value(:networking)['fqdn']).with(
ensure: 'present',
token_file: '/root/.influxdb_token',
bucket: 'puppet_data',
org: 'puppetlabs',
username: 'admin',
password: RSpec::Puppet::Sensitive.new('puppetlabs'),
).that_requires('Service[influxdb]')
}
end
end

Expand All @@ -18,7 +29,6 @@
it {
is_expected.to contain_class('influxdb').with(
host: 'localhost',
port: 8086,
use_ssl: true,
initial_org: 'puppetlabs',
token: nil,
Expand Down Expand Up @@ -61,7 +71,9 @@
is_expected.to contain_class('influxdb').with(use_ssl: false)

is_expected.not_to contain_file('/etc/influxdb/cert.pem')

is_expected.not_to contain_file('/etc/influxdb/ca.pem')

is_expected.not_to contain_file('/etc/influxdb/key.pem')
}
end
Expand Down Expand Up @@ -98,23 +110,27 @@
group: 'root',
)
end

is_expected.to contain_file('/var/lib/influxdb').with(
ensure: 'directory',
owner: 'influxdb',
group: 'influxdb',
)

is_expected.to contain_file('/var/lib/influxdb').that_requires(['User[influxdb]', 'Group[influxdb]'])

['/etc/influxdb/scripts/influxd-systemd-start.sh', '/etc/systemd/system/influxdb.service'].each do |file|
is_expected.to contain_file(file)
end

is_expected.to contain_user('influxdb')

is_expected.to contain_group('influxdb')

is_expected.to contain_archive('/tmp/influxdb.tar.gz').with(
source: 'https://dl.influxdata.com/influxdb/releases/influxdb2-2.1.1-linux-amd64.tar.gz',
)

is_expected.to contain_archive('/tmp/influxdb.tar.gz').that_requires(
['File[/etc/influxdb]', 'File[/opt/influxdb]'],
)
Expand All @@ -126,6 +142,7 @@

it {
is_expected.not_to contain_yumrepo('influxdb2')

is_expected.not_to contain_archive('/tmp/influxdb.tar.gz')
}
end
Expand Down

0 comments on commit 619a41f

Please sign in to comment.