├── .puppet-lint.rc
├── .msync.yml
├── .sync.yml
├── .rubocop.yml
├── .github
├── labeler.yml
├── workflows
│ ├── labeler.yml
│ ├── ci.yml
│ ├── release.yml
│ └── prepare_release.yml
├── PULL_REQUEST_TEMPLATE.md
├── ISSUE_TEMPLATE.md
└── release.yml
├── manifests
├── service.pp
├── config.pp
├── install.pp
└── init.pp
├── .fixtures.yml
├── .editorconfig
├── templates
├── systemd.erb
└── sysconfig.erb
├── .gitignore
├── .pmtignore
├── Gemfile
├── spec
├── spec_helper.rb
└── classes
│ ├── appd_db_agent__service_spec.rb
│ ├── appd_db_agent_spec.rb
│ ├── appd_db_agent__install_spec.rb
│ └── appd_db_agent__config_spec.rb
├── Rakefile
├── metadata.json
├── .overcommit.yml
├── REFERENCE.md
├── README.md
├── CHANGELOG.md
└── LICENSE
/.puppet-lint.rc:
--------------------------------------------------------------------------------
1 | # Managed by modulesync - DO NOT EDIT
2 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3 |
4 | --fail-on-warnings
5 |
--------------------------------------------------------------------------------
/.msync.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # Managed by modulesync - DO NOT EDIT
3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4 |
5 | modulesync_config_version: '10.4.0'
6 |
--------------------------------------------------------------------------------
/.sync.yml:
--------------------------------------------------------------------------------
1 | ---
2 | .puppet-lint.rc:
3 | enabled_lint_checks:
4 | - parameter_documentation
5 | - parameter_types
6 | spec/spec_helper.rb:
7 | facterdb_string_keys: true
8 |
--------------------------------------------------------------------------------
/.rubocop.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # Managed by modulesync - DO NOT EDIT
3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4 |
5 | inherit_gem:
6 | voxpupuli-test: rubocop.yml
7 |
--------------------------------------------------------------------------------
/.github/labeler.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # Managed by modulesync - DO NOT EDIT
3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4 |
5 | skip-changelog:
6 | - head-branch: ['^release-*', 'release']
7 |
--------------------------------------------------------------------------------
/manifests/service.pp:
--------------------------------------------------------------------------------
1 | # @api private
2 | # This class handles the service.
3 | class appd_db_agent::service {
4 | service { 'appd_db_agent':
5 | ensure => running,
6 | enable => true,
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/.fixtures.yml:
--------------------------------------------------------------------------------
1 | ---
2 | fixtures:
3 | repositories:
4 | archive: https://github.com/voxpupuli/puppet-archive
5 | java: https://github.com/puppetlabs/puppetlabs-java
6 | stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git
7 | systemd: https://github.com/voxpupuli/puppet-systemd
8 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 |
3 | # Managed by modulesync - DO NOT EDIT
4 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
5 |
6 | root = true
7 |
8 | [*]
9 | charset = utf-8
10 | end_of_line = lf
11 | indent_size = 2
12 | tab_width = 2
13 | indent_style = space
14 | insert_final_newline = true
15 | trim_trailing_whitespace = true
16 |
--------------------------------------------------------------------------------
/templates/systemd.erb:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=Appdynamics Database Agent
3 | After=network.target
4 |
5 | [Service]
6 | Type=simple
7 | User=<%= @user %>
8 | EnvironmentFile=-/etc/sysconfig/appd_db_agent
9 | ExecStart=<%= @java_home %>/jre/bin/java <%= @java_opts.join(' ') %> -jar /opt/appdynamics/dbagent/db-agent.jar -XX:+ExitOnOutOfMemoryError
10 | SuccessExitStatus=143
11 | Restart=always
12 |
13 | [Install]
14 | WantedBy=multi-user.target
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Managed by modulesync - DO NOT EDIT
2 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3 |
4 | /pkg/
5 | /Gemfile.lock
6 | /Gemfile.local
7 | /vendor/
8 | /.vendor/
9 | /spec/fixtures/manifests/
10 | /spec/fixtures/modules/
11 | /.vagrant/
12 | /.bundle/
13 | /.ruby-version
14 | /coverage/
15 | /log/
16 | /.idea/
17 | /.dependencies/
18 | /.librarian/
19 | /Puppetfile.lock
20 | *.iml
21 | .*.sw?
22 | /.yardoc/
23 | /Guardfile
24 | bolt-debug.log
25 | .rerun.json
26 |
--------------------------------------------------------------------------------
/templates/sysconfig.erb:
--------------------------------------------------------------------------------
1 | # THIS FILE IS MANAGED BY PUPPET. CHANGES WILL BE OVERRIDDEN
2 |
3 | APPDYNAMICS_CONTROLLER_HOST_NAME=<%= @controller_host_name %>
4 | APPDYNAMICS_CONTROLLER_PORT=<%= @controller_port %>
5 | APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY=<%= @agent_account_access_key %>
6 | <%- if @agent_account_name -%>
7 | APPDYNAMICS_AGENT_ACCOUNT_NAME=<%= @agent_account_name %>
8 | <%- end -%>
9 | <%- unless @controller_ssl_enabled.nil? -%>
10 | APPDYNAMICS_CONTROLLER_SSL_ENABLED=<%= @controller_ssl_enabled %>
11 | <%- end -%>
12 |
--------------------------------------------------------------------------------
/.github/workflows/labeler.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # Managed by modulesync - DO NOT EDIT
3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4 |
5 | name: "Pull Request Labeler"
6 |
7 | # yamllint disable-line rule:truthy
8 | on:
9 | pull_request_target: {}
10 |
11 | permissions:
12 | contents: read
13 | pull-requests: write
14 |
15 | jobs:
16 | labeler:
17 | permissions:
18 | contents: read
19 | pull-requests: write
20 | runs-on: ubuntu-latest
21 | steps:
22 | - uses: actions/labeler@v5
23 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # Managed by modulesync - DO NOT EDIT
3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4 |
5 | name: CI
6 |
7 | # yamllint disable-line rule:truthy
8 | on:
9 | pull_request: {}
10 | push:
11 | branches:
12 | - main
13 | - master
14 |
15 | concurrency:
16 | group: ${{ github.ref_name }}
17 | cancel-in-progress: true
18 |
19 | permissions:
20 | contents: read
21 |
22 | jobs:
23 | puppet:
24 | name: Puppet
25 | uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v4
26 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
9 | #### Pull Request (PR) description
10 |
13 |
14 | #### This Pull Request (PR) fixes the following issues
15 |
21 |
--------------------------------------------------------------------------------
/.pmtignore:
--------------------------------------------------------------------------------
1 | # Managed by modulesync - DO NOT EDIT
2 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3 |
4 | /docs/
5 | /pkg/
6 | /Gemfile
7 | /Gemfile.lock
8 | /Gemfile.local
9 | /vendor/
10 | /.vendor/
11 | /spec/
12 | /Rakefile
13 | /.vagrant/
14 | /.bundle/
15 | /.ruby-version
16 | /coverage/
17 | /log/
18 | /.idea/
19 | /.dependencies/
20 | /.github/
21 | /.librarian/
22 | /Puppetfile.lock
23 | /Puppetfile
24 | *.iml
25 | /.editorconfig
26 | /.fixtures.yml
27 | /.gitignore
28 | /.msync.yml
29 | /.overcommit.yml
30 | /.pmtignore
31 | /.rspec
32 | /.rspec_parallel
33 | /.rubocop.yml
34 | /.sync.yml
35 | .*.sw?
36 | /.yardoc/
37 | /.yardopts
38 | /Dockerfile
39 | /HISTORY.md
40 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # Managed by modulesync - DO NOT EDIT
3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4 |
5 | name: Release
6 |
7 | # yamllint disable-line rule:truthy
8 | on:
9 | push:
10 | tags:
11 | - '*'
12 |
13 | permissions:
14 | contents: write
15 |
16 | jobs:
17 | release:
18 | name: Release
19 | uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v3
20 | with:
21 | allowed_owner: 'voxpupuli'
22 | secrets:
23 | # Configure secrets here:
24 | # https://docs.github.com/en/actions/security-guides/encrypted-secrets
25 | username: ${{ secrets.PUPPET_FORGE_USERNAME }}
26 | api_key: ${{ secrets.PUPPET_FORGE_API_KEY }}
27 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
10 |
11 | ## Affected Puppet, Ruby, OS and module versions/distributions
12 |
13 | - Puppet:
14 | - Ruby:
15 | - Distribution:
16 | - Module version:
17 |
18 | ## How to reproduce (e.g Puppet code you use)
19 |
20 | ## What are you seeing
21 |
22 | ## What behaviour did you expect instead
23 |
24 | ## Output log
25 |
26 | ## Any additional information you'd like to impart
27 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | # Managed by modulesync - DO NOT EDIT
2 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3 |
4 | source ENV['GEM_SOURCE'] || 'https://rubygems.org'
5 |
6 | group :test do
7 | gem 'voxpupuli-test', '~> 13.0', :require => false
8 | gem 'puppet_metadata', '~> 5.0', :require => false
9 | end
10 |
11 | group :development do
12 | gem 'guard-rake', :require => false
13 | gem 'overcommit', '>= 0.39.1', :require => false
14 | end
15 |
16 | group :system_tests do
17 | gem 'voxpupuli-acceptance', '~> 4.0', :require => false
18 | end
19 |
20 | group :release do
21 | gem 'voxpupuli-release', '~> 5.0', :require => false
22 | end
23 |
24 | gem 'rake', :require => false
25 |
26 | gem 'openvox', ENV.fetch('OPENVOX_GEM_VERSION', [">= 7", "< 9"]), :require => false, :groups => [:test]
27 |
28 | # vim: syntax=ruby
29 |
--------------------------------------------------------------------------------
/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Managed by modulesync - DO NOT EDIT
4 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
5 |
6 | # puppetlabs_spec_helper will set up coverage if the env variable is set.
7 | # We want to do this if lib exists and it hasn't been explicitly set.
8 | ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../lib', __dir__))
9 |
10 | require 'voxpupuli/test/spec_helper'
11 |
12 | RSpec.configure do |c|
13 | c.facterdb_string_keys = true
14 | end
15 |
16 | add_mocked_facts!
17 |
18 | if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
19 | facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml')))
20 | facts&.each do |name, value|
21 | add_custom_fact name.to_sym, value
22 | end
23 | end
24 | Dir['./spec/support/spec/**/*.rb'].sort.each { |f| require f }
25 |
--------------------------------------------------------------------------------
/.github/workflows/prepare_release.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # Managed by modulesync - DO NOT EDIT
3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4 |
5 | name: 'Prepare Release'
6 |
7 | on:
8 | workflow_dispatch:
9 | inputs:
10 | version:
11 | description: 'Module version to be released. Must be a valid semver string without leading v. (1.2.3)'
12 | required: false
13 |
14 | permissions:
15 | contents: write
16 | pull-requests: write
17 |
18 | jobs:
19 | release_prep:
20 | uses: 'voxpupuli/gha-puppet/.github/workflows/prepare_release.yml@v3'
21 | with:
22 | version: ${{ github.event.inputs.version }}
23 | allowed_owner: 'voxpupuli'
24 | secrets:
25 | # Configure secrets here:
26 | # https://docs.github.com/en/actions/security-guides/encrypted-secrets
27 | github_pat: '${{ secrets.PCCI_PAT_RELEASE_PREP }}'
28 |
--------------------------------------------------------------------------------
/.github/release.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # Managed by modulesync - DO NOT EDIT
3 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4 |
5 | # https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
6 |
7 | changelog:
8 | exclude:
9 | labels:
10 | - duplicate
11 | - invalid
12 | - modulesync
13 | - question
14 | - skip-changelog
15 | - wont-fix
16 | - wontfix
17 |
18 | categories:
19 | - title: Breaking Changes 🛠
20 | labels:
21 | - backwards-incompatible
22 |
23 | - title: New Features 🎉
24 | labels:
25 | - enhancement
26 |
27 | - title: Bug Fixes 🐛
28 | labels:
29 | - bug
30 |
31 | - title: Documentation Updates 📚
32 | labels:
33 | - documentation
34 | - docs
35 |
36 | - title: Dependency Updates ⬆️
37 | labels:
38 | - dependencies
39 |
40 | - title: Other Changes
41 | labels:
42 | - "*"
43 |
--------------------------------------------------------------------------------
/spec/classes/appd_db_agent__service_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require 'spec_helper'
4 |
5 | describe 'appd_db_agent', type: :class do
6 | let :required_parameters do
7 | {
8 | source: 'https://example.com/dbagent-4.4.1.229.zip',
9 | version: '4.4.1.229',
10 | controller_host_name: 'exampleorg.saas.appdynamics.com',
11 | controller_port: 443,
12 | agent_account_access_key: 'secretsecret'
13 | }
14 | end
15 |
16 | describe 'service' do
17 | on_supported_os.each do |os, facts|
18 | context "on #{os}" do
19 | let(:facts) do
20 | facts
21 | end
22 |
23 | context 'with all required parameters' do
24 | let :params do
25 | required_parameters
26 | end
27 |
28 | it {
29 | expect(subject).to contain_service('appd_db_agent').with(
30 | 'ensure' => 'running',
31 | 'enable' => true
32 | )
33 | }
34 | end
35 | end
36 | end
37 | end
38 | end
39 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | # Managed by modulesync - DO NOT EDIT
2 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3 |
4 | begin
5 | require 'voxpupuli/test/rake'
6 | rescue LoadError
7 | # only available if gem group test is installed
8 | end
9 |
10 | begin
11 | require 'voxpupuli/acceptance/rake'
12 | rescue LoadError
13 | # only available if gem group acceptance is installed
14 | end
15 |
16 | begin
17 | require 'voxpupuli/release/rake_tasks'
18 | rescue LoadError
19 | # only available if gem group releases is installed
20 | else
21 | GCGConfig.user = 'voxpupuli'
22 | GCGConfig.project = 'puppet-appd_db_agent'
23 | end
24 |
25 | desc "Run main 'test' task and report merged results to coveralls"
26 | task test_with_coveralls: [:test] do
27 | if Dir.exist?(File.expand_path('../lib', __FILE__))
28 | require 'coveralls/rake/task'
29 | Coveralls::RakeTask.new
30 | Rake::Task['coveralls:push'].invoke
31 | else
32 | puts 'Skipping reporting to coveralls. Module has no lib dir'
33 | end
34 | end
35 |
36 | # vim: syntax=ruby
37 |
--------------------------------------------------------------------------------
/metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "puppet-appd_db_agent",
3 | "version": "1.0.1-rc0",
4 | "author": "Vox Pupuli",
5 | "summary": "Puppet AppDynamics Database Agent Module",
6 | "license": "Apache-2.0",
7 | "source": "https://github.com/voxpupuli/puppet-appd_db_agent.git",
8 | "project_page": "http://github.com/voxpupuli/puppet-appd_db_agent",
9 | "issues_url": "https://github.com/voxpupuli/puppet-appd_db_agent/issues",
10 | "tags": [
11 | "appd",
12 | "appdynamics",
13 | "dbagent"
14 | ],
15 | "dependencies": [
16 | {
17 | "name": "puppetlabs/stdlib",
18 | "version_requirement": ">= 4.25.0 < 10.0.0"
19 | },
20 | {
21 | "name": "puppetlabs/java",
22 | "version_requirement": ">= 1.5.0 < 12.0.0"
23 | },
24 | {
25 | "name": "puppet/archive",
26 | "version_requirement": ">= 1.1.2 < 9.0.0"
27 | },
28 | {
29 | "name": "puppet/systemd",
30 | "version_requirement": ">= 1.0.0 < 9.0.0"
31 | }
32 | ],
33 | "requirements": [
34 | {
35 | "name": "openvox",
36 | "version_requirement": ">= 8.19.0 < 9.0.0"
37 | }
38 | ],
39 | "operatingsystem_support": [
40 | {
41 | "operatingsystem": "RedHat",
42 | "operatingsystemrelease": [
43 | "7"
44 | ]
45 | },
46 | {
47 | "operatingsystem": "CentOS",
48 | "operatingsystemrelease": [
49 | "7"
50 | ]
51 | }
52 | ]
53 | }
54 |
--------------------------------------------------------------------------------
/manifests/config.pp:
--------------------------------------------------------------------------------
1 | # @api private
2 | # This class handles the configuration.
3 | class appd_db_agent::config {
4 | $controller_host_name = $appd_db_agent::controller_host_name
5 | $controller_port = $appd_db_agent::controller_port
6 | $agent_account_access_key = $appd_db_agent::agent_account_access_key
7 | $agent_account_name = $appd_db_agent::agent_account_name
8 | $controller_ssl_enabled = $appd_db_agent::controller_ssl_enabled
9 |
10 | $proxy_host = $appd_db_agent::proxy_host
11 | $proxy_port = $appd_db_agent::proxy_port
12 | $db_agent_name = $appd_db_agent::db_agent_name
13 | $java_heap_size = $appd_db_agent::java_heap_size
14 | $java_home = $appd_db_agent::java_home
15 | $user = $appd_db_agent::user
16 |
17 | file { '/etc/sysconfig/appd_db_agent':
18 | ensure => file,
19 | owner => 'root',
20 | group => 'root',
21 | mode => '0600',
22 | content => template('appd_db_agent/sysconfig.erb'),
23 | }
24 |
25 | $proxy_java_opts = $proxy_host ? {
26 | undef => [],
27 | default => [
28 | "-Dappdynamics.http.proxyHost=${proxy_host}",
29 | "-Dappdynamics.http.proxyPort=${proxy_port}",
30 | ],
31 | }
32 |
33 | $db_agent_name_opt = $db_agent_name ? {
34 | undef => [],
35 | default => ["-Ddbagent.name=${db_agent_name}"],
36 | }
37 |
38 | $heap_size_opts = [
39 | "-Xms${java_heap_size}",
40 | "-Xmx${java_heap_size}",
41 | ]
42 |
43 | $java_opts = concat($proxy_java_opts, $db_agent_name_opt, $heap_size_opts)
44 |
45 | systemd::unit_file { 'appd_db_agent.service':
46 | content => template('appd_db_agent/systemd.erb'),
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/.overcommit.yml:
--------------------------------------------------------------------------------
1 | # Managed by modulesync - DO NOT EDIT
2 | # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
3 | #
4 | # Hooks are only enabled if you take action.
5 | #
6 | # To enable the hooks run:
7 | #
8 | # ```
9 | # bundle exec overcommit --install
10 | # # ensure .overcommit.yml does not harm to you and then
11 | # bundle exec overcommit --sign
12 | # ```
13 | #
14 | # (it will manage the .git/hooks directory):
15 | #
16 | # Examples howto skip a test for a commit or push:
17 | #
18 | # ```
19 | # SKIP=RuboCop git commit
20 | # SKIP=PuppetLint git commit
21 | # SKIP=RakeTask git push
22 | # ```
23 | #
24 | # Don't invoke overcommit at all:
25 | #
26 | # ```
27 | # OVERCOMMIT_DISABLE=1 git commit
28 | # ```
29 | #
30 | # Read more about overcommit: https://github.com/brigade/overcommit
31 | #
32 | # To manage this config yourself in your module add
33 | #
34 | # ```
35 | # .overcommit.yml:
36 | # unmanaged: true
37 | # ```
38 | #
39 | # to your modules .sync.yml config
40 | ---
41 | PreCommit:
42 | RuboCop:
43 | enabled: true
44 | description: 'Runs rubocop on modified files only'
45 | command: ['bundle', 'exec', 'rubocop']
46 | RakeTarget:
47 | enabled: true
48 | description: 'Runs lint on modified files only'
49 | targets:
50 | - 'lint'
51 | command: ['bundle', 'exec', 'rake']
52 | YamlSyntax:
53 | enabled: true
54 | JsonSyntax:
55 | enabled: true
56 | TrailingWhitespace:
57 | enabled: true
58 |
59 | PrePush:
60 | RakeTarget:
61 | enabled: true
62 | description: 'Run rake targets'
63 | targets:
64 | - 'validate'
65 | - 'test'
66 | - 'rubocop'
67 | command: ['bundle', 'exec', 'rake']
68 |
--------------------------------------------------------------------------------
/manifests/install.pp:
--------------------------------------------------------------------------------
1 | # @api private
2 | # This class handles the installation.
3 | class appd_db_agent::install {
4 | $version = $appd_db_agent::version
5 | $source = $appd_db_agent::source
6 | $checksum = $appd_db_agent::checksum
7 | $checksum_type = $appd_db_agent::checksum_type
8 |
9 | $user = $appd_db_agent::user
10 | $group = $appd_db_agent::group
11 |
12 | $manage_user = $appd_db_agent::manage_user
13 |
14 | include java
15 |
16 | if $manage_user {
17 | group { $group:
18 | ensure => present,
19 | }
20 | user { $user:
21 | ensure => present,
22 | gid => $group,
23 | home => '/opt/appdynamics',
24 | managehome => false,
25 | shell => '/sbin/nologin',
26 | system => true,
27 | }
28 | }
29 |
30 | file { '/opt/appdynamics':
31 | ensure => directory,
32 | owner => $user,
33 | group => $group,
34 | mode => '0640',
35 | }
36 |
37 | file { "/opt/appdynamics/dbagent-${version}":
38 | ensure => directory,
39 | owner => $user,
40 | group => $group,
41 | mode => '0640',
42 | }
43 |
44 | archive { "/tmp/dbagent-${version}.zip":
45 | ensure => present,
46 | source => $source,
47 | extract => true,
48 | extract_path => "/opt/appdynamics/dbagent-${version}",
49 | creates => "/opt/appdynamics/dbagent-${version}/db-agent.jar",
50 | cleanup => true,
51 | user => $user,
52 | group => $group,
53 | require => File["/opt/appdynamics/dbagent-${version}"],
54 | }
55 |
56 | file { '/opt/appdynamics/dbagent':
57 | ensure => link,
58 | owner => $user,
59 | group => $group,
60 | target => "/opt/appdynamics/dbagent-${version}",
61 | mode => '0640',
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/spec/classes/appd_db_agent_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require 'spec_helper'
4 |
5 | describe 'appd_db_agent', type: :class do
6 | let :required_parameters do
7 | {
8 | source: 'https://example.com/dbagent-4.4.1.229.zip',
9 | version: '4.4.1.229',
10 | controller_host_name: 'exampleorg.saas.appdynamics.com',
11 | controller_port: 443,
12 | agent_account_access_key: 'secretsecret'
13 | }
14 | end
15 |
16 | on_supported_os.each do |os, facts|
17 | context "on #{os}" do
18 | let(:facts) do
19 | facts
20 | end
21 |
22 | context 'with no parameters' do
23 | %w[source version controller_host_name controller_port agent_account_access_key].each do |param|
24 | it { is_expected.to compile.and_raise_error(%r{expects a value for parameter '#{param}'}) }
25 | end
26 | end
27 |
28 | context 'with all required parameters' do
29 | let :params do
30 | required_parameters
31 | end
32 |
33 | it { is_expected.to compile.with_all_deps }
34 | it { is_expected.to contain_class('appd_db_agent') }
35 | it { is_expected.to contain_class('appd_db_agent::install') }
36 | it { is_expected.to contain_class('appd_db_agent::config').that_requires('Class[appd_db_agent::install]') }
37 | it { is_expected.to contain_class('appd_db_agent::service').that_subscribes_to('Class[appd_db_agent::config]') }
38 | end
39 |
40 | context 'when proxy_host is specified without proxy_port' do
41 | let :params do
42 | required_parameters.merge(proxy_host: 'squid.example.com')
43 | end
44 |
45 | it { is_expected.to compile.and_raise_error(%r{proxy_port must be specified when using proxy_host}) }
46 | end
47 | end
48 | end
49 | end
50 |
--------------------------------------------------------------------------------
/manifests/init.pp:
--------------------------------------------------------------------------------
1 | # @summary Downloads, installs, configures and runs an Appdynamics Database Agent service
2 | #
3 | # @param source The source location of the dbagent-x.x.x.x.zip file. Can be any source that [puppet/archive](https://forge.puppet.com/puppet/archive) supports.
4 | # @param version The version of the agent being installed eg `4.4.1.229`.
5 | # @param controller_host_name The AppDynamics controller to connect to.
6 | # @param controller_port The port on which to connect to the controller.
7 | # @param agent_account_access_key The account access key the agent should use.
8 | # @param user The user to install and run the agent as.
9 | # @param group The primary group of the user.
10 | # @param manage_user Whether to create the user and group. Useful if you already have puppet code creating an appdynamics user.
11 | # @param agent_account_name This is the account name used to authenticate with the Controller.
12 | # @param controller_ssl_enabled Whether to connect to the controller using SSL. Needs to be set to `true` if using the AppDynamics SaaS Controller.
13 | # @param checksum Passed to the [puppet/archive](https://forge.puppet.com/puppet/archive) module when downloading the zip.
14 | # @param checksum_type Passed to the [puppet/archive](https://forge.puppet.com/puppet/archive) module when downloading the zip.
15 | # @param proxy_host If specified, the HTTP proxy to use when connecting to the controller.
16 | # @param proxy_port The HTTP proxy port. Required when proxy_host is set.
17 | # @param db_agent_name The name you want the agent to appear as in the controller.
18 | # @param java_heap_size The heap size for the java process. The default is very low and should be increased according to how many databases the agent will connect to and in line with the AppDynamics documentation.
19 | # @param java_home The java home of the JRE you want to use.
20 | class appd_db_agent (
21 | String $source,
22 | String $version,
23 |
24 | Stdlib::Host $controller_host_name,
25 | Stdlib::Port $controller_port,
26 | String $agent_account_access_key,
27 |
28 | String $user = 'appdynamics',
29 | String $group = 'appdynamics',
30 | Boolean $manage_user = true,
31 | Optional[String] $agent_account_name = undef,
32 | Optional[Boolean] $controller_ssl_enabled = undef,
33 |
34 | Optional[String] $checksum = undef,
35 | Optional[Enum['md5', 'sha1', 'sha2', 'sha256', 'sha384', 'sha512']] $checksum_type = undef,
36 |
37 | Optional[Stdlib::Host] $proxy_host = undef,
38 | Optional[Stdlib::Port] $proxy_port = undef,
39 | Optional[String[1]] $db_agent_name = undef,
40 | Pattern[/^\d+[kKmMgG]$/] $java_heap_size = '256m',
41 | Stdlib::Unixpath $java_home = '/usr/lib/jvm/java',
42 | ) {
43 | if $proxy_host {
44 | assert_type(Stdlib::Port, $proxy_port) |$expected, $actual| {
45 | fail('proxy_port must be specified when using proxy_host')
46 | }
47 | }
48 |
49 | contain appd_db_agent::install
50 | contain appd_db_agent::config
51 | contain appd_db_agent::service
52 |
53 | Class['appd_db_agent::install']
54 | -> Class['appd_db_agent::config']
55 | ~> Class['appd_db_agent::service']
56 | }
57 |
--------------------------------------------------------------------------------
/spec/classes/appd_db_agent__install_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require 'spec_helper'
4 |
5 | describe 'appd_db_agent', type: :class do
6 | let :required_parameters do
7 | {
8 | source: 'https://example.com/dbagent-4.4.1.229.zip',
9 | version: '4.4.1.229',
10 | controller_host_name: 'exampleorg.saas.appdynamics.com',
11 | controller_port: 443,
12 | agent_account_access_key: 'secretsecret'
13 | }
14 | end
15 |
16 | describe 'install' do
17 | on_supported_os.each do |os, facts|
18 | context "on #{os}" do
19 | let(:facts) do
20 | facts
21 | end
22 |
23 | context 'with all required parameters' do
24 | let :params do
25 | required_parameters
26 | end
27 |
28 | it { is_expected.to contain_class('appd_db_agent::install') }
29 | it { is_expected.to contain_group('appdynamics').with_ensure('present') }
30 |
31 | it {
32 | expect(subject).to contain_user('appdynamics').with(
33 | 'ensure' => 'present',
34 | 'gid' => 'appdynamics',
35 | 'home' => '/opt/appdynamics',
36 | 'managehome' => false,
37 | 'shell' => '/sbin/nologin',
38 | 'system' => true
39 | )
40 | }
41 |
42 | it {
43 | expect(subject).to contain_file('/opt/appdynamics').with(
44 | 'ensure' => 'directory',
45 | 'owner' => 'appdynamics',
46 | 'group' => 'appdynamics',
47 | 'mode' => '0640'
48 | )
49 | }
50 |
51 | it {
52 | expect(subject).to contain_file('/opt/appdynamics/dbagent-4.4.1.229').with(
53 | 'ensure' => 'directory',
54 | 'owner' => 'appdynamics',
55 | 'group' => 'appdynamics',
56 | 'mode' => '0640'
57 | )
58 | }
59 |
60 | it {
61 | expect(subject).to contain_archive('/tmp/dbagent-4.4.1.229.zip').with(
62 | 'ensure' => 'present',
63 | 'source' => 'https://example.com/dbagent-4.4.1.229.zip',
64 | 'extract' => true,
65 | 'extract_path' => '/opt/appdynamics/dbagent-4.4.1.229',
66 | 'creates' => '/opt/appdynamics/dbagent-4.4.1.229/db-agent.jar',
67 | 'cleanup' => true,
68 | 'user' => 'appdynamics',
69 | 'group' => 'appdynamics'
70 | ).that_requires('File[/opt/appdynamics/dbagent-4.4.1.229]')
71 | }
72 |
73 | it {
74 | expect(subject).to contain_file('/opt/appdynamics/dbagent').with(
75 | 'ensure' => 'link',
76 | 'owner' => 'appdynamics',
77 | 'group' => 'appdynamics',
78 | 'target' => '/opt/appdynamics/dbagent-4.4.1.229',
79 | 'mode' => '0640'
80 | )
81 | }
82 | end
83 |
84 | context 'with user parameter set' do
85 | let :params do
86 | required_parameters.merge(
87 | user: 'someuser'
88 | )
89 | end
90 |
91 | it { is_expected.to contain_user('someuser') }
92 | it { is_expected.to contain_file('/opt/appdynamics').with_owner('someuser') }
93 | it { is_expected.to contain_file('/opt/appdynamics/dbagent-4.4.1.229').with_owner('someuser') }
94 | it { is_expected.to contain_file('/opt/appdynamics/dbagent').with_owner('someuser') }
95 | it { is_expected.to contain_archive('/tmp/dbagent-4.4.1.229.zip').with_user('someuser') }
96 | end
97 |
98 | context 'with group parameter set' do
99 | let :params do
100 | required_parameters.merge(
101 | group: 'somegroup'
102 | )
103 | end
104 |
105 | it { is_expected.to contain_group('somegroup') }
106 | it { is_expected.to contain_user('appdynamics').with_gid('somegroup') }
107 | it { is_expected.to contain_file('/opt/appdynamics').with_group('somegroup') }
108 | it { is_expected.to contain_file('/opt/appdynamics/dbagent-4.4.1.229').with_group('somegroup') }
109 | it { is_expected.to contain_file('/opt/appdynamics/dbagent').with_group('somegroup') }
110 | it { is_expected.to contain_archive('/tmp/dbagent-4.4.1.229.zip').with_group('somegroup') }
111 | end
112 |
113 | context 'with manage_user set to false' do
114 | let :params do
115 | required_parameters.merge(
116 | manage_user: false
117 | )
118 | end
119 |
120 | it { is_expected.to have_user_resource_count(0) }
121 | it { is_expected.to have_group_resource_count(0) }
122 | end
123 | end
124 | end
125 | end
126 | end
127 |
--------------------------------------------------------------------------------
/REFERENCE.md:
--------------------------------------------------------------------------------
1 | # Reference
2 |
3 |
4 |
5 | ## Table of Contents
6 |
7 | ### Classes
8 |
9 | #### Public Classes
10 |
11 | * [`appd_db_agent`](#appd_db_agent): Downloads, installs, configures and runs an Appdynamics Database Agent service
12 |
13 | #### Private Classes
14 |
15 | * `appd_db_agent::config`: This class handles the configuration.
16 | * `appd_db_agent::install`: This class handles the installation.
17 | * `appd_db_agent::service`: This class handles the service.
18 |
19 | ## Classes
20 |
21 | ### `appd_db_agent`
22 |
23 | Downloads, installs, configures and runs an Appdynamics Database Agent service
24 |
25 | #### Parameters
26 |
27 | The following parameters are available in the `appd_db_agent` class:
28 |
29 | * [`source`](#-appd_db_agent--source)
30 | * [`version`](#-appd_db_agent--version)
31 | * [`controller_host_name`](#-appd_db_agent--controller_host_name)
32 | * [`controller_port`](#-appd_db_agent--controller_port)
33 | * [`agent_account_access_key`](#-appd_db_agent--agent_account_access_key)
34 | * [`user`](#-appd_db_agent--user)
35 | * [`group`](#-appd_db_agent--group)
36 | * [`manage_user`](#-appd_db_agent--manage_user)
37 | * [`agent_account_name`](#-appd_db_agent--agent_account_name)
38 | * [`controller_ssl_enabled`](#-appd_db_agent--controller_ssl_enabled)
39 | * [`checksum`](#-appd_db_agent--checksum)
40 | * [`checksum_type`](#-appd_db_agent--checksum_type)
41 | * [`proxy_host`](#-appd_db_agent--proxy_host)
42 | * [`proxy_port`](#-appd_db_agent--proxy_port)
43 | * [`db_agent_name`](#-appd_db_agent--db_agent_name)
44 | * [`java_heap_size`](#-appd_db_agent--java_heap_size)
45 | * [`java_home`](#-appd_db_agent--java_home)
46 |
47 | ##### `source`
48 |
49 | Data type: `String`
50 |
51 | The source location of the dbagent-x.x.x.x.zip file. Can be any source that [puppet/archive](https://forge.puppet.com/puppet/archive) supports.
52 |
53 | ##### `version`
54 |
55 | Data type: `String`
56 |
57 | The version of the agent being installed eg `4.4.1.229`.
58 |
59 | ##### `controller_host_name`
60 |
61 | Data type: `Stdlib::Host`
62 |
63 | The AppDynamics controller to connect to.
64 |
65 | ##### `controller_port`
66 |
67 | Data type: `Stdlib::Port`
68 |
69 | The port on which to connect to the controller.
70 |
71 | ##### `agent_account_access_key`
72 |
73 | Data type: `String`
74 |
75 | The account access key the agent should use.
76 |
77 | ##### `user`
78 |
79 | Data type: `String`
80 |
81 | The user to install and run the agent as.
82 |
83 | Default value: `'appdynamics'`
84 |
85 | ##### `group`
86 |
87 | Data type: `String`
88 |
89 | The primary group of the user.
90 |
91 | Default value: `'appdynamics'`
92 |
93 | ##### `manage_user`
94 |
95 | Data type: `Boolean`
96 |
97 | Whether to create the user and group. Useful if you already have puppet code creating an appdynamics user.
98 |
99 | Default value: `true`
100 |
101 | ##### `agent_account_name`
102 |
103 | Data type: `Optional[String]`
104 |
105 | This is the account name used to authenticate with the Controller.
106 |
107 | Default value: `undef`
108 |
109 | ##### `controller_ssl_enabled`
110 |
111 | Data type: `Optional[Boolean]`
112 |
113 | Whether to connect to the controller using SSL. Needs to be set to `true` if using the AppDynamics SaaS Controller.
114 |
115 | Default value: `undef`
116 |
117 | ##### `checksum`
118 |
119 | Data type: `Optional[String]`
120 |
121 | Passed to the [puppet/archive](https://forge.puppet.com/puppet/archive) module when downloading the zip.
122 |
123 | Default value: `undef`
124 |
125 | ##### `checksum_type`
126 |
127 | Data type: `Optional[Enum['md5', 'sha1', 'sha2', 'sha256', 'sha384', 'sha512']]`
128 |
129 | Passed to the [puppet/archive](https://forge.puppet.com/puppet/archive) module when downloading the zip.
130 |
131 | Default value: `undef`
132 |
133 | ##### `proxy_host`
134 |
135 | Data type: `Optional[Stdlib::Host]`
136 |
137 | If specified, the HTTP proxy to use when connecting to the controller.
138 |
139 | Default value: `undef`
140 |
141 | ##### `proxy_port`
142 |
143 | Data type: `Optional[Stdlib::Port]`
144 |
145 | The HTTP proxy port. Required when proxy_host is set.
146 |
147 | Default value: `undef`
148 |
149 | ##### `db_agent_name`
150 |
151 | Data type: `Optional[String[1]]`
152 |
153 | The name you want the agent to appear as in the controller.
154 |
155 | Default value: `undef`
156 |
157 | ##### `java_heap_size`
158 |
159 | Data type: `Pattern[/^\d+[kKmMgG]$/]`
160 |
161 | The heap size for the java process. The default is very low and should be increased according to how many databases the agent will connect to and in line with the AppDynamics documentation.
162 |
163 | Default value: `'256m'`
164 |
165 | ##### `java_home`
166 |
167 | Data type: `Stdlib::Unixpath`
168 |
169 | The java home of the JRE you want to use.
170 |
171 | Default value: `'/usr/lib/jvm/java'`
172 |
173 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # puppet/appd\_db\_agent
2 |
3 | [](https://github.com/voxpupuli/puppet-appd_db_agent/blob/master/LICENSE)
4 | 
5 | [](https://forge.puppetlabs.com/puppet/appd_db_agent)
6 | [](https://forge.puppetlabs.com/puppet/appd_db_agent)
7 | [](https://forge.puppetlabs.com/puppet/appd_db_agent)
8 |
9 | ## Table of Contents
10 |
11 | 1. [Description](#description)
12 | 1. [Setup - The basics of getting started with appd\_db\_agent](#setup)
13 | * [What appd\_db\_agent affects](#what-appd\_db\_agent-affects)
14 | * [Setup requirements](#setup-requirements)
15 | * [Beginning with appd\_db\_agent](#beginning-with-appd\_db\_agent)
16 | 1. [Usage - Configuration options and additional functionality](#usage)
17 | 1. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
18 | 1. [Limitations - OS compatibility, etc.](#limitations)
19 | 1. [Development - Guide for contributing to the module](#development)
20 |
21 | ## Description
22 |
23 | This module installs, configures and provides a systemd based service for the [AppDynamics Database Agent](https://docs.appdynamics.com/display/PRO44/Database+Visibility).
24 | It has been developed and tested with dbagent version 4.4.1.229 on CentOS 7 with Puppet 4.10.
25 | It should also work on Puppet 5 and on other RedHat Enterprise 7 clones.
26 |
27 | Configuration is all done via the systemd service and environment file it loads from `/etc/sysconfig/appd_db_agent`.
28 | No changes are made to `controller-info.xml`.
29 |
30 | ## Setup
31 |
32 | ### What appd\_db\_agent affects
33 |
34 | The module downloads and installs the database agent under `/opt/appdynamics`.
35 | It creates a systemd unit file for the agent and starts the service.
36 |
37 | The agent depends on java being installed and this module will install by
38 | including `puppetlabs/java`.
39 |
40 | ### Setup Requirements
41 |
42 | AppDynamics doesn't provide an anonymous download link for the agent.
43 | You will have to provide the dbagent zip yourself. You have several choices for hosting it yourself.
44 | You could make it available over http via an artifact repository such as Artifactory or Nexus.
45 | Or you could make it available using your puppetserver's fileserver by placing the zip in your site module
46 | and specifying a `puppet:///` url as the `source` parameter.
47 |
48 | If using an onsite AppDynamics controller,
49 | you will have to install the required license on your controller before the agent will work.
50 |
51 | ### Beginning with appd\_db\_agent
52 |
53 | The module has a single public class. There are several optional parameters, but 5 that are required. You will need to know
54 |
55 | * The source for the dbagent zip file.
56 | This can be any source the puppet/archive module supports such as a https URL, a local file, or a `puppet:///` URL.
57 | * The version of the dbagent you're installing.
58 | This isn't automatically extracted from the source URL. It should be the complete version number eg `4.4.1.2`.
59 | * The controller host name.
60 | The module should work with local and hosted AppDynamics controllers.
61 | * The controller port number.
62 | If using the hosted service, this will be 443.
63 | * The password to use as the Agent Account Access Key.
64 |
65 | You should also consider how much heap space to allocate to the JVM running the agent. This module defaults the parameter `java_heap_size` to just 256MB.
66 | AppDynamic's [recommend](https://docs.appdynamics.com/display/PRO44/Database+Visibility+System+Requirements) 1GB + 512MB for each monitored database.
67 | ## Usage
68 |
69 | A minimal example where the agent zip is stored in a `site` module and a locally installed controller is used.
70 |
71 | ```puppet
72 | class { 'appd_db_agent':
73 | source => 'puppet:///modules/site/appdynamics/dbagent-4.4.1.229.zip',
74 | version => '4.4.1.229',
75 | controller_host_name => 'appdynamics.example.com',
76 | controller_port => 8090,
77 | agent_account_access_key => 'secret',
78 | }
79 | ```
80 |
81 | A more complete example using Artifactory as the source for the zip.
82 | Communications with the hosted SAAS is encrypted and via a squid proxy.
83 |
84 | ```puppet
85 | class { 'appd_db_agent':
86 | source => 'https://artifactory.example.com/artifactory/infra/org/appdynamics/dbagent/dbagent-4.4.1.229.zip',
87 | checksum => artifactory_sha1('https://artifactory.example.com/artifactory/api/storage/infra/org/appdynamics/dbagent/dbagent-4.4.1.229.zip'),
88 | checksum_type => 'sha1',
89 | version => '4.4.1.229',
90 | controller_host_name => 'exampleorg.saas.appdynamics.com',
91 | controller_port => 443,
92 | controller_ssl_enabled => true,
93 | agent_account_access_key => 'secret',
94 | proxy_host => 'squid.example.com',
95 | proxy_port => 3128,
96 | java_heap_size => '4g',
97 | }
98 | ```
99 |
100 | ## Reference
101 |
102 | [Puppet Strings REFERENCE.md](REFERENCE.md)
103 |
104 | ## Limitations
105 |
106 | * Tested on CentOS 7
107 | * Puppet 4.10 or greater.
108 |
109 | ## Development
110 |
111 | This module is maintained by [Vox Pupuli](https://voxpupuli.org). It was written by [Alex Fisher](https://github.com/alexjfisher) and is licensed under the Apache-2.0 License.
112 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 | Each new release typically also includes the latest modulesync defaults.
5 | These should not affect the functionality of the module.
6 |
7 | ## [v1.0.0](https://github.com/voxpupuli/puppet-appd_db_agent/tree/v1.0.0) (2024-04-24)
8 |
9 | [Full Changelog](https://github.com/voxpupuli/puppet-appd_db_agent/compare/v0.3.1...v1.0.0)
10 |
11 | **Breaking changes:**
12 |
13 | - Drop Puppet 6 support [\#51](https://github.com/voxpupuli/puppet-appd_db_agent/pull/51) ([bastelfreak](https://github.com/bastelfreak))
14 | - Drop support of Puppet 5 [\#43](https://github.com/voxpupuli/puppet-appd_db_agent/pull/43) ([smortex](https://github.com/smortex))
15 | - modulesync 2.7.0 and drop puppet 4 [\#29](https://github.com/voxpupuli/puppet-appd_db_agent/pull/29) ([bastelfreak](https://github.com/bastelfreak))
16 |
17 | **Implemented enhancements:**
18 |
19 | - puppetlabs/java: Allow 10.x [\#62](https://github.com/voxpupuli/puppet-appd_db_agent/pull/62) ([zilchms](https://github.com/zilchms))
20 | - puppet/systemd: Allow 7.x [\#61](https://github.com/voxpupuli/puppet-appd_db_agent/pull/61) ([zilchms](https://github.com/zilchms))
21 | - puppet/archive: allow 7.x [\#60](https://github.com/voxpupuli/puppet-appd_db_agent/pull/60) ([zilchms](https://github.com/zilchms))
22 | - Add Puppet 8 support [\#54](https://github.com/voxpupuli/puppet-appd_db_agent/pull/54) ([bastelfreak](https://github.com/bastelfreak))
23 | - puppetlabs/stdlib: Allow 9.x [\#53](https://github.com/voxpupuli/puppet-appd_db_agent/pull/53) ([bastelfreak](https://github.com/bastelfreak))
24 | - bump puppet/systemd to \< 5.0.0 [\#49](https://github.com/voxpupuli/puppet-appd_db_agent/pull/49) ([jhoblitt](https://github.com/jhoblitt))
25 | - Add support for Puppet 7 [\#44](https://github.com/voxpupuli/puppet-appd_db_agent/pull/44) ([smortex](https://github.com/smortex))
26 | - puppet/archive: allow 5.x [\#39](https://github.com/voxpupuli/puppet-appd_db_agent/pull/39) ([bastelfreak](https://github.com/bastelfreak))
27 |
28 | **Merged pull requests:**
29 |
30 | - Remove generated HTML documentation [\#57](https://github.com/voxpupuli/puppet-appd_db_agent/pull/57) ([smortex](https://github.com/smortex))
31 | - Allow stdlib 8.0.0 [\#42](https://github.com/voxpupuli/puppet-appd_db_agent/pull/42) ([smortex](https://github.com/smortex))
32 | - switch from camptocamp/systemd to voxpupuli/systemd [\#41](https://github.com/voxpupuli/puppet-appd_db_agent/pull/41) ([bastelfreak](https://github.com/bastelfreak))
33 | - modulesync 3.0.0 & puppet-lint updates [\#36](https://github.com/voxpupuli/puppet-appd_db_agent/pull/36) ([bastelfreak](https://github.com/bastelfreak))
34 | - Allow `puppetlabs/stdlib` 6.x `puppetlabs/java` 4.x and `puppet/archive` 4.x [\#30](https://github.com/voxpupuli/puppet-appd_db_agent/pull/30) ([alexjfisher](https://github.com/alexjfisher))
35 | - Update minimum stdlib version and use newer types [\#28](https://github.com/voxpupuli/puppet-appd_db_agent/pull/28) ([alexjfisher](https://github.com/alexjfisher))
36 |
37 | ## [v0.3.1](https://github.com/voxpupuli/puppet-appd_db_agent/tree/v0.3.1) (2018-10-17)
38 |
39 | [Full Changelog](https://github.com/voxpupuli/puppet-appd_db_agent/compare/v0.3.0...v0.3.1)
40 |
41 | **Merged pull requests:**
42 |
43 | - modulesync 2.1.0 and allow puppet 6.x [\#23](https://github.com/voxpupuli/puppet-appd_db_agent/pull/23) ([bastelfreak](https://github.com/bastelfreak))
44 | - allow puppetlabs/stdlib 5.x [\#20](https://github.com/voxpupuli/puppet-appd_db_agent/pull/20) ([bastelfreak](https://github.com/bastelfreak))
45 |
46 | ## [v0.3.0](https://github.com/voxpupuli/puppet-appd_db_agent/tree/v0.3.0) (2018-08-15)
47 |
48 | [Full Changelog](https://github.com/voxpupuli/puppet-appd_db_agent/compare/v0.2.0...v0.3.0)
49 |
50 | **Merged pull requests:**
51 |
52 | - allow puppetlabs/java 3.x [\#18](https://github.com/voxpupuli/puppet-appd_db_agent/pull/18) ([bastelfreak](https://github.com/bastelfreak))
53 | - allow puppet/archive 3.x [\#16](https://github.com/voxpupuli/puppet-appd_db_agent/pull/16) ([bastelfreak](https://github.com/bastelfreak))
54 |
55 | ## [v0.2.0](https://github.com/voxpupuli/puppet-appd_db_agent/tree/v0.2.0) (2018-07-16)
56 |
57 | [Full Changelog](https://github.com/voxpupuli/puppet-appd_db_agent/compare/v0.1.1...v0.2.0)
58 |
59 | **Merged pull requests:**
60 |
61 | - allow camptocamp/systemd 2.X [\#11](https://github.com/voxpupuli/puppet-appd_db_agent/pull/11) ([bastelfreak](https://github.com/bastelfreak))
62 | - Remove docker nodesets [\#10](https://github.com/voxpupuli/puppet-appd_db_agent/pull/10) ([bastelfreak](https://github.com/bastelfreak))
63 |
64 | ## [v0.1.1](https://github.com/voxpupuli/puppet-appd_db_agent/tree/v0.1.1) (2018-03-05)
65 |
66 | [Full Changelog](https://github.com/voxpupuli/puppet-appd_db_agent/compare/v0.1.0...v0.1.1)
67 |
68 | **Merged pull requests:**
69 |
70 | - Add missing travis puppetforge deployment secret [\#6](https://github.com/voxpupuli/puppet-appd_db_agent/pull/6) ([alexjfisher](https://github.com/alexjfisher))
71 |
72 | ## [v0.1.0](https://github.com/voxpupuli/puppet-appd_db_agent/tree/v0.1.0) (2018-03-05)
73 |
74 | [Full Changelog](https://github.com/voxpupuli/puppet-appd_db_agent/compare/38d9ce81db90939c7140a542d6e6d69d26233a17...v0.1.0)
75 |
76 | **Merged pull requests:**
77 |
78 | - Add extra validation for proxy\_port [\#4](https://github.com/voxpupuli/puppet-appd_db_agent/pull/4) ([alexjfisher](https://github.com/alexjfisher))
79 | - Small doc updates [\#3](https://github.com/voxpupuli/puppet-appd_db_agent/pull/3) ([alexjfisher](https://github.com/alexjfisher))
80 | - Add badges and fix up metadata.json for Vox Pupuli [\#2](https://github.com/voxpupuli/puppet-appd_db_agent/pull/2) ([alexjfisher](https://github.com/alexjfisher))
81 |
82 |
83 |
84 | \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
85 |
--------------------------------------------------------------------------------
/spec/classes/appd_db_agent__config_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require 'spec_helper'
4 |
5 | describe 'appd_db_agent', type: :class do
6 | let :required_parameters do
7 | {
8 | source: 'https://example.com/dbagent-4.4.1.229.zip',
9 | version: '4.4.1.229',
10 | controller_host_name: 'exampleorg.saas.appdynamics.com',
11 | controller_port: 443,
12 | agent_account_access_key: 'secretsecret'
13 | }
14 | end
15 |
16 | let :params do
17 | required_parameters
18 | end
19 |
20 | describe 'config' do
21 | on_supported_os.each do |os, facts|
22 | context "on #{os}" do
23 | let(:facts) do
24 | facts
25 | end
26 |
27 | context 'with all required parameters' do
28 | it {
29 | expect(subject).to contain_file('/etc/sysconfig/appd_db_agent').with(
30 | 'ensure' => 'file',
31 | 'owner' => 'root',
32 | 'group' => 'root',
33 | 'mode' => '0600'
34 | )
35 | }
36 |
37 | it { is_expected.to contain_systemd__unit_file('appd_db_agent.service') }
38 | end
39 |
40 | describe '/etc/sysconfig/appd_db_agent content' do
41 | context 'with all required parameters' do
42 | it {
43 | expect(subject).to contain_file('/etc/sysconfig/appd_db_agent').
44 | with_content(%r{^APPDYNAMICS_CONTROLLER_HOST_NAME=exampleorg\.saas\.appdynamics\.com$}).
45 | with_content(%r{^APPDYNAMICS_CONTROLLER_PORT=443$}).
46 | with_content(%r{^APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY=secretsecret$}).
47 | without_content(%r{APPDYNAMICS_AGENT_ACCOUNT_NAME}).
48 | without_content(%r{APPDYNAMICS_CONTROLLER_SSL_ENABLED})
49 | }
50 | end
51 |
52 | context 'with agent_account_name set' do
53 | let :params do
54 | required_parameters.merge(agent_account_name: 'someaccountname')
55 | end
56 |
57 | it {
58 | expect(subject).to contain_file('/etc/sysconfig/appd_db_agent').
59 | with_content(%r{^APPDYNAMICS_AGENT_ACCOUNT_NAME=someaccountname$})
60 | }
61 | end
62 |
63 | describe 'controller_ssl_enabled' do
64 | context 'when set to true' do
65 | let :params do
66 | required_parameters.merge(controller_ssl_enabled: true)
67 | end
68 |
69 | it {
70 | expect(subject).to contain_file('/etc/sysconfig/appd_db_agent').
71 | with_content(%r{^APPDYNAMICS_CONTROLLER_SSL_ENABLED=true$})
72 | }
73 | end
74 |
75 | context 'when set to false' do
76 | let :params do
77 | required_parameters.merge(controller_ssl_enabled: false)
78 | end
79 |
80 | it {
81 | expect(subject).to contain_file('/etc/sysconfig/appd_db_agent').
82 | with_content(%r{^APPDYNAMICS_CONTROLLER_SSL_ENABLED=false$})
83 | }
84 | end
85 | end
86 | end
87 |
88 | describe 'systemd appd_db_agent.service unit content' do
89 | describe 'user parameter' do
90 | context 'when default' do
91 | it {
92 | expect(subject).to contain_systemd__unit_file('appd_db_agent.service').
93 | with_content(%r{^User=appdynamics$})
94 | }
95 | end
96 |
97 | context 'when set' do
98 | let :params do
99 | required_parameters.merge(user: 'someuser')
100 | end
101 |
102 | it {
103 | expect(subject).to contain_systemd__unit_file('appd_db_agent.service').
104 | with_content(%r{^User=someuser$})
105 | }
106 | end
107 | end
108 |
109 | describe 'java_home parameter' do
110 | context 'when default' do
111 | it {
112 | expect(subject).to contain_systemd__unit_file('appd_db_agent.service').
113 | with_content(%r{^ExecStart=/usr/lib/jvm/java/jre/bin/java })
114 | }
115 | end
116 |
117 | context 'when set' do
118 | let :params do
119 | required_parameters.merge(java_home: '/path/to/javahome')
120 | end
121 |
122 | it {
123 | expect(subject).to contain_systemd__unit_file('appd_db_agent.service').
124 | with_content(%r{^ExecStart=/path/to/javahome/jre/bin/java })
125 | }
126 | end
127 | end
128 |
129 | describe 'java_opts' do
130 | context 'by default' do
131 | it {
132 | expect(subject).to contain_systemd__unit_file('appd_db_agent.service').
133 | with_content(%r{^ExecStart=/usr/lib/jvm/java/jre/bin/java -Xms256m -Xmx256m -jar /opt/appdynamics/dbagent/db-agent\.jar -XX:\+ExitOnOutOfMemoryError})
134 | }
135 | end
136 |
137 | context 'with proxy options set' do
138 | let :params do
139 | required_parameters.merge(
140 | proxy_host: 'squid.example.com',
141 | proxy_port: 3128
142 | )
143 | end
144 |
145 | it {
146 | expect(subject).to contain_systemd__unit_file('appd_db_agent.service').
147 | with_content(%r{^ExecStart=/usr/lib/jvm/java/jre/bin/java -Dappdynamics\.http\.proxyHost=squid\.example\.com -Dappdynamics\.http\.proxyPort=3128 -Xms256m -Xmx256m -jar /opt/appdynamics/dbagent/db-agent\.jar -XX:\+ExitOnOutOfMemoryError})
148 | }
149 | end
150 |
151 | context 'with db_agent_name set' do
152 | let :params do
153 | required_parameters.merge(
154 | db_agent_name: 'someagentname'
155 | )
156 | end
157 |
158 | it {
159 | expect(subject).to contain_systemd__unit_file('appd_db_agent.service').
160 | with_content(%r{^ExecStart=/usr/lib/jvm/java/jre/bin/java -Ddbagent\.name=someagentname -Xms256m -Xmx256m -jar /opt/appdynamics/dbagent/db-agent\.jar -XX:\+ExitOnOutOfMemoryError})
161 | }
162 | end
163 |
164 | context 'with java_heap_size set' do
165 | let :params do
166 | required_parameters.merge(
167 | java_heap_size: '1G'
168 | )
169 | end
170 |
171 | it {
172 | expect(subject).to contain_systemd__unit_file('appd_db_agent.service').
173 | with_content(%r{^ExecStart=/usr/lib/jvm/java/jre/bin/java -Xms1G -Xmx1G -jar /opt/appdynamics/dbagent/db-agent\.jar -XX:\+ExitOnOutOfMemoryError})
174 | }
175 | end
176 |
177 | context 'with all parameters set' do
178 | let :params do
179 | required_parameters.merge(
180 | proxy_host: 'squid.example.com',
181 | proxy_port: 3128,
182 | db_agent_name: 'someagentname',
183 | java_heap_size: '1G'
184 | )
185 | end
186 |
187 | it {
188 | expect(subject).to contain_systemd__unit_file('appd_db_agent.service').
189 | with_content(%r{^ExecStart=/usr/lib/jvm/java/jre/bin/java -Dappdynamics\.http\.proxyHost=squid\.example\.com -Dappdynamics\.http\.proxyPort=3128 -Ddbagent\.name=someagentname -Xms1G -Xmx1G -jar /opt/appdynamics/dbagent/db-agent\.jar -XX:\+ExitOnOutOfMemoryError})
190 | }
191 | end
192 | end
193 | end
194 | end
195 | end
196 | end
197 | end
198 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------