From 71069ed3ddadc5591b9e10944d56cc4a6ddd4f5e Mon Sep 17 00:00:00 2001 From: "john.puskar" Date: Fri, 2 Jun 2017 22:14:25 -0400 Subject: [PATCH] Initial commit. --- .fixtures.yml | 7 + .gitignore | 6 + Gemfile | 41 + Gemfile.lock | 397 ++++++ README.md | 54 + Rakefile | 12 + Vagrantfile | 38 + manifests/cm_db/db2.pp | 36 + manifests/config.pp | 124 ++ manifests/init.pp | 52 + manifests/install/main.pp | 92 ++ manifests/install/prep.pp | 35 + manifests/install/prereqs.pp | 27 + manifests/install/service.pp | 18 + metadata.json | 16 + spec/classes/init_spec.rb | 42 + spec/spec_helper.rb | 2 + templates/cognos.service.erb | 25 + templates/cognos11_config.xml.erb | 1896 ++++++++++++++++++++++++++++ templates/cognos_11.rsp.erb | 8 + templates/create_cognos_db.sql.erb | 44 + tests/init.pp | 12 + 22 files changed, 2984 insertions(+) create mode 100644 .fixtures.yml create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 README.md create mode 100644 Rakefile create mode 100644 Vagrantfile create mode 100644 manifests/cm_db/db2.pp create mode 100644 manifests/config.pp create mode 100644 manifests/init.pp create mode 100644 manifests/install/main.pp create mode 100644 manifests/install/prep.pp create mode 100644 manifests/install/prereqs.pp create mode 100644 manifests/install/service.pp create mode 100644 metadata.json create mode 100644 spec/classes/init_spec.rb create mode 100644 spec/spec_helper.rb create mode 100644 templates/cognos.service.erb create mode 100644 templates/cognos11_config.xml.erb create mode 100644 templates/cognos_11.rsp.erb create mode 100644 templates/create_cognos_db.sql.erb create mode 100644 tests/init.pp diff --git a/.fixtures.yml b/.fixtures.yml new file mode 100644 index 0000000..c269a20 --- /dev/null +++ b/.fixtures.yml @@ -0,0 +1,7 @@ +# ref: https://github.com/puppetlabs/puppetlabs_spec_helper#fixtures-examples +# the symlinks are relative to the fixtures directory, hence all the '..' +fixtures: + repositories: + stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib" + firewalld: "git://github.com/crayfishx/puppet-firewalld" + #db2: "git://github.com/jpuskar/puppet-db2" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..51af1ec --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# Created by .ignore support plugin (hsz.mobi) +.idea/ +.vagrant/ +vagrant/ +custom +cognos_11_installer.properties \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..42ff184 --- /dev/null +++ b/Gemfile @@ -0,0 +1,41 @@ +source 'https://rubygems.org' + +# NOTE: Relying on the controlrepo gem in jenkins will end up with over 100 gems +# installed as dependencies. When running in CI, this can be unnecessarily time +# consuming, especially if only RSpec tests are being exercised. Consuder using +# the controlrepo gem when integration and system level tests are exericsed, but +# for now I recommend only using it in development, not when testing in CI. + +group :development do + # controlrepo is a helper tool to setup spec and integration testing inside of a + # Puppet control repository. We're not using the rake rakes, but instead + # directly invoking `rspec spec` in an effort to cut down on the amount of + # implicit, magic behavior. The controlrepo gem provides value in the form of + # an updated set of depenencies suitable for spec testing using rspec-puppet. + # + # https://github.com/jeffmccune/controlrepo_gem + gem 'controlrepo' + # Interactive debugger and REPL breakpoint tool + # See http://pryrepl.org/ + gem 'pry' + gem 'pry-stack_explorer' +end + +group :test, :development do + gem 'puppet', '4.9.4' + # should be 3.7.2 but not available on rubygems + gem 'facter' + gem 'hiera', '3.3.1' + gem 'hiera-eyaml', '2.1.0' + gem 'parallel_tests' + + # other testing gems we want + gem 'rspec-puppet' + gem 'puppetlabs_spec_helper' + gem 'rake-notes' + + # pinning specific versions + gem 'puppet-lint', '~> 2.1' + +end + diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..748e18c --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,397 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (2.3.5) + addressable (2.5.1) + public_suffix (~> 2.0, >= 2.0.2) + aws-sdk-v1 (1.67.0) + json (~> 1.4) + nokogiri (~> 1) + beaker (3.17.0) + aws-sdk-v1 (~> 1.57) + beaker-hiera (~> 0.0) + beaker-hostgenerator + docker-api + fission (~> 0.4) + fog (~> 1.38) + google-api-client (~> 0.9) + hocon (~> 1.0) + in-parallel (~> 0.1) + inifile (~> 3.0) + minitar (~> 0.5.4) + minitest (~> 5.4) + net-scp (~> 1.2) + net-ssh (~> 4.0) + open_uri_redirections (~> 0.2.1) + rbvmomi (~> 1.9) + rsync (~> 1.0.9) + stringify-hash (~> 0.0) + thor (~> 0.19) + unf (~> 0.1) + beaker-hiera (0.1.1) + stringify-hash (~> 0.0.0) + beaker-hostgenerator (0.8.4) + deep_merge (~> 1.0) + stringify-hash (~> 0.0.0) + beaker-rspec (6.1.0) + beaker (~> 3.0) + rspec (~> 3.0) + serverspec (~> 2) + specinfra (~> 2) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) + builder (3.2.3) + coderay (1.1.1) + colored (1.2) + controlrepo (2.0.10) + beaker-rspec + bundler + git + json (>= 1.8.2) + puppet + puppetlabs_spec_helper (>= 0.4.0) + r10k (>= 2.1.0) + rake (>= 10.0.0) + rspec (>= 3.0.0) + rspec-puppet + cri (2.6.1) + colored (~> 1.2) + debug_inspector (0.0.3) + declarative (0.0.9) + declarative-option (0.1.0) + deep_merge (1.1.1) + diff-lcs (1.3) + docker-api (1.33.4) + excon (>= 0.38.0) + json + excon (0.56.0) + facter (3.6.4) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + faraday_middleware (0.10.1) + faraday (>= 0.7.4, < 1.0) + fast_gettext (1.1.0) + fission (0.5.0) + CFPropertyList (~> 2.2) + fog (1.40.0) + fog-aliyun (>= 0.1.0) + fog-atmos + fog-aws (>= 0.6.0) + fog-brightbox (~> 0.4) + fog-cloudatcost (~> 0.1.0) + fog-core (~> 1.43) + fog-digitalocean (>= 0.3.0) + fog-dnsimple (~> 1.0) + fog-dynect (~> 0.0.2) + fog-ecloud (~> 0.1) + fog-google (<= 0.1.0) + fog-json + fog-local + fog-openstack + fog-powerdns (>= 0.1.1) + fog-profitbricks + fog-rackspace + fog-radosgw (>= 0.0.2) + fog-riakcs + fog-sakuracloud (>= 0.0.4) + fog-serverlove + fog-softlayer + fog-storm_on_demand + fog-terremark + fog-vmfusion + fog-voxel + fog-vsphere (>= 0.4.0) + fog-xenserver + fog-xml (~> 0.1.1) + ipaddress (~> 0.5) + json (>= 1.8, < 2.0) + fog-aliyun (0.1.0) + fog-core (~> 1.27) + fog-json (~> 1.0) + ipaddress (~> 0.8) + xml-simple (~> 1.1) + fog-atmos (0.1.0) + fog-core + fog-xml + fog-aws (1.3.0) + fog-core (~> 1.38) + fog-json (~> 1.0) + fog-xml (~> 0.1) + ipaddress (~> 0.8) + fog-brightbox (0.11.0) + fog-core (~> 1.22) + fog-json + inflecto (~> 0.0.2) + fog-cloudatcost (0.1.2) + fog-core (~> 1.36) + fog-json (~> 1.0) + fog-xml (~> 0.1) + ipaddress (~> 0.8) + fog-core (1.44.3) + builder + excon (~> 0.49) + formatador (~> 0.2) + fog-digitalocean (0.3.0) + fog-core (~> 1.42) + fog-json (>= 1.0) + fog-xml (>= 0.1) + ipaddress (>= 0.5) + fog-dnsimple (1.0.0) + fog-core (~> 1.38) + fog-json (~> 1.0) + fog-dynect (0.0.3) + fog-core + fog-json + fog-xml + fog-ecloud (0.3.0) + fog-core + fog-xml + fog-google (0.1.0) + fog-core + fog-json + fog-xml + fog-json (1.0.2) + fog-core (~> 1.0) + multi_json (~> 1.10) + fog-local (0.3.1) + fog-core (~> 1.27) + fog-openstack (0.1.21) + fog-core (>= 1.40) + fog-json (>= 1.0) + ipaddress (>= 0.8) + fog-powerdns (0.1.1) + fog-core (~> 1.27) + fog-json (~> 1.0) + fog-xml (~> 0.1) + fog-profitbricks (3.0.0) + fog-core (~> 1.42) + fog-json (~> 1.0) + fog-rackspace (0.1.5) + fog-core (>= 1.35) + fog-json (>= 1.0) + fog-xml (>= 0.1) + ipaddress (>= 0.8) + fog-radosgw (0.0.5) + fog-core (>= 1.21.0) + fog-json + fog-xml (>= 0.0.1) + fog-riakcs (0.1.0) + fog-core + fog-json + fog-xml + fog-sakuracloud (1.7.5) + fog-core + fog-json + fog-serverlove (0.1.2) + fog-core + fog-json + fog-softlayer (1.1.4) + fog-core + fog-json + fog-storm_on_demand (0.1.1) + fog-core + fog-json + fog-terremark (0.1.0) + fog-core + fog-xml + fog-vmfusion (0.1.0) + fission + fog-core + fog-voxel (0.1.0) + fog-core + fog-xml + fog-vsphere (1.10.0) + fog-core + rbvmomi (~> 1.9) + fog-xenserver (0.3.0) + fog-core + fog-xml + fog-xml (0.1.3) + fog-core + nokogiri (>= 1.5.11, < 2.0.0) + formatador (0.2.5) + gettext (3.2.2) + locale (>= 2.0.5) + text (>= 1.3.0) + gettext-setup (0.25) + fast_gettext (~> 1.1.0) + gettext (>= 3.0.2) + locale + git (1.3.0) + google-api-client (0.11.3) + addressable (>= 2.5.1) + googleauth (~> 0.5) + httpclient (>= 2.8.1, < 3.0) + mime-types (>= 3.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.0) + googleauth (0.5.1) + faraday (~> 0.9) + jwt (~> 1.4) + logging (~> 2.0) + memoist (~> 0.12) + multi_json (~> 1.11) + os (~> 0.9) + signet (~> 0.7) + hiera (3.3.1) + hiera-eyaml (2.1.0) + highline (~> 1.6.19) + trollop (~> 2.0) + highline (1.6.21) + hocon (1.2.5) + httpclient (2.8.3) + in-parallel (0.1.17) + inflecto (0.0.2) + inifile (3.0.0) + ipaddress (0.8.3) + json (1.8.6) + json_pure (1.8.6) + jwt (1.5.6) + little-plugger (1.1.4) + locale (2.1.2) + log4r (1.1.10) + logging (2.2.2) + little-plugger (~> 1.1) + multi_json (~> 1.10) + memoist (0.15.0) + metaclass (0.0.4) + method_source (0.8.2) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_portile2 (2.1.0) + minitar (0.5.4) + minitest (5.10.2) + mocha (1.2.1) + metaclass (~> 0.0.1) + multi_json (1.12.1) + multipart-post (2.0.0) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (4.1.0) + net-telnet (0.1.1) + nokogiri (1.7.2) + mini_portile2 (~> 2.1.0) + open_uri_redirections (0.2.1) + os (0.9.6) + parallel (1.11.2) + parallel_tests (2.14.1) + parallel + pry (0.10.4) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + pry-stack_explorer (0.4.9.2) + binding_of_caller (>= 0.7) + pry (>= 0.9.11) + public_suffix (2.0.5) + puppet (4.9.4) + facter (> 2.0, < 4) + gettext-setup (>= 0.10, < 1) + hiera (>= 2.0, < 4) + json_pure (~> 1.8) + locale (~> 2.1) + puppet-lint (2.2.1) + puppet-syntax (2.4.0) + rake + puppet_forge (2.2.4) + faraday (~> 0.9.0) + faraday_middleware (>= 0.9.0, < 0.11.0) + gettext-setup (~> 0.11) + minitar + semantic_puppet (~> 0.1.0) + puppetlabs_spec_helper (2.1.3) + mocha (~> 1.0) + puppet-lint (~> 2.0) + puppet-syntax (~> 2.0) + rspec-puppet (~> 2.0) + r10k (2.5.4) + colored (= 1.2) + cri (~> 2.6.1) + gettext-setup (~> 0.5) + log4r (= 1.1.10) + minitar (= 0.5.4) + multi_json (~> 1.10) + puppet_forge (~> 2.2) + semantic_puppet (~> 0.1.0) + rake (12.0.0) + rake-notes (0.2.0) + colored + rake + rbvmomi (1.11.2) + builder (~> 3.0) + json (>= 1.8) + nokogiri (~> 1.5) + trollop (~> 2.1) + representable (3.0.4) + declarative (< 0.1.0) + declarative-option (< 0.2.0) + uber (< 0.2.0) + retriable (3.0.2) + rspec (3.6.0) + rspec-core (~> 3.6.0) + rspec-expectations (~> 3.6.0) + rspec-mocks (~> 3.6.0) + rspec-core (3.6.0) + rspec-support (~> 3.6.0) + rspec-expectations (3.6.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.6.0) + rspec-its (1.2.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.6.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.6.0) + rspec-puppet (2.5.0) + rspec + rspec-support (3.6.0) + rsync (1.0.9) + semantic_puppet (0.1.4) + gettext-setup (>= 0.3) + serverspec (2.39.1) + multi_json + rspec (~> 3.0) + rspec-its + specinfra (~> 2.68) + sfl (2.3) + signet (0.7.3) + addressable (~> 2.3) + faraday (~> 0.9) + jwt (~> 1.5) + multi_json (~> 1.10) + slop (3.6.0) + specinfra (2.68.0) + net-scp + net-ssh (>= 2.7, < 5.0) + net-telnet + sfl + stringify-hash (0.0.2) + text (1.3.1) + thor (0.19.4) + trollop (2.1.2) + uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.4) + xml-simple (1.1.5) + +PLATFORMS + ruby + +DEPENDENCIES + controlrepo + facter + hiera (= 3.3.1) + hiera-eyaml (= 2.1.0) + parallel_tests + pry + pry-stack_explorer + puppet (= 4.9.4) + puppet-lint (~> 2.1) + puppetlabs_spec_helper + rake-notes + rspec-puppet + +BUNDLED WITH + 1.14.6 diff --git a/README.md b/README.md new file mode 100644 index 0000000..5d5629f --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# cognos + +#### Table of Contents + +1. [Description](#description) +1. [Setup - The basics of getting started with cognos](#setup) + * [Setup requirements](#setup-requirements) +1. [Usage - Configuration options and additional functionality](#usage) +1. [Reference - An under-the-hood peek at what the module is doing and how](#reference) +1. [Limitations - OS compatibility, etc.](#limitations) +1. [Development - Guide for contributing to the module](#development) + +## Description + +This module installs and configures a basic cognos server using db2. + +## Setup + +### Setup Requirements + +The cognos and db2 v10.1 install binaries must be pre-staged, and the parameter named 'installer_source_dir' configured. + +## Usage +The param 'installer_source_dir' expects to find the folder ./exp. +For example, if "/root" is specified, than this should exist: "/root/exp/db2" + + +```puppet +class {'cognos': + cognos_user_password => 'mypass', + cognos_db_user_password => 'mypass', + cog_users_password_salt => 'random phrase', + installer_source_dir => '/root', + installer_filename => 'ca_srv_lnxi38664_11.0.5.16111917.bin', +} +``` +## Reference + +Please see the individual manifest files for additional parameters. + +## Limitations + +This module has only been tested with Cognos 11.0.5 using DB2 Express V10.1 on Centos 7.3. + +In addition, it currently does not support: ++ Content Managers other than DB2 running on localhost. ++ Multiple servers / tires. ++ Authentication providers of any kind. +## Development + +This module includes a Vagrantfile for easy testing. Just install vagrant and virtualbox, clone this repo, and 'vagrant up'. + +To stage the DB2 media, make a folder in the repo root called "vagrant", and ensure that the folder structure looks like: "./puppet-cognos/vagrant/exp/db2". +The cognos installer file must also reside in "./puppet-cognos/vagrant". diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..b549d7d --- /dev/null +++ b/Rakefile @@ -0,0 +1,12 @@ +require 'rubygems' +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] + +# Forsake support for Puppet 2.6.2 for the benefit of cleaner code. +# http://puppet-lint.com/checks/class_inherits_from_params_class/ +PuppetLint.configuration.send('disable_class_inherits_from_params_class') + +desc "Run all tests" +task :test => [:lint, :validate, :spec] diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..d787ef4 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,38 @@ +# -*- mode: ruby -*- + +Vagrant.configure("2") do |config| + # Every Vagrant virtual environment requires a box to build off of. + config.vm.box = "puppetlabs/centos-7.2-64-puppet" + + # Assign this VM to a host-only network IP, allowing you to access it + # via the IP. + config.vm.provider 'virtualbox' do |vb| + vb.customize ["modifyvm", :id, "--natnet1", "172.31.9/24"] + vb.gui = false + vb.memory = 6144 + vb.customize ["modifyvm", :id, "--ioapic", "on"] + vb.customize ["modifyvm", :id, "--hpet", "on"] + end + + # Second network interface, vm's will all exist on this network + ip = "192.168.44.35" + config.vm.network :private_network, ip: ip + config.vm.network :forwarded_port, guest: 9300, host: 9393 + + $script = <