From 300d5f678033ccfde9f1c7a9e6b996b0f562936d Mon Sep 17 00:00:00 2001 From: Sanskar Bhushan Date: Thu, 26 Feb 2026 13:45:05 +0530 Subject: [PATCH] Adding haproxy support to openvas Signed-off-by: Sanskar Bhushan --- modules/Puppetfile | 4 +- modules/enableit/borgbackup/metadata.json | 2 +- .../common/data/subscriptions/bronze.yaml | 4 +- .../enableit/eit_haproxy/manifests/init.pp | 25 +- modules/enableit/functions/metadata.json | 3 +- modules/enableit/netbackup/metadata.json | 2 +- modules/enableit/nfs/metadata.json | 4 +- modules/enableit/profile/manifests/openvox.pp | 1 - modules/enableit/profile/manifests/redmine.pp | 56 --- .../profile/manifests/scanner/openvas.pp | 114 +++--- .../virtualization/docker/cadvisor.pp | 2 +- modules/enableit/profile/metadata.json | 4 +- .../scanner/openvas/docker-compose.yaml.epp | 4 +- modules/enableit/redmine/.fixtures.yml | 12 - modules/enableit/redmine/.gitignore | 11 - modules/enableit/redmine/.kitchen.yml | 20 - modules/enableit/redmine/.travis.yml | 19 - modules/enableit/redmine/CHANGELOG.md | 101 ----- modules/enableit/redmine/CONTRIBUTING.md | 8 - modules/enableit/redmine/Gemfile | 21 -- modules/enableit/redmine/LICENSE | 13 - modules/enableit/redmine/Puppetfile | 25 -- modules/enableit/redmine/README.md | 254 ------------- modules/enableit/redmine/Rakefile | 18 - modules/enableit/redmine/data/common.yaml | 3 - .../redmine/data/os/Ubuntu-12.04.yaml | 2 - modules/enableit/redmine/hiera.yaml | 9 - modules/enableit/redmine/manifests/config.pp | 80 ---- .../enableit/redmine/manifests/database.pp | 12 - .../redmine/manifests/database_mysql.pp | 29 -- .../redmine/manifests/database_psql.pp | 11 - .../enableit/redmine/manifests/download.pp | 39 -- .../enableit/redmine/manifests/easyredmine.pp | 13 - modules/enableit/redmine/manifests/init.pp | 162 -------- modules/enableit/redmine/manifests/install.pp | 58 --- modules/enableit/redmine/manifests/params.pp | 58 --- modules/enableit/redmine/manifests/plugin.pp | 68 ---- modules/enableit/redmine/manifests/rake.pp | 39 -- .../enableit/redmine/manifests/test_site.pp | 6 - modules/enableit/redmine/metadata.json | 37 -- .../spec/classes/redmine/redmine_spec.rb | 345 ------------------ .../spec/defines/redmine_plugin_spec.rb | 73 ---- modules/enableit/redmine/spec/spec_helper.rb | 1 - .../redmine/templates/configuration.yml.erb | 15 - .../redmine/templates/database.yml.erb | 15 - .../redmine/templates/redmine-logrotate.erb | 13 - .../default/serverspec/redmine_spec.rb | 30 -- .../data/role/role::scanner::openvas.yaml | 4 + .../role/manifests/scanner/openvas.pp | 111 +----- .../enableit/role/manifests/web/haproxy.pp | 3 +- modules/enableit/stunnel/metadata.json | 2 +- modules/upstream/curator/metadata.json | 2 +- modules/upstream/mit_krb5/metadata.json | 2 +- modules/upstream/pam_access/metadata.json | 2 +- modules/upstream/perforce/metadata.json | 2 +- modules/upstream/rngd/metadata.json | 2 +- modules/upstream/ruby/metadata.json | 2 +- modules/upstream/zfs/metadata.json | 2 +- 58 files changed, 92 insertions(+), 1887 deletions(-) delete mode 100644 modules/enableit/profile/manifests/redmine.pp delete mode 100644 modules/enableit/redmine/.fixtures.yml delete mode 100644 modules/enableit/redmine/.gitignore delete mode 100644 modules/enableit/redmine/.kitchen.yml delete mode 100644 modules/enableit/redmine/.travis.yml delete mode 100644 modules/enableit/redmine/CHANGELOG.md delete mode 100644 modules/enableit/redmine/CONTRIBUTING.md delete mode 100644 modules/enableit/redmine/Gemfile delete mode 100644 modules/enableit/redmine/LICENSE delete mode 100644 modules/enableit/redmine/Puppetfile delete mode 100644 modules/enableit/redmine/README.md delete mode 100644 modules/enableit/redmine/Rakefile delete mode 100644 modules/enableit/redmine/data/common.yaml delete mode 100644 modules/enableit/redmine/data/os/Ubuntu-12.04.yaml delete mode 100644 modules/enableit/redmine/hiera.yaml delete mode 100644 modules/enableit/redmine/manifests/config.pp delete mode 100644 modules/enableit/redmine/manifests/database.pp delete mode 100644 modules/enableit/redmine/manifests/database_mysql.pp delete mode 100644 modules/enableit/redmine/manifests/database_psql.pp delete mode 100644 modules/enableit/redmine/manifests/download.pp delete mode 100644 modules/enableit/redmine/manifests/easyredmine.pp delete mode 100644 modules/enableit/redmine/manifests/init.pp delete mode 100644 modules/enableit/redmine/manifests/install.pp delete mode 100644 modules/enableit/redmine/manifests/params.pp delete mode 100644 modules/enableit/redmine/manifests/plugin.pp delete mode 100644 modules/enableit/redmine/manifests/rake.pp delete mode 100644 modules/enableit/redmine/manifests/test_site.pp delete mode 100644 modules/enableit/redmine/metadata.json delete mode 100644 modules/enableit/redmine/spec/classes/redmine/redmine_spec.rb delete mode 100644 modules/enableit/redmine/spec/defines/redmine_plugin_spec.rb delete mode 100644 modules/enableit/redmine/spec/spec_helper.rb delete mode 100644 modules/enableit/redmine/templates/configuration.yml.erb delete mode 100644 modules/enableit/redmine/templates/database.yml.erb delete mode 100644 modules/enableit/redmine/templates/redmine-logrotate.erb delete mode 100644 modules/enableit/redmine/test/integration/default/serverspec/redmine_spec.rb create mode 100644 modules/enableit/role/data/role/role::scanner::openvas.yaml diff --git a/modules/Puppetfile b/modules/Puppetfile index cceaed33..347d80d5 100644 --- a/modules/Puppetfile +++ b/modules/Puppetfile @@ -192,7 +192,7 @@ mod 'maestrodev/wget', mod 'biemond/wildfly', :git => 'https://github.com/biemond/biemond-wildfly.git', - :ref => 'v.2.0.0' + :ref => 'v4.0.0' mod 'hunner/wordpress', :git => 'https://github.com/hunner/puppet-wordpress.git', @@ -310,6 +310,8 @@ mod 'bodgit/zfs', :git => 'https://github.com/bodgit/puppet-zfs.git', :ref => 'v3.0.0' +mod 'cirrax-borgbackup', '1.8.1' + mod 'deric/beegfs', :git => 'https://github.com/deric/puppet-beegfs.git', :ref => 'v1.0.0' diff --git a/modules/enableit/borgbackup/metadata.json b/modules/enableit/borgbackup/metadata.json index a005f69e..45e0c9e4 100644 --- a/modules/enableit/borgbackup/metadata.json +++ b/modules/enableit/borgbackup/metadata.json @@ -33,7 +33,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">= 3.2.0 < 5.0.0" + "version_requirement": ">= 3.2.0 < 10.0.0" }, { "name": "puppetlabs/concat", diff --git a/modules/enableit/common/data/subscriptions/bronze.yaml b/modules/enableit/common/data/subscriptions/bronze.yaml index 63ed8d15..e46a5bd7 100644 --- a/modules/enableit/common/data/subscriptions/bronze.yaml +++ b/modules/enableit/common/data/subscriptions/bronze.yaml @@ -11,6 +11,6 @@ common::system::updates::noop_value: false common::setup::obmondo_admin::manage: true common::setup::obmondo_admin::enable: true -common::setup::obmondo_admin::noop_value: false -common::monitor::noop_value: false +common::setup::obmondo_admin::noop_value: true +common::monitor:noop_value: false common::openvox::noop_value: false diff --git a/modules/enableit/eit_haproxy/manifests/init.pp b/modules/enableit/eit_haproxy/manifests/init.pp index c75d0ec7..21d8d075 100644 --- a/modules/enableit/eit_haproxy/manifests/init.pp +++ b/modules/enableit/eit_haproxy/manifests/init.pp @@ -38,19 +38,20 @@ } if $configure == 'auto' { - # NOTE: Needed this, we install our own haproxy 2.9 on centos7 - if versioncmp($facts.dig('haproxy_version'), '2.5.0') >= 0 { - $_service = @(EOT) - [Service] - ExecStartPre= - ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q - | EOT + if $facts['packages']['haproxy'] { + if versioncmp($facts['packages']['haproxy']['version'], '2.5.0') >= 0 { + $_service = @(EOT) + [Service] + ExecStartPre= + ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q + | EOT - systemd::dropin_file { 'haproxy_dropin': - filename => 'haproxy-override.conf', - unit => 'haproxy.service', - content => $_service, - notify => Service['haproxy'], + systemd::dropin_file { 'haproxy_dropin': + filename => 'haproxy-override.conf', + unit => 'haproxy.service', + content => $_service, + require => Package['haproxy'], + } } } diff --git a/modules/enableit/functions/metadata.json b/modules/enableit/functions/metadata.json index fd0c21d2..546fef1e 100644 --- a/modules/enableit/functions/metadata.json +++ b/modules/enableit/functions/metadata.json @@ -36,7 +36,8 @@ "operatingsystemrelease": [ "12.04", "14.04", - "16.04" + "16.04", + "24.04" ] } ] diff --git a/modules/enableit/netbackup/metadata.json b/modules/enableit/netbackup/metadata.json index b64f9ee2..cf1cfc36 100644 --- a/modules/enableit/netbackup/metadata.json +++ b/modules/enableit/netbackup/metadata.json @@ -9,7 +9,7 @@ "issues_url": "https://github.com/andskli/puppet-netbackup/issues", "tags": ["netbackup", "backup"], "dependencies": [ - {"name":"puppetlabs-stdlib","version_requirement":">= 4.7.0 < 6.0.0"}, + {"name":"puppetlabs-stdlib","version_requirement":">= 4.7.0 < 10.0.0"}, {"name":"saz/limits","version_requirement":">= 2.1.0 < 4.0.0"}, {"name":"thias/sysctl","version_requirement":">= 1.0.0 < 3.0.0"}, {"name":"spiette/selinux","version_requirement":">= 0.5.4 < 2.0.0"} diff --git a/modules/enableit/nfs/metadata.json b/modules/enableit/nfs/metadata.json index b19c2f62..af2d1849 100644 --- a/modules/enableit/nfs/metadata.json +++ b/modules/enableit/nfs/metadata.json @@ -1,6 +1,6 @@ { "name": "enableit-nfs", - "version": "0.3.0", + "version": "0.3.1", "author": "EnableIT", "summary": "NFS Client and Server", "license": "Apache-2.0", @@ -48,7 +48,7 @@ }, { "name": "puppetlabs/stdlib", - "version_requirement": "4.x.x" + "version_requirement": "10.x.x" }, { "name": "enableit/eit_types" diff --git a/modules/enableit/profile/manifests/openvox.pp b/modules/enableit/profile/manifests/openvox.pp index f71fe820..ba5ab20b 100644 --- a/modules/enableit/profile/manifests/openvox.pp +++ b/modules/enableit/profile/manifests/openvox.pp @@ -215,7 +215,6 @@ } $facts_blocklist = [ - 'packages', 'kmods', 'network_ports', 'login_defs', diff --git a/modules/enableit/profile/manifests/redmine.pp b/modules/enableit/profile/manifests/redmine.pp deleted file mode 100644 index 36e691c9..00000000 --- a/modules/enableit/profile/manifests/redmine.pp +++ /dev/null @@ -1,56 +0,0 @@ -# Redmine profile -class profile::redmine ( - $servername, - $serveralias = undef, - Enum['mysql2','postgresql'] $db = 'mysql2', - Boolean $setupdb = true, -) { - - $passenger_version = $facts['os']['release']['major'] ? { - 6 => 4, - default => 5, - } - - class { '::profile::web::apache': - http => true, - https => false, - vhosts => {}, - modules => [], - ciphers => 'default', - } - - -> class { '::passenger': - passenger_version => $passenger_version, - } - - if $setupdb { - case $db { - 'mysql2': { - class { '::profile::mysql' : - webadmin => false, - } - } - 'postgresql': { - class { 'profile::db::pgsql': - listen_address => '127.0.0.1', - max_connections => 300, - allow_remote_hosts => [], - } - } - default: { - fail("Unknown db argument given: ${db}.") - } - } - } - - class { '::redmine': - version => '3.3.0', - database_adapter => $db, - } - - apache::vhost { $servername: - port => '80', - docroot => '/var/www/html/redmine/public', - serveraliases => $serveralias, - } -} diff --git a/modules/enableit/profile/manifests/scanner/openvas.pp b/modules/enableit/profile/manifests/scanner/openvas.pp index af246fa2..5599191e 100644 --- a/modules/enableit/profile/manifests/scanner/openvas.pp +++ b/modules/enableit/profile/manifests/scanner/openvas.pp @@ -1,93 +1,61 @@ +# @summary Profile for managing the OpenVAS scanner +# +# @param install Whether to install the scanner. Inherited from the role role::scanner::openvas. +# class profile::scanner::openvas ( - Stdlib::Absolutepath $install_dir = $role::scanner::openvas::install_dir, Boolean $install = $role::scanner::openvas::install, - Stdlib::Host $web_bind_address = $role::scanner::openvas::web_bind_address, - Stdlib::Port $web_port = $role::scanner::openvas::web_port, - Enum['service_notus'] $openvasd_mode = $role::scanner::openvas::openvasd_mode, - Eit_types::Addressport $openvasd_addressport = $role::scanner::openvas::openvasd_addressport, - Stdlib::Absolutepath $storage_path = $role::scanner::openvas::storage_path, - String $registry = $role::scanner::openvas::registry, - Eit_types::Version $vulnerability_tests_version = $role::scanner::openvas::vulnerability_tests_version, - Eit_types::Version $notus_data_version = $role::scanner::openvas::notus_data_version, - Eit_types::Version $scap_data_version = $role::scanner::openvas::scap_data_version, - Eit_types::Version $cert_bund_data_version = $role::scanner::openvas::cert_bund_data_version, - Eit_types::Version $dfn_cert_data_version = $role::scanner::openvas::dfn_cert_data_version, - Eit_types::Version $data_objects_version = $role::scanner::openvas::data_objects_version, - Eit_types::Version $report_formats_version = $role::scanner::openvas::report_formats_version, - Eit_types::Version $gpg_data_version = $role::scanner::openvas::gpg_data_version, - Eit_types::Version $redis_server_version = $role::scanner::openvas::redis_server_version, - Eit_types::Version $pg_gvm_version = $role::scanner::openvas::pg_gvm_version, - Eit_types::Version $gsa_version = $role::scanner::openvas::gsa_version, - Eit_types::Version $gvmd_version = $role::scanner::openvas::gvmd_version, - Eit_types::Version $openvas_scanner_version = $role::scanner::openvas::openvas_scanner_version, - Eit_types::Version $ospd_openvas_version = $role::scanner::openvas::ospd_openvas_version, - Eit_types::Version $gvm_tools_version = $role::scanner::openvas::gvm_tools_version, - Eit_types::Version $feed_release_version = $role::scanner::openvas::feed_release_version, - Stdlib::Absolutepath $data_mount_path = $role::scanner::openvas::data_mount_path, - Stdlib::Absolutepath $gvm_data_path = $role::scanner::openvas::gvm_data_path, - Stdlib::Absolutepath $openvas_plugins_path = $role::scanner::openvas::openvas_plugins_path, - Stdlib::Absolutepath $redis_socket_path = $role::scanner::openvas::redis_socket_path, - Stdlib::Absolutepath $gvmd_socket_path = $role::scanner::openvas::gvmd_socket_path, - Stdlib::Absolutepath $ospd_socket_path = $role::scanner::openvas::ospd_socket_path, - Stdlib::Absolutepath $psql_data_path = $role::scanner::openvas::psql_data_path, - Stdlib::Absolutepath $psql_socket_path = $role::scanner::openvas::psql_socket_path, - Stdlib::Absolutepath $openvas_config_path = $role::scanner::openvas::openvas_config_path, - Stdlib::Absolutepath $openvas_log_path = $role::scanner::openvas::openvas_log_path, - Stdlib::Absolutepath $notus_path = $role::scanner::openvas::notus_path, ) { - file { $install_dir: + file { '/opt/obmondo/docker-compose/openvas': ensure => ensure_dir($install), owner => 'root', group => 'root', mode => '0755', } - file { "${install_dir}/docker-compose.yml": + file { '/opt/obmondo/docker-compose/openvas/docker-compose.yml': ensure => ensure_present($install), owner => 'root', group => 'root', mode => '0644', content => epp('profile/scanner/openvas/docker-compose.yaml.epp', { - web_bind_address => $web_bind_address, - web_port => $web_port, - openvasd_mode => $openvasd_mode, - openvasd_addressport => $openvasd_addressport, - storage_path => $storage_path, - registry => $registry, - vulnerability_tests_version => $vulnerability_tests_version, - notus_data_version => $notus_data_version, - scap_data_version => $scap_data_version, - cert_bund_data_version => $cert_bund_data_version, - dfn_cert_data_version => $dfn_cert_data_version, - data_objects_version => $data_objects_version, - report_formats_version => $report_formats_version, - gpg_data_version => $gpg_data_version, - redis_server_version => $redis_server_version, - pg_gvm_version => $pg_gvm_version, - gsa_version => $gsa_version, - gvmd_version => $gvmd_version, - openvas_scanner_version => $openvas_scanner_version, - ospd_openvas_version => $ospd_openvas_version, - gvm_tools_version => $gvm_tools_version, - feed_release_version => $feed_release_version, - data_mount_path => $data_mount_path, - gvm_data_path => $gvm_data_path, - openvas_plugins_path => $openvas_plugins_path, - redis_socket_path => $redis_socket_path, - gvmd_socket_path => $gvmd_socket_path, - ospd_socket_path => $ospd_socket_path, - psql_data_path => $psql_data_path, - psql_socket_path => $psql_socket_path, - openvas_config_path => $openvas_config_path, - openvas_log_path => $openvas_log_path, - notus_path => $notus_path, + web_addressport => '0.0.0.0:9392', + openvasd_mode => 'service_notus', + storage_path => '/var/lib/openvas/22.04/vt-data/nasl', + registry => 'registry.community.greenbone.net/community', + vulnerability_tests_version => '202502250742', + notus_data_version => '202502250410', + scap_data_version => '202502240506', + cert_bund_data_version => '202502250409', + dfn_cert_data_version => '202502250401', + data_objects_version => '202502250505', + report_formats_version => '202502250500', + gpg_data_version => '1.1.0', + redis_server_version => '1.1.0', + pg_gvm_version => '22.6.7', + gsa_version => '24.3.0', + gvmd_version => '25', + openvas_scanner_version => '23.15.4', + ospd_openvas_version => '22.8.0', + gvm_tools_version => '25', + feed_release_version => '24.10', + data_mount_path => '/mnt', + gvm_data_path => '/var/lib/gvm', + openvas_plugins_path => '/var/lib/openvas/plugins', + redis_socket_path => '/run/redis', + gvmd_socket_path => '/run/gvmd', + ospd_socket_path => '/run/ospd', + psql_data_path => '/var/lib/postgresql', + psql_socket_path => '/var/run/postgresql', + openvas_config_path => '/etc/openvas', + openvas_log_path => '/var/log/openvas', + notus_path => '/var/lib/notus', }), - require => File[$install_dir], + require => File['/opt/obmondo/docker-compose/openvas'], } firewall_multi { '000 allow openvas web interface': ensure => ensure_present($install), - dport => [$web_port], + dport => 443, proto => 'tcp', jump => 'accept', } @@ -95,8 +63,8 @@ docker_compose { 'openvas': ensure => ensure_present($install), compose_files => [ - "${install_dir}/docker-compose.yml", + '/opt/obmondo/docker-compose/openvas/docker-compose.yml', ], - require => File["${install_dir}/docker-compose.yml"], + require => File['/opt/obmondo/docker-compose/openvas/docker-compose.yml'], } } diff --git a/modules/enableit/profile/manifests/virtualization/docker/cadvisor.pp b/modules/enableit/profile/manifests/virtualization/docker/cadvisor.pp index b2cf1f1a..7eae562c 100644 --- a/modules/enableit/profile/manifests/virtualization/docker/cadvisor.pp +++ b/modules/enableit/profile/manifests/virtualization/docker/cadvisor.pp @@ -4,7 +4,7 @@ Eit_types::Noop_Value $noop_value = undef, Stdlib::Port $listen_port = 63392, String $cadvisor_image = $role::virtualization::docker::cadvisor_image, -) inherits profile::virtualization::docker { +) { Exec { noop => $noop_value, diff --git a/modules/enableit/profile/metadata.json b/modules/enableit/profile/metadata.json index 2a2bb5b9..13d33f9e 100644 --- a/modules/enableit/profile/metadata.json +++ b/modules/enableit/profile/metadata.json @@ -1,6 +1,6 @@ { "name": "enableit-profile", - "version": "0.1.0", + "version": "0.1.1", "author": "EnableIT ApS", "summary": "Obmondo profiles", "license": "Proprietary", @@ -16,7 +16,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">= 4.1.0" + "version_requirement": ">= 9.x.x" }, { "name": "enableit/eit_types" diff --git a/modules/enableit/profile/templates/scanner/openvas/docker-compose.yaml.epp b/modules/enableit/profile/templates/scanner/openvas/docker-compose.yaml.epp index ec8a3d64..e3e05bb5 100644 --- a/modules/enableit/profile/templates/scanner/openvas/docker-compose.yaml.epp +++ b/modules/enableit/profile/templates/scanner/openvas/docker-compose.yaml.epp @@ -95,7 +95,7 @@ services: image: <%= $registry %>/gsa:<%= $gsa_version %> restart: on-failure ports: - - <%= $web_bind_address %>:<%= $web_port %>:80 + - <%= $web_addressport %>:80 volumes: - gvmd_socket_vol:<%= $gvmd_socket_path %> depends_on: @@ -144,7 +144,7 @@ services: # if you want to utilize openvasd directly removed `OPENVASD_MODE` OPENVASD_MODE: <%= $openvasd_mode %> GNUPGHOME: <%= $openvas_config_path %>/gnupg - LISTENING: <%= $openvasd_addressport %> + LISTENING: 0.0.0.0:80 volumes: - openvas_data_vol:<%= $openvas_config_path %> - openvas_log_data_vol:<%= $openvas_log_path %> diff --git a/modules/enableit/redmine/.fixtures.yml b/modules/enableit/redmine/.fixtures.yml deleted file mode 100644 index 1f6896f6..00000000 --- a/modules/enableit/redmine/.fixtures.yml +++ /dev/null @@ -1,12 +0,0 @@ -fixtures: - repositories: - mysql: "git://github.com/puppetlabs/puppetlabs-mysql" - vcsrepo: "git://github.com/puppetlabs/puppetlabs-vcsrepo" - concat: - repo: "git://github.com/puppetlabs/puppetlabs-concat" - branch: "1.2.x" - apache: "git://github.com/puppetlabs/puppetlabs-apache" - stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib" - postgresql: "git://github.com/puppetlabs/puppetlabs-postgresql" - symlinks: - redmine: "#{source_dir}" diff --git a/modules/enableit/redmine/.gitignore b/modules/enableit/redmine/.gitignore deleted file mode 100644 index 66c133dc..00000000 --- a/modules/enableit/redmine/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -pkg/* -*.lock -spec/fixtures -*.swp -Vagrantfile -.vagrant -.tmp/ -modules/ -.bundle/ -.librarian/ -.kitchen/ diff --git a/modules/enableit/redmine/.kitchen.yml b/modules/enableit/redmine/.kitchen.yml deleted file mode 100644 index f636507d..00000000 --- a/modules/enableit/redmine/.kitchen.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -driver: - name: vagrant - -provisioner: - name: puppet_apply - manifests_path: manifests - modules_path: modules - hiera_data_path: hiera - -platforms: - - name: ubuntu-14.04 - - name: ubuntu-12.04 - - name: centos-6.6 - - name: debian-7.7 - -suites: - - name: default - provisioner: - manifest: test_site.pp diff --git a/modules/enableit/redmine/.travis.yml b/modules/enableit/redmine/.travis.yml deleted file mode 100644 index b91ac593..00000000 --- a/modules/enableit/redmine/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: ruby -before_install: - - gem update - - gem --version -bundler_args: --without development -script: "bundle exec rake test SPEC_OPTS='--format documentation'" -rvm: - - 1.8.7 - - 1.9.3 - - 2.0.0 - - 2.1.0 -env: - - PUPPET_GEM_VERSION="~> 3.4" - - PUPPET_GEM_VERSION="~> 3.5" - - PUPPET_GEM_VERSION="~> 3.6" - - PUPPET_GEM_VERSION="~> 3.7" -notifications: - email: - - johan@johan.org.uk diff --git a/modules/enableit/redmine/CHANGELOG.md b/modules/enableit/redmine/CHANGELOG.md deleted file mode 100644 index f662a191..00000000 --- a/modules/enableit/redmine/CHANGELOG.md +++ /dev/null @@ -1,101 +0,0 @@ -##2.3.0 -WARNING: With the next major version (3.0.0) we will up the default redmine version. -Check if you can upgrade to 2.6.x or explicitly set your version. -Now passenger starts redmine on apache start. This removes the delay the first -visitor experiences after a restart of the webserver. - -###Features -- Start a passenger worker for redmine when apache starts - -##2.2.0 - -###Notes -This version improves the experience for users who just want to get redmine working -out of the box without much configuration. -For those of you who already have a vhost set up and want to get redmine running in -a subdirectory, we have a new `www_subdir` setting. -Ubuntu 10.04 support has been dropped because it has been deemed too old. - -###Features -- Option to install redmine in a directory relative to the webroot -- CentOS support - -###Bugfixes -- Set the webroot correctly on non Redhat based systems -- Added note on requiring EPEL -- Log file rotation now uses the install dir and not the symlink - -##2.1.0 - -###Notes -You can now manage your redmine plugins with the newly added `redmine::plugin` type. All -standard actions such as installing, updating and removing are supported. -This release deprecates wget. It will be removed in the next major version. Please use a -version control system like git instead. - -###Features -- Deprecate wget provider -- Added support for plugins -- Ubuntu 14.04 (trusty) support - -###Bugfixes -- Specify gem versions for tests -- Fix unbound dependency versions -- Fixes to the wget provider -- Fix evaluation error in Puppet 4 - -##2.0.0 - -###Features -- Automaticially install the correct VCS provider -- Detect ruby version and set database adapter accordingly - -##1.2.1 - -###Features -- Improved Metadata quality - -##1.2.0 - -###Notes -This release fixes some dependency races that could occur because some requires where missing. -Additionally, postgresql can now be selected as the database adapter. - -###Features -- Postgresql support - -###Bugfixes -- Require all packages before doing install -- Fix MySQL dependency order - -##1.1.0 - -###Features -- Added debian support -- Custom configuration options -- Add ImageMagick to debian - -##1.0.1 - -###Bugfixes -- Fixed whitespace in documentation - -##1.0.0 - -###Notes -With rubyforge no longer available, the module now downloads redmine from the official repos -or from a user provided url. - -###Features -- Added VCS support -- Git is now the default provider -- Added download url to the options -- Added metadata.json -- Tests now include linting and syntax checking -- Run redmine updates -- Support for mariadb - -###Bugfixes -- Removed deletion of the default apache site -- Fix dependencies for debian -- Fix file permissions diff --git a/modules/enableit/redmine/CONTRIBUTING.md b/modules/enableit/redmine/CONTRIBUTING.md deleted file mode 100644 index ad8e9fe0..00000000 --- a/modules/enableit/redmine/CONTRIBUTING.md +++ /dev/null @@ -1,8 +0,0 @@ -Contributing ------------- - -Thank you for wanting to contribute. -If you have questions, feature requests, or want to file a bug, -feel free to open up an [issue](https://github.com/johanek/johanek-redmine/issues). -If you want to aid in the development and submit a pull request, please read our -[wiki](https://github.com/johanek/johanek-redmine/wiki) first. diff --git a/modules/enableit/redmine/Gemfile b/modules/enableit/redmine/Gemfile deleted file mode 100644 index 513d77c1..00000000 --- a/modules/enableit/redmine/Gemfile +++ /dev/null @@ -1,21 +0,0 @@ -source "http://rubygems.org" - -if ENV.key?('PUPPET_VERSION') - puppetversion = "= #{ENV['PUPPET_VERSION']}" -else - puppetversion = ['~> 3.1'] -end - -gem "rake" -gem "puppet", puppetversion -gem "puppet-lint", "1.1.0" -gem "rspec-puppet", "2.0.0" -gem "puppetlabs_spec_helper", "0.8.2" -gem "puppet-syntax", "1.4.1" - -if RUBY_VERSION >= '1.9' - gem 'test-kitchen' - gem 'librarian-puppet' - gem 'kitchen-puppet' - gem 'kitchen-vagrant' -end diff --git a/modules/enableit/redmine/LICENSE b/modules/enableit/redmine/LICENSE deleted file mode 100644 index 310cf008..00000000 --- a/modules/enableit/redmine/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (C) 2013-2015 Johan van den Dorpe and Contributors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/modules/enableit/redmine/Puppetfile b/modules/enableit/redmine/Puppetfile deleted file mode 100644 index 0a0e6480..00000000 --- a/modules/enableit/redmine/Puppetfile +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env ruby -#^syntax detection - -forge "https://forgeapi.puppetlabs.com" - -# use dependencies defined in metadata.json -metadata - -# use dependencies defined in Modulefile -# modulefile - -# A module from the Puppet Forge -mod 'stahnma-epel' - -# A module from git -# mod 'puppetlabs-ntp', -# :git => 'git://github.com/puppetlabs/puppetlabs-ntp.git' - -# A module from a git branch/tag -# mod 'puppetlabs-apt', -# :git => 'https://github.com/puppetlabs/puppetlabs-apt.git', -# :ref => '1.4.x' - -# A module from Github pre-packaged tarball -# mod 'puppetlabs-apache', '0.6.0', :github_tarball => 'puppetlabs/puppetlabs-apache' diff --git a/modules/enableit/redmine/README.md b/modules/enableit/redmine/README.md deleted file mode 100644 index 40d3d130..00000000 --- a/modules/enableit/redmine/README.md +++ /dev/null @@ -1,254 +0,0 @@ -johanek-redmine ---------------- - -[![Build Status](https://travis-ci.org/johanek/johanek-redmine.png?branch=master)](http://travis-ci.org/johanek/johanek-redmine) - -This module installs redmine, running behind apache and passenger, and backed by mysql, mariadb or postgresql - -Tested on CentOS 6.5, debian wheezy and Ubuntu 14.04 (Trusty) - -Requirements ------------- - -Required modules: -* puppetlabs-mysql 2.0 or later -* puppetlabs-stdlib -* puppetlabs-apache -* puppetlabs-concat -* puppetlabs-postgresql 3.3.0 or later - -Optional modules: -* puppetlabs-vcsrepo if you want to download redmine from a repository (the default) - -RedHat or CentOS: -* EPEL yum repository needs to be configured - -Example Usage -------------- - -To install the default version of redmine - -```puppet - class { 'apache': } - class { 'apache::mod::passenger': } - class { '::mysql::server': } - class { 'redmine': } -``` - -To install version 2.5.0 from the official svn repository - -```puppet - class { 'apache': } - class { 'apache::mod::passenger': } - class { '::mysql::server': } - class { 'redmine': - download_url => 'svn.redmine.org/redmine/tags/2.5.0', - provider => 'svn', - version => 'HEAD', - } -``` - -Install default redmine with a postgresql database - -```puppet - class { 'apache': } - class { 'apache::mod::passenger': } - class { '::postgresql::server': } - class { 'redmine': - database_adapter => 'postgresql', - } -``` - -Installing Plugins ------------------- - -Plugins can be installed and configured via the redmine::plugin resource. For example, a simple -plugin can be installed like this: - -```puppet - redmine::plugin { 'redmine_plugin' - source => 'git://example.com/redmine_plugin.git' - } -``` -Plugins can be installed via git (the default) or any other version control system. - -Bundle updates and database migrations will be handled automatically. You can update your plugin by -setting `ensure => latest` or directly specifying the version. More complex updates can be done by subscribing -to the plugin resource (via `subscribe => Redmine::Plugin['yourplugin']`) - -Uninstalling plugins can be done by simply setting `ensure => absent`. Again, database migration and -deletion are done for you. - - -Redmine Parameters ------------------- - -#####`version` - - Set to desired version. Default: 2.2.3 - -#####`download_url` - - Download URL for redmine tar.gz when using wget as the provider. The repository url otherwise. - When using wget, be sure to provide the full url. - Default: https://github.com/redmine/redmine - -#####`provider` - - The VCS provider or wget. - When setting the provider to wget, be sure to set download_url to a valid tar.gz archive. - To use the svn provider you have to provide the full url to the tag or branch you want to download and unset the version. - Default: git - -#####`database_server` - - Database server to use. Default: 'localhost' - If server is not on localhost, the database and user must be setup in advance. - -#####`database_user` - - Database user. Default: 'redmine' - -#####`database_password` - - Database user password. Default: 'redmine' - -#####`production_database` - - Name of database to use for production environment. Default: 'redmine' - -#####`development_database` - - Name of database to use for development environment. Default: 'redmine_development' - -#####`database_adapter` - - Database adapter to use for database configuration. - Can be either 'mysql' for ruby 1.8, 'mysql2' for ruby 1.9 or 'postgresql'. - Default: 'mysql' or 'mysql2' depending on your ruby version. - -#####`smtp_server` - - SMTP server to use. Default: 'localhost' - -#####`smtp_domain` - - Domain to send emails from. Default: $::domain - -#####`smtp_port` - - SMTP port to use. Default: 25 - -#####`smtp_authentication` - - Toggle SMTP authentication. Default: false - -#####`smtp_username` - - SMTP user name for authentication. Default: none - -#####`smtp_password` - - SMTP password for authentication. Default: none - -#####`vhost_aliases` - - Server aliases to use in the vhost config. Default 'redmine'. Expects a string. - -#####`vhost_servername` - - Server name to use in the vhost config. Default 'redmine'. Expects a string. - -#####`webroot` - - Directory in which redmine web files will be installed. Default: 'DOCROOT/redmine' - DOCROOT is the document root of your apache server, usually /var/www or /var/www/html - -#####`install_dir` - - Path where redmine will be installed - Default: '/usr/src/redmine' - -#####`override_options` - - Empty hash by default. Can be used to add additional options to the redmine configuration file. - Example: -```puppet -class { 'redmine': - default_override => {'foo' => 'bar', 'bar' => 'baz'}, -} -``` -This will generate a config that looks like this: -```yaml -default: - # default setting of the module - delivery_method: :smtp - smtp_settings: - address: localhost - port: 25 - domain: example.com - # user provided custom options - bar: baz - foo: bar -``` - Currently does not support nested options. - -#####`plugins` - - Optional hash of plugins to install, which are passed to redmine::plugin - -#####`www_subdir` - - Optional directory relative to the site webroot to install redmine in. - Undef by default. Expects a path string without leading slash. - When using this option the vhost config is your responsibility. - Example: -```puppet -apache::vhost { 'www.somesite.com': - priority => 20, - port => '80', - docroot => '/usr/src/sites/www.somesite.com/website', - servername => 'www.somesite.com', - serveraliases => ['somesite.com'], - directories => [ - { path => '/usr/src/sites/www.somesite.com/website', - }, - { path => '/usr/src/redmine', - options => 'FollowSymlinks ExecCGI', - custom_fragment => "PassengerAppRoot /var/www/html/redmine\n RailsBaseURI /redmine", - }, - ], - aliases => [ - { alias => '/redmine', - path => '/usr/src/redmine', - }, - ], -} -``` - -#####`create_vhost` - - Enable or disable vhost creation. - True by default. - When disabling this option the vhost config is your responsibility. - -Plugin Parameters ------------------- - -#####`ensure` - Wether the plugin should be installed. - Possible values are installed, latest, and absent. - -#####`source` - Repository of the plugin. Required - -#####`version` - Set to desired version. - -#####`provider` - The vcs provider. Default: git - -Contributing ------------- - -See the wiki for further information about contributing to this module: https://github.com/johanek/johanek-redmine/wiki diff --git a/modules/enableit/redmine/Rakefile b/modules/enableit/redmine/Rakefile deleted file mode 100644 index 0810f772..00000000 --- a/modules/enableit/redmine/Rakefile +++ /dev/null @@ -1,18 +0,0 @@ -require 'puppetlabs_spec_helper/rake_tasks' -require 'puppet-lint/tasks/puppet-lint' -require 'puppet-syntax/tasks/puppet-syntax' - -task :test => [:lint, :syntax, :spec] - -task :default => :test - -exclude_paths = [ - "pkg/**/*", - "vendor/**/*", - "spec/**/*", -] -Rake::Task[:lint].clear -PuppetLint::RakeTask.new :lint do |config| - config.disable_checks = ['80chars', 'autoloader_layout'] - config.ignore_paths = exclude_paths -end diff --git a/modules/enableit/redmine/data/common.yaml b/modules/enableit/redmine/data/common.yaml deleted file mode 100644 index 7254501f..00000000 --- a/modules/enableit/redmine/data/common.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -redmine::version: 2.6.2 -redmine::vhost_servername: localhost diff --git a/modules/enableit/redmine/data/os/Ubuntu-12.04.yaml b/modules/enableit/redmine/data/os/Ubuntu-12.04.yaml deleted file mode 100644 index 7c284763..00000000 --- a/modules/enableit/redmine/data/os/Ubuntu-12.04.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -redmine::version: 2.2.3 diff --git a/modules/enableit/redmine/hiera.yaml b/modules/enableit/redmine/hiera.yaml deleted file mode 100644 index f54cbbf9..00000000 --- a/modules/enableit/redmine/hiera.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -version: 5 -defaults: - datadir: data - data_hash: yaml_data - -hierarchy: - - "os/%{facts.os.family}-%{facts.os.release.major}.yaml" - - common diff --git a/modules/enableit/redmine/manifests/config.pp b/modules/enableit/redmine/manifests/config.pp deleted file mode 100644 index 3352c0c5..00000000 --- a/modules/enableit/redmine/manifests/config.pp +++ /dev/null @@ -1,80 +0,0 @@ -# Class redmine::config -class redmine::config { - - require 'apache' - - File { - owner => $apache::params::user, - group => $apache::params::group, - mode => '0644' - } - - file { $redmine::webroot: - ensure => link, - target => $redmine::install_dir - } - - # user switching makes passenger run redmine as the owner of the startup file - # which is config.ru or config/environment.rb depending on the Rails version - file { [ - "${redmine::install_dir}/config.ru", - "${redmine::install_dir}/config/environment.rb"]: - ensure => 'present', - } - - file { [ - "${redmine::install_dir}/files", - "${redmine::install_dir}/tmp", - "${redmine::install_dir}/tmp/sockets", - "${redmine::install_dir}/tmp/thumbnails", - "${redmine::install_dir}/tmp/cache", - "${redmine::install_dir}/tmp/test", - "${redmine::install_dir}/tmp/pdf", - "${redmine::install_dir}/tmp/sessions", - "${redmine::install_dir}/public/plugin_assets", - "${redmine::install_dir}/log"]: - ensure => 'directory', - } - - file { "${redmine::install_dir}/config/database.yml": - ensure => present, - content => template('redmine/database.yml.erb') - } - - file { "${redmine::install_dir}/config/configuration.yml": - ensure => present, - content => template('redmine/configuration.yml.erb') - } - - if $redmine::www_subdir { - file_line { 'redmine_relative_url_root': - path => "${redmine::install_dir}/config/environment.rb", - line => "Redmine::Utils::relative_url_root = '/${redmine::www_subdir}'", - match => '^Redmine::Utils::relative_url_root', - } - } else { - if $redmine::create_vhost { - apache::vhost { 'redmine': - port => '80', - docroot => "${redmine::webroot}/public", - servername => $redmine::vhost_servername, - serveraliases => $redmine::vhost_aliases, - options => 'Indexes FollowSymlinks ExecCGI', - custom_fragment => " - RailsBaseURI / - PassengerPreStart http://${redmine::vhost_servername} - ${redmine::vhost_custom_fragment} - ", - } - } - } - - # Log rotation - file { '/etc/logrotate.d/redmine': - ensure => present, - content => template('redmine/redmine-logrotate.erb'), - owner => 'root', - group => 'root' - } - -} diff --git a/modules/enableit/redmine/manifests/database.pp b/modules/enableit/redmine/manifests/database.pp deleted file mode 100644 index 5b8603b8..00000000 --- a/modules/enableit/redmine/manifests/database.pp +++ /dev/null @@ -1,12 +0,0 @@ -# Class redmine::database -class redmine::database { - - if $redmine::database_server == 'localhost' { - if $redmine::params::real_adapter == 'postgresql' { - class { 'redmine::database_psql': } - } else { - class { 'redmine::database_mysql': } - } - } - -} diff --git a/modules/enableit/redmine/manifests/database_mysql.pp b/modules/enableit/redmine/manifests/database_mysql.pp deleted file mode 100644 index 6de1716e..00000000 --- a/modules/enableit/redmine/manifests/database_mysql.pp +++ /dev/null @@ -1,29 +0,0 @@ -# Class redmine::database_mysql -class redmine::database_mysql { - - Mysql_database { - require => Class['mysql::server'] - } - - mysql_database { [$redmine::production_database,$redmine::development_database]: - ensure => present, - charset => 'utf8' - } - - -> mysql_user { "${redmine::database_user}@${redmine::database_server}": - password_hash => mysql_password($redmine::database_password) - } - - -> mysql_grant { "${redmine::database_user}@${redmine::database_server}/${redmine::production_database}.*": - user => "${redmine::database_user}@${redmine::database_server}", - privileges => ['all'], - table => "${redmine::production_database}.*" - } - - -> mysql_grant { "${redmine::database_user}@${redmine::database_server}/${redmine::development_database}.*": - user => "${redmine::database_user}@${redmine::database_server}", - privileges => ['all'], - table => "${redmine::development_database}.*" - } - -} diff --git a/modules/enableit/redmine/manifests/database_psql.pp b/modules/enableit/redmine/manifests/database_psql.pp deleted file mode 100644 index 459812e7..00000000 --- a/modules/enableit/redmine/manifests/database_psql.pp +++ /dev/null @@ -1,11 +0,0 @@ -# Class redmine::database_psql -class redmine::database_psql { - - postgresql::server::db { [$redmine::production_database,$redmine::development_database]: - user => $redmine::database_user, - password => postgresql_password($redmine::database_user, $redmine::database_password), - encoding => 'utf8', - require => Class['postgresql::server'] - } - -} diff --git a/modules/enableit/redmine/manifests/download.pp b/modules/enableit/redmine/manifests/download.pp deleted file mode 100644 index e5d0c586..00000000 --- a/modules/enableit/redmine/manifests/download.pp +++ /dev/null @@ -1,39 +0,0 @@ -# Class redmine::download -class redmine::download { - - # Install redmine from source - - Exec { - cwd => '/usr/src', - path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/', '/usr/local/bin/' ] - } - - if $redmine::provider == 'wget' { - stdlib::ensure_packages([ 'tar', 'wget' ]) - warning('The wget provider is deprecated and will be removed in the next major version.') - warning('Consider using a VCS like git or svn instead.') - exec { 'redmine_source': - command => "wget -O redmine.tar.gz ${redmine::download_url}", - creates => '/usr/src/redmine.tar.gz', - require => Package['wget'], - } - -> exec { 'extract_redmine': - command => "mkdir -p ${redmine::install_dir} && tar xvzf redmine.tar.gz --strip-components=1 -C ${redmine::install_dir}", - creates => $redmine::install_dir, - require => Package['tar'], - } - } elsif $redmine::provider == 'file' { - # EasyRedmine - redmine::easyredmine.include - } else { - stdlib::ensure_packages($redmine::params::provider_package) - vcsrepo { 'redmine_source': - revision => $redmine::params::version, - source => $redmine::download_url, - provider => $redmine::provider, - path => $redmine::install_dir, - require => Package[$redmine::params::provider_package] - } - - } -} diff --git a/modules/enableit/redmine/manifests/easyredmine.pp b/modules/enableit/redmine/manifests/easyredmine.pp deleted file mode 100644 index ffc1fc18..00000000 --- a/modules/enableit/redmine/manifests/easyredmine.pp +++ /dev/null @@ -1,13 +0,0 @@ -# Easyredmine -class redmine::easyredmine { - package { 'redmine-installer' : - provider => 'gem', - } - - exec { 'Install Easy Redmine': - path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin:/snap/bin', - command => "redmine install ${redmine::download_url} /usr/src/redmine", - creates => '/usr/src/redmine', - require => Package['redmine-installer'], - } -} diff --git a/modules/enableit/redmine/manifests/init.pp b/modules/enableit/redmine/manifests/init.pp deleted file mode 100644 index 0827bd30..00000000 --- a/modules/enableit/redmine/manifests/init.pp +++ /dev/null @@ -1,162 +0,0 @@ -# = Class: redmine -# -# This module installs redmine, running behind apache and passenger, -# and backed by eiter mysql or maria-db -# -# Tested on CentOS 6.5 and debian wheezy -# -#== Requirements -# Packages installed during process: -# All OS: make, gcc, tar and wget or your chosen vcs -# CentOS: mysql-devel or mariadb-devel, postgresql-devel, sqlite-devel, ImageMagick-devel, ruby-devel -# Debian: libmysql++-dev, libmysqlclient-dev, libmagickcore-dev, libmagickwand-dev, ruby-dev, imagemagick -# -# Gems installed during process: bundler -# -# Modules required: puppetlabs-mysql 2.0 or later, puppetlabs-stdlib, puppetlabs-apache, puppetlabs-concat -# Optional modules: puppetlabs-vcsrepo if you want to download redmine from a repository(the default) -# -# -#== Example -# class { 'apache': } -# class { 'apache::mod::passenger': } -# class { '::mysql::server': } -# class { 'redmine': } -# -# == Parameters -# -# [*version*] -# Set to desired version. -# Default: 2.2.3 -# -# [*download_url*] -# Download URL for redmine tar.gz when using wget as the provider. -# The repository url otherwise. -# When using wget, be sure to provide the full url. -# Default: https://github.com/redmine/redmine -# -# [*provider*] -# The VCS provider or wget. -# When setting the provider to wget, be sure to set download_url -# to a valid tar.gz archive. -# To use the svn provider you have to provide the full url to the -# tag or branch you want to download and unset the version. -# Default: git -# -# [*database_server*] -# Database server to use. -# Default: 'localhost' -# If server is not on localhost, the database and user must -# be setup in advance. -# -# [*database_user*] -# Database user. -# Default: 'redmine' -# -# [*database_password*] -# Database user password. -# Default: 'redmine' -# -# [*production_database*] -# Name of database to use for production environment. -# Default: 'redmine' -# -# [*development_database*] -# Name of database to use for development environment. -# Default: 'redmine_development' -# -# [*database_adapter*] -# Database adapter to use for database configuration. -# Can be either 'mysql' for ruby 1.8, 'mysql2' for ruby 1.9 or 'postgresql'. -# Default: undef (autodetects the correct mysql adapter) -# -# [*smtp_server*] -# SMTP server to use. -# Default: 'localhost' -# -# [*smtp_domain*] -# Domain to send emails from. -# Default: $::domain -# -# [*smtp_port*] -# SMTP port to use. -# Default: 25 -# -# [*smtp_authentication*] -# SMTP authentication mode. -# Default: ':login' -# -# [*smtp_username*] -# SMTP user name for authentication. -# Default: none -# -# [*smtp_password*] -# SMTP password for authentication. -# Default: none -# -# [*webroot*] -# Directory in which redmine web files will be installed. -# Default: 'DOCROOT/redmine' -# where DOCROOT is the document root of your apache server, -# usually /var/www or /var/www/html -# -# [*install_dir*] -# Path where redmine will be installed -# Default: '/usr/src/redmine' -# -# [*vhost_aliases*] -# Server aliases to use in the vhost config. Default 'redmine'. Expects a string. -# -# [*vhost_servername*] -# Server name to use in the vhost config. Default 'redmine'. Expects a string. -# -# [*override_options*] -# Extra options to add to configuration.yml. Empty by default. Expects a hash. -# -# [*plugins*] -# Optional hash of plugins, which are passed to redmine::plugin -# -# [*www_subdir*] -# Optional directory relative to the site webroot to install redmine in. -# Undef by default. Expects a path string without leading slash. -# When using this option the vhost config is your responsibility. -# -# [*create_vhost*] -# Enable or disable vhost creation. -# True by default. -# When disabling this option the vhost config is your responsibility. -# -class redmine ( - $version = undef, - $download_url = 'https://github.com/redmine/redmine', - $database_server = 'localhost', - $database_user = 'redmine', - $database_password = 'redmine', - $production_database = 'redmine', - $development_database = 'redmine_development', - $database_adapter = undef, - $smtp_server = 'localhost', - $smtp_domain = $facts['networking']['domain'], - $smtp_port = 25, - $smtp_authentication = false, - $smtp_username = '', - $smtp_password = '', - $vhost_aliases = 'redmine', - $vhost_servername = 'redmine', - $webroot = "${apache::docroot}/redmine", - $install_dir = '/usr/src/redmine', - $provider = 'git', - $override_options = {}, - $plugins = {}, - $www_subdir = undef, - $create_vhost = true, - String $vhost_custom_fragment = '', - Enum['redmine', 'easyredmine'] $app = 'redmine', -) { - class { 'redmine::params': } - -> class { 'redmine::download': } - -> class { 'redmine::config': } - -> class { 'redmine::install': } - -> class { 'redmine::database': } - -> class { 'redmine::rake': } -} diff --git a/modules/enableit/redmine/manifests/install.pp b/modules/enableit/redmine/manifests/install.pp deleted file mode 100644 index 5c004567..00000000 --- a/modules/enableit/redmine/manifests/install.pp +++ /dev/null @@ -1,58 +0,0 @@ -# Class redmine::install -class redmine::install { - - # Install dependencies - - $generic_packages = [ 'make', 'gcc' ] - - - case $redmine::database_adapter { - 'postgresql' : { - $without_gems = 'development test sqlite mysql' - $debian_packages = [ 'libmagickcore-dev', 'libmagickwand-dev', 'ruby-dev', 'libpq-dev', 'imagemagick' ] - $redhat_packages = [ 'postgresql-devel', 'sqlite-devel', 'ImageMagick-devel', 'ruby-devel' ] - } - default: { - $without_gems = 'development test sqlite postgresql' - $debian_packages = [ 'libmysql++-dev', 'libmysqlclient-dev', 'libmagickcore-dev', 'libmagickwand-dev', 'ruby-dev', 'imagemagick' ] - $redhat_packages = [ 'postgresql-devel', 'sqlite-devel', 'ImageMagick-devel', 'ruby-devel', $::redmine::params::mysql_devel ] - } - } - - case $facts['os']['family'] { - 'Debian': { $packages = concat($generic_packages, $debian_packages) } - 'RedHat': { $packages = concat($generic_packages, $redhat_packages) } - default: { $packages = concat($generic_packages, $redhat_packages) } - } - - stdlib::ensure_packages($packages) - - Exec { - cwd => '/usr/src', - path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/', '/usr/local/bin/' ] - } - - package { 'bundler': - ensure => present, - provider => gem - } - -> exec { 'bundle_redmine': - command => "bundle install --gemfile ${redmine::install_dir}/Gemfile --without ${without_gems}", - creates => "${redmine::install_dir}/Gemfile.lock", - require => [ Package['bundler'], Package['make'], Package['gcc'], Package[$packages] ], - notify => Exec['rails_migrations'], - } - - create_resources('redmine::plugin', $redmine::plugins) - - if $redmine::provider != 'wget' and $redmine::provider != 'file' { - exec { 'bundle_update': - cwd => $redmine::install_dir, - command => 'bundle update', - refreshonly => true, - subscribe => Vcsrepo['redmine_source'], - notify => Exec['rails_migrations'], - require => Exec['bundle_redmine'], - } - } -} diff --git a/modules/enableit/redmine/manifests/params.pp b/modules/enableit/redmine/manifests/params.pp deleted file mode 100644 index afd8000b..00000000 --- a/modules/enableit/redmine/manifests/params.pp +++ /dev/null @@ -1,58 +0,0 @@ -# Class redmine::params -class redmine::params { - - case $facts['os']['family'] { - 'RedHat': { - case $facts['os']['family'] { - 'Fedora': { - if versioncmp($facts['os']['release']['full'], '19') >= 0 or $facts['os']['release']['full'] == 'Rawhide' { - $mysql_devel = 'mariadb-devel' - } else { - $mysql_devel = 'mysql-devel' - } - } - /^(RedHat|CentOS|Scientific)$/: { - if versioncmp($facts['os']['release']['major'], '7') >= 0 { - $mysql_devel = 'mariadb-devel' - } else { - $mysql_devel = 'mysql-devel' - } - } - default: { - $mysql_devel = 'mysql-devel' - } - } - } - default: { - notice("nothing special for ${facts['os']['family']}") - } - } - - if $redmine::database_adapter { - $real_adapter = $redmine::database_adapter - } elsif versioncmp($facts['ruby']['version'], '1.9') >= 0 { - $real_adapter = 'mysql2' - } else { - $real_adapter = 'mysql' - } - - if $redmine::version { - $version = $redmine::version - } else { - $version = '2.2.3' - warning('The default version will change to 2.6.4 in the next major release') - warning('If this is not what you want, please specify a version in hiera or your manifest') - } - - case $redmine::provider { - 'svn' : { - $provider_package = 'subversion' - } - 'hg': { - $provider_package = 'mercurial' - } - default: { - $provider_package = $redmine::provider - } - } -} diff --git a/modules/enableit/redmine/manifests/plugin.pp b/modules/enableit/redmine/manifests/plugin.pp deleted file mode 100644 index 49a9f83a..00000000 --- a/modules/enableit/redmine/manifests/plugin.pp +++ /dev/null @@ -1,68 +0,0 @@ -#= Type redmine::plugin -#== Parameters -# -#[*ensure*] -# Wether the plugin should be installed. -# Possible values are installed, latest, and absent. -# -#[*source*] -# Repository of the plugin. Required -# -#[*version*] -# Set to desired version. -# -#[*provider*] -# The vcs provider. Default: git -# -define redmine::plugin ( - $ensure = present, - $source = undef, - $version = undef, - $provider = 'git', -) { - - $install_dir = "${redmine::install_dir}/plugins/${name}" - if $ensure == absent { - exec { "rake redmine:plugins:migrate NAME=${name} VERSION=0": - notify => Class['apache::service'], - path => ['/bin','/usr/bin', '/usr/local/bin'], - environment => ['HOME=/root','RAILS_ENV=production','REDMINE_LANG=en'], - provider => 'shell', - cwd => $redmine::install_dir, - before => Vcsrepo[$install_dir], - require => Exec['bundle_update'], - onlyif => "test -d ${install_dir}", - } - $notify = undef - } else { - $notify = Exec['bundle_update'] - } - - if $source == undef { - fail("no source specified for redmine plugin '${name}'") - } - validate_string($source) - - case $provider { - 'svn' : { - $provider_package = 'subversion' - } - 'hg': { - $provider_package = 'mercurial' - } - default: { - $provider_package = $provider - } - } - stdlib::ensure_packages($provider_package) - - vcsrepo { $install_dir: - ensure => $ensure, - revision => $version, - source => $source, - provider => $provider, - notify => $notify, - require => [ Package[$provider_package] - , Exec['bundle_redmine'] ] - } -} diff --git a/modules/enableit/redmine/manifests/rake.pp b/modules/enableit/redmine/manifests/rake.pp deleted file mode 100644 index 5eda23ba..00000000 --- a/modules/enableit/redmine/manifests/rake.pp +++ /dev/null @@ -1,39 +0,0 @@ -#Class redmine::rake - DB migrate/prep tasks -class redmine::rake { - - Exec { - path => ['/bin','/usr/bin', '/usr/local/bin'], - environment => ['HOME=/root','RAILS_ENV=production','REDMINE_LANG=en'], - provider => 'shell', - cwd => $redmine::install_dir, - } - - # Create session store - exec { 'session_store': - command => 'rake generate_session_store && touch .session_store', - creates => "${redmine::install_dir}/.session_store", - } - - # Perform rails migrations - exec { 'rails_migrations': - command => 'rake db:migrate', - notify => Exec['plugin_migrations'], - refreshonly => true, - } - - # Perform plugin migrations - exec { 'plugin_migrations': - command => 'rake redmine:plugins:migrate', - notify => Class['apache::service'], - refreshonly => true, - } - - # Seed DB data - exec { 'seed_db': - command => 'rake redmine:load_default_data && touch .seed', - creates => "${redmine::install_dir}/.seed", - notify => Class['apache::service'], - require => Exec['rails_migrations'], - } - -} diff --git a/modules/enableit/redmine/manifests/test_site.pp b/modules/enableit/redmine/manifests/test_site.pp deleted file mode 100644 index 9116b935..00000000 --- a/modules/enableit/redmine/manifests/test_site.pp +++ /dev/null @@ -1,6 +0,0 @@ -class { 'epel': } --> class { 'apache': } -class { 'apache::mod::passenger': } -class { '::mysql::server': } -class { 'redmine': } -stdlib::ensure_packages(['wget']) diff --git a/modules/enableit/redmine/metadata.json b/modules/enableit/redmine/metadata.json deleted file mode 100644 index 5ba12be7..00000000 --- a/modules/enableit/redmine/metadata.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "johanek-redmine", - "version": "2.3.0", - "author": "Johan van den Dorpe", - "license": "Apache-2.0", - "summary": "Module to install redmine", - "source": "https://github.com/johanek/johanek-redmine", - "project_page": "https://github.com/johanek/johanek-redmine", - "issues_url": "https://github.com/johanek/johanek-redmine/issues", - "tags": ["redmine", "project management"], - "operatingsystem_support": [ - { - "operatingsystem":"RedHat", - "operatingsystemmajrelease":[ "6" ] - }, - { - "operatingsystem":"CentOS", - "operatingsystemmajrelease":[ "6" ] - }, - { - "operatingsystem": "Ubuntu", - "operatingsystemrelease": [ "12.04", "14.04", "16.04" ] - }, - { - "operatingsystem": "Debian", - "operatingsystemrelease": [ "7" ] - } - ], - "dependencies": [ - { "name": "puppetlabs/stdlib", "version_requirement": ">=3.2.0 < 5.0.0" }, - { "name": "puppetlabs/mysql", "version_requirement": ">= 2.0.0 < 3.0.0" }, - { "name": "puppetlabs/postgresql", "version_requirement": ">= 3.3.0 < 5.0.0" }, - { "name": "puppetlabs/apache", "version_requirement": ">= 1.0.0 < 2.0.0" }, - { "name": "puppetlabs/concat", "version_requirement": ">= 1.0.0 < 2.0.0" }, - { "name": "puppetlabs/vcsrepo", "version_requirement": ">= 1.0.0 < 2.0.0" } - ] -} diff --git a/modules/enableit/redmine/spec/classes/redmine/redmine_spec.rb b/modules/enableit/redmine/spec/classes/redmine/redmine_spec.rb deleted file mode 100644 index 0bc9720d..00000000 --- a/modules/enableit/redmine/spec/classes/redmine/redmine_spec.rb +++ /dev/null @@ -1,345 +0,0 @@ -require 'spec_helper' - -describe 'redmine', :type => :class do - - let :facts do - { - :osfamily => 'Redhat', - :operatingsystemrelease => '6', - :operatingsystemmajrelease => '6', - :domain => 'test.com', - :concat_basedir => '/dne' - } - end - - let :pre_condition do - 'class { "apache": }' - end - - context 'no parameters' do - it { should create_class('redmine::config') } - it { should create_class('redmine::download') } - it { should create_class('redmine::install') } - it { should create_class('redmine::database') } - it { should create_class('redmine::rake') } - - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/adapter: mysql/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/database: redmine/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/database: redmine_development/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/host: localhost/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/username: redmine/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/password: redmine/) } - - it { should contain_file('/usr/src/redmine/config/configuration.yml').with_content(/address: localhost/) } - it { should contain_file('/usr/src/redmine/config/configuration.yml').with_content(/domain: test.com/) } - it { should contain_file('/usr/src/redmine/config/configuration.yml').with_content(/port: 25/) } - - it { should contain_package('make') } - it { should contain_package('gcc') } - - ['redmine', 'redmine_development'].each do |db| - it { should contain_mysql_database(db).with( - 'ensure' => 'present', - 'charset' => 'utf8' - ) } - - it { should contain_mysql_grant("redmine@localhost/#{db}.*").with( - 'privileges' => ['all'] - ) } - end - - it { should contain_mysql_user('redmine@localhost') } - - end - - context 'set version 2.2.2' do - let :params do - { :version => '2.2.2' } - end - - it { should contain_vcsrepo('redmine_source').with( - 'revision' => '2.2.2', - 'provider' => 'git', - 'source' => 'https://github.com/redmine/redmine', - 'path' => '/usr/src/redmine' - ) } - - it { should contain_file('/var/www/html/redmine').with( - 'ensure' => 'link', - 'target' => '/usr/src/redmine' - ) } - end - - context 'wget download' do - let :params do - { - :provider => 'wget', - :download_url => 'example.com/redmine.tar.gz' - } - end - - it { should contain_package('wget') } - it { should contain_package('tar') } - - it { should contain_exec('redmine_source').with( - 'cwd' => '/usr/src', - 'path' => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/', '/usr/local/bin/' ], - 'command' => 'wget -O redmine.tar.gz example.com/redmine.tar.gz', - 'creates' => '/usr/src/redmine.tar.gz' - ) } - - it { should contain_exec('extract_redmine').with( - 'cwd' => '/usr/src', - 'path' => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/', '/usr/local/bin/' ], - 'command' => 'mkdir -p /usr/src/redmine && tar xvzf redmine.tar.gz --strip-components=1 -C /usr/src/redmine', - 'creates' => '/usr/src/redmine' - ) } - - end - - context 'provider install' do - let :params do - { - :provider => 'svn' - } - end - - it {should contain_package('subversion')} - it { should contain_vcsrepo('redmine_source').that_requires('Package[subversion]') } - end - - context 'autodetect mysql adapter' do - context 'ruby2.0' do - let :facts do - { - :osfamily => 'Redhat', - :operatingsystemrelease => '6', - :operatingsystemmajrelease => '6', - :domain => 'test.com', - :concat_basedir => '/dne', - :rubyversion => '2.0', - } - end - - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/adapter: mysql2\n/) } - end - context 'ruby1.9' do - let :facts do - { - :osfamily => 'Redhat', - :operatingsystemrelease => '6', - :operatingsystemmajrelease => '6', - :domain => 'test.com', - :concat_basedir => '/dne', - :rubyversion => '1.9', - } - end - - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/adapter: mysql2\n/) } - end - context 'ruby1.8' do - let :facts do - { - :osfamily => 'Redhat', - :operatingsystemrelease => '6', - :operatingsystemmajrelease => '6', - :domain => 'test.com', - :concat_basedir => '/dne', - :rubyversion => '1.8', - } - end - - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/adapter: mysql\n/) } - end - end - - context 'set remote db params' do - let :params do - { - :database_adapter => 'mysql2', - :database_server => 'db1', - :database_user => 'dbuser', - :database_password => 'password', - :production_database => 'redproddb', - :development_database => 'reddevdb' - } - end - - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/adapter: mysql2/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/database: redproddb/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/database: reddevdb/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/host: db1/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/username: dbuser/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/password: password/) } - - it { should_not contain_mysql_database } - it { should_not contain_mysql_user } - it { should_not contain_mysql_grant } - - end - - context 'set postgresql adapter' do - let :params do - { - :database_adapter => 'postgresql', - :database_server => 'localhost', - :database_user => 'dbuser', - :database_password => 'password', - :production_database => 'redproddb', - :development_database => 'reddevdb' - } - end - - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/adapter: postgresql/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/database: redproddb/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/database: reddevdb/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/host: localhost/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/username: dbuser/) } - it { should contain_file('/usr/src/redmine/config/database.yml').with_content(/password: password/) } - - it { should_not contain_mysql_database } - it { should_not contain_mysql_user } - it { should_not contain_mysql_grant } - - ['redproddb', 'reddevdb'].each do |db| - it { should contain_postgresql__server__db(db).with( - 'encoding' => 'utf8', - 'user' => 'dbuser' - ) } - - end - - end - - context 'set override_options' do - let :params do - { - :override_options => { 'foo' => 'bar', 'additional' => 'options' } - } - end - - it { should contain_file('/usr/src/redmine/config/configuration.yml').with_content(/foo: bar/) } - it { should contain_file('/usr/src/redmine/config/configuration.yml').with_content(/additional: options/) } - - end - - context 'set local db params' do - let :params do - { - :database_server => 'localhost', - :database_user => 'dbuser', - :database_password => 'password', - :production_database => 'redproddb', - :development_database => 'reddevdb' - } - end - - ['redproddb', 'reddevdb'].each do |db| - it { should contain_mysql_database(db).with( - 'ensure' => 'present', - 'charset' => 'utf8' - ) } - - it { should contain_mysql_grant("dbuser@localhost/#{db}.*").with( - 'privileges' => ['all'] - ) } - end - - it { should contain_mysql_user('dbuser@localhost') } - - - end - - context 'set mail params' do - let :params do - { - :smtp_server => 'smtp', - :smtp_domain => 'google.com', - :smtp_port => 1234, - :smtp_authentication => true, - :smtp_username => 'user', - :smtp_password => 'password' - } - end - - it { should contain_file('/usr/src/redmine/config/configuration.yml').with_content(/address: smtp/) } - it { should contain_file('/usr/src/redmine/config/configuration.yml').with_content(/domain: google.com/) } - it { should contain_file('/usr/src/redmine/config/configuration.yml').with_content(/port: 1234/) } - it { should contain_file('/usr/src/redmine/config/configuration.yml').with_content(/authentication: :login/) } - it { should contain_file('/usr/src/redmine/config/configuration.yml').with_content(/user_name: user/) } - it { should contain_file('/usr/src/redmine/config/configuration.yml').with_content(/password: password/) } - end - - context 'set webroot' do - let :params do - { - :webroot => '/opt/redmine' - } - end - - it { should contain_file('/opt/redmine').with({'ensure' => 'link'}) } - it { should contain_apache__vhost('redmine').with({'docroot' => '/opt/redmine/public'}) } - end - - context 'debian' do - let :facts do - { - :osfamily => 'Debian', - :operatingsystemrelease => '6', - :operatingsystemmajrelease => '6', - :concat_basedir => '/dne' - } - end - - it { should contain_package('libmysql++-dev') } - it { should contain_package('libmysqlclient-dev') } - it { should contain_package('libmagickcore-dev') } - it { should contain_package('libmagickwand-dev') } - it { should contain_class('redmine').with('webroot' => '/var/www/redmine') } - - end - - context 'redhat' do - let :facts do - { - :osfamily => 'RedHat', - :operatingsystemrelease => '6', - :operatingsystemmajrelease => '6', - :concat_basedir => '/dne' - } - end - - it { should contain_package('mysql-devel') } - it { should contain_package('postgresql-devel') } - it { should contain_package('sqlite-devel') } - it { should contain_package('ImageMagick-devel') } - end - - context 'redhat7' do - let :facts do - { - :osfamily => 'RedHat', - :operatingsystem => 'RedHat', - :operatingsystemrelease => '7', - :operatingsystemmajrelease => '7', - :concat_basedir => '/dne' - } - end - - it { should contain_package('mariadb-devel') } - end - - context 'fedora19' do - let :facts do - { - :osfamily => 'RedHat', - :operatingsystem => 'Fedora', - :operatingsystemrelease => '19', - :concat_basedir => '/dne' - } - end - - it { should contain_package('mariadb-devel') } - end - -end diff --git a/modules/enableit/redmine/spec/defines/redmine_plugin_spec.rb b/modules/enableit/redmine/spec/defines/redmine_plugin_spec.rb deleted file mode 100644 index da9a9939..00000000 --- a/modules/enableit/redmine/spec/defines/redmine_plugin_spec.rb +++ /dev/null @@ -1,73 +0,0 @@ -require 'spec_helper' - -describe 'redmine::plugin', :type => :define do - - let :facts do - { - :osfamily => 'Redhat', - :operatingsystemrelease => '6', - :operatingsystemmajrelease => '6', - :domain => 'test.com', - :concat_basedir => '/dne' - } - end - - let :pre_condition do - 'class { "redmine": install_dir => "/opt/redmine" }' - end - - let(:title) { 'test_plugin' } - - context 'no parameters' do - it 'should raise an error when the source is not present' do - expect { should compile }.to raise_error(/source/) - end - end - - context 'plugin install' do - let :params do - { - :source => 'git://example.git', - :version => '1.2.3' - } - end - - it { should contain_vcsrepo('/opt/redmine/plugins/test_plugin').with( - 'revision' => '1.2.3', - 'provider' => 'git', - 'source' => 'git://example.git', - 'notify' => 'Exec[bundle_update]' - ) } - end - - context 'plugin uninstall' do - let :params do - { - :ensure => 'absent', - :source => 'git://example.git' - } - end - - it { should contain_exec('rake redmine:plugins:migrate NAME=test_plugin VERSION=0').with( - 'cwd' => '/opt/redmine', - 'before' => 'Vcsrepo[/opt/redmine/plugins/test_plugin]', - 'onlyif' => 'test -d /opt/redmine/plugins/test_plugin' - ) } - - it { should contain_vcsrepo('/opt/redmine/plugins/test_plugin').with( - 'ensure' => 'absent' - ) } - end - - context 'provider svn' do - let :params do - { - :source => 'git://example.git', - :provider => 'svn' - } - end - - it {should contain_package('subversion')} - it { should contain_vcsrepo('/opt/redmine/plugins/test_plugin').that_requires('Package[subversion]') } - end -end diff --git a/modules/enableit/redmine/spec/spec_helper.rb b/modules/enableit/redmine/spec/spec_helper.rb deleted file mode 100644 index 2c6f5664..00000000 --- a/modules/enableit/redmine/spec/spec_helper.rb +++ /dev/null @@ -1 +0,0 @@ -require 'puppetlabs_spec_helper/module_spec_helper' diff --git a/modules/enableit/redmine/templates/configuration.yml.erb b/modules/enableit/redmine/templates/configuration.yml.erb deleted file mode 100644 index dd551047..00000000 --- a/modules/enableit/redmine/templates/configuration.yml.erb +++ /dev/null @@ -1,15 +0,0 @@ -default: - delivery_method: :smtp - smtp_settings: - address: <%= scope.lookupvar('redmine::smtp_server') %> - port: <%= scope.lookupvar('redmine::smtp_port') %> - domain: <%= scope.lookupvar('redmine::smtp_domain') %> -<% if scope.lookupvar('redmine::smtp_authentication') == true -%> - authentication: :login - user_name: <%= scope.lookupvar('redmine::smtp_username') %> - password: <%= scope.lookupvar('redmine::smtp_password') %> -<% end -%> - -<% scope.lookupvar('redmine::override_options').keys.sort.each do |key| -%> - <%= key %>: <%= scope.lookupvar('redmine::override_options')[key] %> -<% end -%> diff --git a/modules/enableit/redmine/templates/database.yml.erb b/modules/enableit/redmine/templates/database.yml.erb deleted file mode 100644 index 2dab7d42..00000000 --- a/modules/enableit/redmine/templates/database.yml.erb +++ /dev/null @@ -1,15 +0,0 @@ -production: - adapter: <%= scope.lookupvar('redmine::params::real_adapter') %> - database: <%= scope.lookupvar('redmine::production_database') %> - username: <%= scope.lookupvar('redmine::database_user') %> - password: <%= scope.lookupvar('redmine::database_password') %> - host: <%= scope.lookupvar('redmine::database_server') %> - encoding: utf8 - -development: - adapter: <%= scope.lookupvar('redmine::params::real_adapter') %> - database: <%= scope.lookupvar('redmine::development_database') %> - username: <%= scope.lookupvar('redmine::database_user') %> - password: <%= scope.lookupvar('redmine::database_password') %> - host: <%= scope.lookupvar('redmine::database_server') %> - encoding: utf8 diff --git a/modules/enableit/redmine/templates/redmine-logrotate.erb b/modules/enableit/redmine/templates/redmine-logrotate.erb deleted file mode 100644 index 65d310c1..00000000 --- a/modules/enableit/redmine/templates/redmine-logrotate.erb +++ /dev/null @@ -1,13 +0,0 @@ -# THIS FILE IS AUTOMATICALLY DISTRIBUTED BY PUPPET. -# ANY CHANGES WILL BE OVERWRITTEN. - -<%= scope.lookupvar('redmine::install_dir')%>/log/*.log -{ - rotate 30 - daily - missingok - nodateext - compress - delaycompress - copytruncate -} diff --git a/modules/enableit/redmine/test/integration/default/serverspec/redmine_spec.rb b/modules/enableit/redmine/test/integration/default/serverspec/redmine_spec.rb deleted file mode 100644 index 01fda596..00000000 --- a/modules/enableit/redmine/test/integration/default/serverspec/redmine_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'serverspec' - -set :backend, :exec - -if os[:family] == 'redhat' - apacheservice = 'httpd' -elsif ['debian', 'ubuntu'].include?(os[:family]) - apacheservice = 'apache2' -end - -describe service(apacheservice) do - it { should be_running } -end - -describe port(80) do - it { should be_listening } -end - -describe service('mysqld') do - it { should be_running } -end - -describe command('wget http://localhost') do - its(:exit_status) { should eq 0 } -end - -describe command('passenger-status') do - its(:exit_status) { should eq 0 } - its(:stdout) { should match /redmine/ } -end diff --git a/modules/enableit/role/data/role/role::scanner::openvas.yaml b/modules/enableit/role/data/role/role::scanner::openvas.yaml new file mode 100644 index 00000000..610e8840 --- /dev/null +++ b/modules/enableit/role/data/role/role::scanner::openvas.yaml @@ -0,0 +1,4 @@ +--- +common::network::firewall::allow_docker: true +common::system::dns::listen_address: + - "192.168.0.1" diff --git a/modules/enableit/role/manifests/scanner/openvas.pp b/modules/enableit/role/manifests/scanner/openvas.pp index f0161e1e..a19af181 100644 --- a/modules/enableit/role/manifests/scanner/openvas.pp +++ b/modules/enableit/role/manifests/scanner/openvas.pp @@ -1,75 +1,8 @@ - -# @summary Class for managing the OpenVAS scanner -# -# @param install_dir The directory for installation. Defaults to '/opt/obmondo/docker-compose/openvas'. +# @summary Role for managing the OpenVAS scanner # # @param install Whether to install the scanner. Defaults to true. # -# @param web_bind_address The web bind address. Defaults to '127.0.0.1'. -# -# @param web_port The port for the web interface. Defaults to 9392. -# -# @param openvasd_mode The mode for openvasd. Defaults to 'service_notus'. -# -# @param openvasd_addressport The address and port for openvasd. Defaults to '0.0.0.0:80'. -# -# @param storage_path The path for storage. Defaults to '/var/lib/openvas/22.04/vt-data/nasl'. -# -# @param registry The registry for openvas. Defaults to 'registry.community.greenbone.net/community'. -# -# @param vulnerability_tests_version The version for vulnerability tests. Defaults to '202502250742'. -# -# @param notus_data_version The version for notus data. Defaults to '202502250410'. -# -# @param scap_data_version The version for SCAP data. Defaults to '202502240506'. -# -# @param cert_bund_data_version The version for cert bundle data. Defaults to '202502250409'. -# -# @param dfn_cert_data_version The version for DFN cert data. Defaults to '202502250401'. -# -# @param data_objects_version The version for data objects. Defaults to '202502250505'. -# -# @param report_formats_version The version for report formats. Defaults to '202502250500'. -# -# @param gpg_data_version The version for GPG data. Defaults to '1.1.0'. -# -# @param redis_server_version The version for Redis server. Defaults to '1.1.0'. -# -# @param pg_gvm_version The version for PostgreSQL GVM. Defaults to '22.6.7'. -# -# @param gsa_version The version for GSA. Defaults to '24.3.0'. -# -# @param gvmd_version The version for GVMD. Defaults to '25'. -# -# @param openvas_scanner_version The version for OpenVAS scanner. Defaults to '23.15.4'. -# -# @param ospd_openvas_version The version for OSP-OpenVAS. Defaults to '22.8.0'. -# -# @param gvm_tools_version The version for GVM tools. Defaults to '25'. -# -# @param feed_release_version The version for feed release. Defaults to '24.10'. -# -# @param data_mount_path The path for data mount. Defaults to '/mnt'. -# -# @param gvm_data_path The path for GVM data. Defaults to '/var/lib/gvm'. -# -# @param openvas_plugins_path The path for OpenVAS plugins. Defaults to '/var/lib/openvas/plugins'. -# -# @param redis_socket_path The path for Redis socket. Defaults to '/run/redis'. -# -# @param gvmd_socket_path The path for GVMD socket. Defaults to '/run/gvmd'. -# -# @param ospd_socket_path The path for OSPD socket. Defaults to '/run/ospd'. -# -# @param psql_data_path The path for PostgreSQL data. Defaults to '/var/lib/postgresql'. -# -# @param psql_socket_path The path for PostgreSQL socket. Defaults to '/var/run/postgresql'. -# -# @param openvas_config_path The path for OpenVAS configuration. Defaults to '/etc/openvas'. -# -# @param openvas_log_path The path for OpenVAS logs. Defaults to '/var/log/openvas'. -# -# @param notus_path The path for Notus. Defaults to '/var/lib/notus'. +# @param expose Whether to expose the scanner to the network. Defaults to true. # # @groups installation install_dir, install, storage_path, openvas_config_path, openvas_log_path. # @@ -84,42 +17,14 @@ # @groups registry_settings registry. # class role::scanner::openvas ( - Stdlib::Absolutepath $install_dir = '/opt/obmondo/docker-compose/openvas', Boolean $install = true, - Stdlib::Host $web_bind_address = '127.0.0.1', - Stdlib::Port $web_port = 9392, - Enum['service_notus'] $openvasd_mode = 'service_notus', - Eit_types::AddressPort $openvasd_addressport = '0.0.0.0:80', - Stdlib::Absolutepath $storage_path = '/var/lib/openvas/22.04/vt-data/nasl', - String $registry = 'registry.community.greenbone.net/community', - Eit_types::Version $vulnerability_tests_version = '202502250742', - Eit_types::Version $notus_data_version = '202502250410', - Eit_types::Version $scap_data_version = '202502240506', - Eit_types::Version $cert_bund_data_version = '202502250409', - Eit_types::Version $dfn_cert_data_version = '202502250401', - Eit_types::Version $data_objects_version = '202502250505', - Eit_types::Version $report_formats_version = '202502250500', - Eit_types::Version $gpg_data_version = '1.1.0', - Eit_types::Version $redis_server_version = '1.1.0', - Eit_types::Version $pg_gvm_version = '22.6.7', - Eit_types::Version $gsa_version = '24.3.0', - Eit_types::Version $gvmd_version = '25', - Eit_types::Version $openvas_scanner_version = '23.15.4', - Eit_types::Version $ospd_openvas_version = '22.8.0', - Eit_types::Version $gvm_tools_version = '25', - Eit_types::Version $feed_release_version = '24.10', - Stdlib::Absolutepath $data_mount_path = '/mnt', - Stdlib::Absolutepath $gvm_data_path = '/var/lib/gvm', - Stdlib::Absolutepath $openvas_plugins_path = '/var/lib/openvas/plugins', - Stdlib::Absolutepath $redis_socket_path = '/run/redis', - Stdlib::Absolutepath $gvmd_socket_path = '/run/gvmd', - Stdlib::Absolutepath $ospd_socket_path = '/run/ospd', - Stdlib::Absolutepath $psql_data_path = '/var/lib/postgresql', - Stdlib::Absolutepath $psql_socket_path = '/var/run/postgresql', - Stdlib::Absolutepath $openvas_config_path = '/etc/openvas', - Stdlib::Absolutepath $openvas_log_path = '/var/log/openvas', - Stdlib::Absolutepath $notus_path = '/var/lib/notus', + Boolean $expose = true, ) { contain role::virtualization::docker + + if $expose { + contain role::web::haproxy + } + contain profile::scanner::openvas } diff --git a/modules/enableit/role/manifests/web/haproxy.pp b/modules/enableit/role/manifests/web/haproxy.pp index d85b68c3..16153a4b 100644 --- a/modules/enableit/role/manifests/web/haproxy.pp +++ b/modules/enableit/role/manifests/web/haproxy.pp @@ -65,7 +65,6 @@ Array[Stdlib::IP::Address,1] $listen_on = ['0.0.0.0'], Enum['Modern','Intermediate'] $encryption_ciphers = 'Modern', Enum['auto', 'manual'] $configure = 'auto', - Hash[Eit_types::IP,Variant[ Array[Stdlib::Port], Stdlib::Port ]] $firewall = {}, Eit_types::Package_version $version = 'present', Hash $service_options = {}, Boolean $log_compressed = true, @@ -73,6 +72,8 @@ Boolean $__blendable, Boolean $send_log_summary = false, Array[String] $log_summary_recipients = ['info@enableit.dk'], + + Hash[Eit_types::IP,Variant[Array[Stdlib::Port], Stdlib::Port]] $firewall = {}, ) inherits role::web { confine($configure == 'manual', !$manual_config, 'Manual configuration need static haproxy config file') diff --git a/modules/enableit/stunnel/metadata.json b/modules/enableit/stunnel/metadata.json index 751fdacf..1c8ac8d8 100644 --- a/modules/enableit/stunnel/metadata.json +++ b/modules/enableit/stunnel/metadata.json @@ -16,7 +16,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">= 2.3.1 < 5.0.0" + "version_requirement": ">= 2.3.1 < 10.0.0" }, { "name": "puppet/systemd", diff --git a/modules/upstream/curator/metadata.json b/modules/upstream/curator/metadata.json index af20ad56..34f8db98 100644 --- a/modules/upstream/curator/metadata.json +++ b/modules/upstream/curator/metadata.json @@ -14,7 +14,7 @@ }, { "name": "puppetlabs/stdlib", - "version_requirement": ">=4.25.1 <9.0.0" + "version_requirement": ">=4.25.1 <10.0.0" }, { "name": "puppetlabs/concat", diff --git a/modules/upstream/mit_krb5/metadata.json b/modules/upstream/mit_krb5/metadata.json index 8bde25f4..2fa139d5 100644 --- a/modules/upstream/mit_krb5/metadata.json +++ b/modules/upstream/mit_krb5/metadata.json @@ -3,7 +3,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">=4.13.0 <9.0.0" + "version_requirement": ">=4.13.0 <10.0.0" }, { "name": "puppetlabs/concat", diff --git a/modules/upstream/pam_access/metadata.json b/modules/upstream/pam_access/metadata.json index d201fe47..548f5421 100644 --- a/modules/upstream/pam_access/metadata.json +++ b/modules/upstream/pam_access/metadata.json @@ -10,7 +10,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">= 6.5.0 < 8.0.0" + "version_requirement": ">= 6.5.0 < 10.0.0" }, { "name": "herculesteam/augeasproviders_pam", diff --git a/modules/upstream/perforce/metadata.json b/modules/upstream/perforce/metadata.json index a7662230..814b057c 100644 --- a/modules/upstream/perforce/metadata.json +++ b/modules/upstream/perforce/metadata.json @@ -10,7 +10,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">= 4.13.1 < 5.0.0" + "version_requirement": ">= 4.13.1 < 10.0.0" } ], "operatingsystem_support": [ diff --git a/modules/upstream/rngd/metadata.json b/modules/upstream/rngd/metadata.json index cb4f465d..d4d897ae 100644 --- a/modules/upstream/rngd/metadata.json +++ b/modules/upstream/rngd/metadata.json @@ -10,7 +10,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">=4.13.0 <7.0.0" + "version_requirement": ">=4.13.0 <10.0.0" } ], "operatingsystem_support": [ diff --git a/modules/upstream/ruby/metadata.json b/modules/upstream/ruby/metadata.json index 370e228c..1456e420 100644 --- a/modules/upstream/ruby/metadata.json +++ b/modules/upstream/ruby/metadata.json @@ -74,7 +74,7 @@ ], "dependencies": [ { - "name":"puppetlabs/stdlib","version_requirement":">= 4.13.1 < 7.0.0" + "name":"puppetlabs/stdlib","version_requirement":">= 4.13.1 < 10.0.0" } ] } diff --git a/modules/upstream/zfs/metadata.json b/modules/upstream/zfs/metadata.json index 5e8150d5..9ca09a64 100644 --- a/modules/upstream/zfs/metadata.json +++ b/modules/upstream/zfs/metadata.json @@ -10,7 +10,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">=4.13.0 <8.0.0" + "version_requirement": ">=4.13.0 <10.0.0" }, { "name": "puppet/kmod",