From 69ae3f456bc97cb78a7b125fe07dac2af12ba78f Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Thu, 16 May 2024 02:58:35 +0100 Subject: [PATCH] otrs: move to naga Signed-off-by: Grant Slater --- .github/workflows/test-kitchen.yml | 4 + .kitchen.yml | 3 - cookbooks/otrs/attributes/default.rb | 5 +- cookbooks/otrs/recipes/debian.rb | 129 ------------------ cookbooks/otrs/recipes/default.rb | 123 +++++------------ .../otrs/templates/default/apache-debian.erb | 114 ---------------- cookbooks/otrs/templates/default/apache.erb | 55 +++++--- roles/mail.rb | 2 +- roles/naga.rb | 15 +- roles/otrs.rb | 48 +++---- roles/ridley.rb | 6 +- test/data_bags/otrs-debian/passwords.json | 4 - .../otrs-debian/inspec/apache_spec.rb | 18 --- 13 files changed, 111 insertions(+), 415 deletions(-) delete mode 100644 cookbooks/otrs/recipes/debian.rb delete mode 100644 cookbooks/otrs/templates/default/apache-debian.erb delete mode 100644 test/data_bags/otrs-debian/passwords.json delete mode 100644 test/integration/otrs-debian/inspec/apache_spec.rb diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index bbcae2b54..45bfbf9f0 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -123,11 +123,15 @@ jobs: suite: osqa - os: debian-12 suite: imagery-tiler + - os: debian-12 + suite: otrs exclude: - suite: mailman os: ubuntu-2204 - suite: osqa os: ubuntu-2204 + - suite: otrs + os: ubuntu-2204 fail-fast: false steps: - name: Login to GitHub Container Registry diff --git a/.kitchen.yml b/.kitchen.yml index f439c2794..37cd3556a 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -283,9 +283,6 @@ suites: - name: otrs run_list: - recipe[otrs::default] - - name: otrs-debian - run_list: - - recipe[otrs::debian] - name: overpass run_list: - recipe[overpass::default] diff --git a/cookbooks/otrs/attributes/default.rb b/cookbooks/otrs/attributes/default.rb index 037cae612..cb21e5ff8 100644 --- a/cookbooks/otrs/attributes/default.rb +++ b/cookbooks/otrs/attributes/default.rb @@ -1,13 +1,12 @@ -default[:otrs][:version] = "6.0.48" default[:otrs][:user] = "otrs" default[:otrs][:group] = nil -default[:otrs][:database_cluster] = "15/main" +default[:otrs][:database_cluster] = "16/main" default[:otrs][:database_name] = "otrs" default[:otrs][:database_user] = "otrs" default[:otrs][:database_password] = "otrs" default[:otrs][:site] = "otrs" -default[:postgresql][:versions] |= ["15"] +default[:postgresql][:versions] |= ["16"] default[:accounts][:users][:otrs][:status] = :role default[:accounts][:groups][:"www-data"][:members] = [:otrs] diff --git a/cookbooks/otrs/recipes/debian.rb b/cookbooks/otrs/recipes/debian.rb deleted file mode 100644 index a51af6ba0..000000000 --- a/cookbooks/otrs/recipes/debian.rb +++ /dev/null @@ -1,129 +0,0 @@ -# -# Cookbook:: otrs -# Recipe:: debian -# -# Copyright:: 2024, OpenStreetMap Foundation -# -# 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 -# -# https://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. -# - -include_recipe "accounts" -include_recipe "apache" -include_recipe "exim" -include_recipe "postgresql" -include_recipe "tools" - -passwords = data_bag_item("otrs", "passwords") - -apache_module "perl" do - package "libapache2-mod-perl2" -end - -apache_module "deflate" -apache_module "headers" -apache_module "rewrite" - -database_cluster = node[:otrs][:database_cluster] -database_name = node[:otrs][:database_name] -database_user = node[:otrs][:database_user] -database_password = passwords[node[:otrs][:database_password]] -site = node[:otrs][:site] -site_aliases = node[:otrs][:site_aliases] || [] - -postgresql_user database_user do - cluster database_cluster - password database_password -end - -postgresql_database database_name do - cluster database_cluster - owner database_user -end - -package "dbconfig-common" - -template "/etc/dbconfig-common/otrs2.conf" do - source "dbconfig.config.erb" - owner "root" - group "root" - mode "600" - variables :database_name => database_name, - :database_user => database_user, - :database_password => database_password, - :database_cluster => database_cluster -end - -# Ensure the OTRS package in backports has a priority preference. -apt_preference "otrs2" do - pin "release o=Debian Backports" - pin_priority "600" -end - -apt_package "otrs2" - -# Ensure debconf is repopulated on a dbconfig change -execute "dpkg-reconfigure-otrs2" do - action :nothing - command "dpkg-reconfigure -fnoninteractive otrs2" - subscribes :run, "template[/etc/dbconfig-common/otrs2.conf]" -end - -# Disable deb otrs2 apache config -apache_conf "otrs2" do - action :disable -end - -# Disable deb otrs2 cron job -file "/etc/cron.d/otrs2" do - action :delete - manage_symlink_source true -end - -systemd_service "otrs" do - description "OTRS Daemon" - type "forking" - user "otrs" - group "www-data" - exec_start_pre "-/usr/share/otrs/bin/otrs.Daemon.pl stop" # Stop if race with deb cron - exec_start "/usr/share/otrs/bin/otrs.Daemon.pl start" - private_tmp true - protect_system "strict" - protect_home "read-only" - runtime_directory "otrs" - runtime_directory_mode 0o770 - runtime_directory_preserve true - read_write_paths ["/var/lib/otrs", "/run/otrs", "/var/log/exim4", "/var/spool/exim4"] -end - -service "otrs" do - action [:enable, :start] - subscribes :restart, "apt_package[otrs2]" - subscribes :restart, "systemd_service[otrs]" -end - -ssl_certificate site do - domains [site] + site_aliases - notifies :reload, "service[apache2]" -end - -apache_site site do - template "apache-debian.erb" - variables :aliases => site_aliases -end - -template "/etc/cron.daily/otrs-backup" do - source "backup.cron.erb" - owner "root" - group "root" - mode "755" -end diff --git a/cookbooks/otrs/recipes/default.rb b/cookbooks/otrs/recipes/default.rb index f16931b32..7aae67953 100644 --- a/cookbooks/otrs/recipes/default.rb +++ b/cookbooks/otrs/recipes/default.rb @@ -2,7 +2,7 @@ # Cookbook:: otrs # Recipe:: default # -# Copyright:: 2012, OpenStreetMap Foundation +# Copyright:: 2024, OpenStreetMap Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,50 +25,6 @@ include_recipe "tools" passwords = data_bag_item("otrs", "passwords") -package %w[ - tar - bzip2 - libapache-dbi-perl - libapache2-reload-perl - libarchive-zip-perl - libauthen-ntlm-perl - libauthen-sasl-perl - libcrypt-eksblowfish-perl - libcss-minifier-xs-perl - libdatetime-perl - libdbd-mysql-perl - libencode-hanextra-perl - libexcel-writer-xlsx-perl - libgd-gd2-perl - libgd-graph-perl - libgd-text-perl - libhtml-parser-perl - libio-socket-ssl-perl - libjavascript-minifier-xs-perl - libjson-perl - libjson-xs-perl - liblocale-codes-perl - libmail-imapclient-perl - libmoo-perl - libnet-dns-perl - libnet-ldap-perl - libpdf-api2-perl - libsisimai-perl - libsoap-lite-perl - libspreadsheet-xlsx-perl - libtemplate-perl - libtext-csv-xs-perl - libtext-diff-perl - libtimedate-perl - libxml-libxml-perl - libxml-libxml-simple-perl - libxml-libxslt-perl - libxml-parser-perl - libxml-simple-perl - libyaml-libyaml-perl - libyaml-perl -] - apache_module "perl" do package "libapache2-mod-perl2" end @@ -77,8 +33,6 @@ apache_module "deflate" apache_module "headers" apache_module "rewrite" -version = node[:otrs][:version] -user = node[:otrs][:user] database_cluster = node[:otrs][:database_cluster] database_name = node[:otrs][:database_name] database_user = node[:otrs][:database_user] @@ -96,67 +50,64 @@ postgresql_database database_name do owner database_user end -remote_file "#{Chef::Config[:file_cache_path]}/znuny-#{version}.tar.bz2" do - source "https://download.znuny.org/releases/znuny-#{version}.tar.bz2" - not_if { ::File.exist?("/opt/znuny-#{version}") } -end +package "dbconfig-common" -execute "untar-znuny-#{version}" do - command "tar jxf #{Chef::Config[:file_cache_path]}/znuny-#{version}.tar.bz2" - cwd "/opt" - user "root" +template "/etc/dbconfig-common/otrs2.conf" do + source "dbconfig.config.erb" + owner "root" group "root" - not_if { ::File.exist?("/opt/znuny-#{version}") } + mode "600" + variables :database_name => database_name, + :database_user => database_user, + :database_password => database_password, + :database_cluster => database_cluster end -config = edit_file "/opt/znuny-#{version}/Kernel/Config.pm.dist" do |line| - line.gsub!(/^( *)\$Self->{Database} = 'otrs'/, "\\1$Self->{Database} = '#{database_name}'") - line.gsub!(/^( *)\$Self->{DatabaseUser} = 'otrs'/, "\\1$Self->{DatabaseUser} = '#{database_user}'") - line.gsub!(/^( *)\$Self->{DatabasePw} = 'some-pass'/, "\\1$Self->{DatabasePw} = '#{database_password}'") - line.gsub!(/^( *)\$Self->{Database} = 'otrs'/, "\\1$Self->{Database} = '#{database_name}'") - line.gsub!(/^( *\$Self->{DatabaseDSN} = "DBI:mysql:)/, "#\\1") - line.gsub!(/^#( *\$Self->{DatabaseDSN} = "DBI:Pg:.*;host=)/, "\\1") - line.gsub!(/^( *)# (\$Self->{CheckMXRecord} = 0)/, "\\1\\2") - line.gsub!(/^( *)# \$Self->{SessionUseCookie} = 0/, "\\1$Self->{SessionCheckRemoteIP} = 0") - - line +# Ensure the OTRS package in backports has a priority preference. +apt_preference "otrs2" do + pin "release o=Debian Backports" + pin_priority "600" end -file "/opt/znuny-#{version}/Kernel/Config.pm" do - owner user - group "www-data" - mode "664" - content config - notifies :restart, "service[otrs]" -end +apt_package "otrs2" -execute "/opt/znuny-#{version}/bin/otrs.SetPermissions.pl" do +# Ensure debconf is repopulated on a dbconfig change +execute "dpkg-reconfigure-otrs2" do action :nothing - command "/opt/znuny-#{version}/bin/otrs.SetPermissions.pl --otrs-user=#{user} --web-group=www-data /opt/znuny-#{version}" - user "root" - group "root" - subscribes :run, "execute[untar-znuny-#{version}]" + command "dpkg-reconfigure -fnoninteractive otrs2" + subscribes :run, "template[/etc/dbconfig-common/otrs2.conf]" +end + +# Disable deb otrs2 apache config +apache_conf "otrs2" do + action :disable end -link "/opt/otrs" do - to "/opt/znuny-#{version}" +# Disable deb otrs2 cron job +file "/etc/cron.d/otrs2" do + action :delete + manage_symlink_source true end systemd_service "otrs" do description "OTRS Daemon" type "forking" user "otrs" - group "otrs" - exec_start "/opt/otrs/bin/otrs.Daemon.pl start" + group "www-data" + exec_start_pre "-/usr/share/otrs/bin/otrs.Daemon.pl stop" # Stop if race with deb cron + exec_start "/usr/share/otrs/bin/otrs.Daemon.pl start" private_tmp true protect_system "strict" - protect_home true - read_write_paths ["/opt/znuny-#{version}/var", "/var/log/exim4", "/var/spool/exim4"] + protect_home "read-only" + runtime_directory "otrs" + runtime_directory_mode 0o770 + runtime_directory_preserve true + read_write_paths ["/var/lib/otrs", "/run/otrs", "/var/log/exim4", "/var/spool/exim4"] end service "otrs" do action [:enable, :start] - subscribes :restart, "link[/opt/otrs]" + subscribes :restart, "apt_package[otrs2]" subscribes :restart, "systemd_service[otrs]" end diff --git a/cookbooks/otrs/templates/default/apache-debian.erb b/cookbooks/otrs/templates/default/apache-debian.erb deleted file mode 100644 index 1ec34fdd8..000000000 --- a/cookbooks/otrs/templates/default/apache-debian.erb +++ /dev/null @@ -1,114 +0,0 @@ -# DO NOT EDIT - This file is being maintained by Chef - - - ServerName <%= @name %> -<% @aliases.each do |alias_name| -%> - ServerAlias <%= alias_name %> -<% end -%> - ServerAdmin webmaster@openstreetmap.org - - CustomLog /var/log/apache2/<%= @name %>-access.log combined_extended - ErrorLog /var/log/apache2/<%= @name %>-error.log - - RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/ - RedirectPermanent / https://<%= @name %>/ - -<% unless @aliases.empty? -%> - - - ServerName <%= @aliases.first %> -<% @aliases.drop(1).each do |alias_name| -%> - ServerAlias <%= alias_name %> -<% end -%> - ServerAdmin webmaster@openstreetmap.org - - SSLEngine on - SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem - SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key - - CustomLog /var/log/apache2/<%= @name %>-access.log combined_extended - ErrorLog /var/log/apache2/<%= @name %>-error.log - - RedirectPermanent / https://<%= @name %>/ - -<% end -%> - - - ServerName <%= @name %> - ServerAdmin webmaster@openstreetmap.org - - CustomLog /var/log/apache2/<%= @name %>-access.log combined_extended - ErrorLog /var/log/apache2/<%= @name %>-error.log - - SSLEngine on - SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem - SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key - - ScriptAlias /otrs "/usr/share/otrs/bin/cgi-bin/" - Alias /otrs-web "/usr/share/otrs/var/httpd/htdocs/" - RedirectMatch ^/$ /otrs/index.pl - - Perlrequire /usr/share/otrs/scripts/apache2-perl-startup.pl - - PerlModule Apache2::Reload - PerlInitHandler Apache2::Reload - - - - ErrorDocument 403 /otrs/index.pl - ErrorDocument 404 /otrs/index.pl - SetHandler perl-script - PerlResponseHandler ModPerl::Registry - Options +ExecCGI - PerlOptions +ParseHeaders - PerlOptions +SetupEnv - Require all granted - - - - PerlOptions -ParseHeaders - - - - - AllowOverride None - Options +ExecCGI -Includes - Require all granted - - - - AllowOverride None - Require all granted - - # Make sure CSS and JS files are read as UTF8 by the browsers. - AddCharset UTF-8 .css - AddCharset UTF-8 .js - - # Set explicit mime type for woff fonts since it is relatively new and apache may not know about it. - AddType application/font-woff .woff - - -# Cache css-cache for 30 days - - - Header set Cache-Control "max-age=2592000, must-revalidate" - - - - - - Header set Cache-Control "max-age=14400, must-revalidate" - - - - - - Header set Cache-Control "max-age=2592000, must-revalidate" - - - - - - Header set Cache-Control "max-age=14400, must-revalidate" - - diff --git a/cookbooks/otrs/templates/default/apache.erb b/cookbooks/otrs/templates/default/apache.erb index a3605a966..17f0df118 100644 --- a/cookbooks/otrs/templates/default/apache.erb +++ b/cookbooks/otrs/templates/default/apache.erb @@ -11,7 +11,7 @@ ErrorLog /var/log/apache2/<%= @name %>-error.log RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/ - RedirectPermanent / https://otrs.openstreetmap.org/ + RedirectPermanent / https://<%= @name %>/ <% unless @aliases.empty? -%> @@ -44,15 +44,14 @@ SSLCertificateFile /etc/ssl/certs/<%= @name %>.pem SSLCertificateKeyFile /etc/ssl/private/<%= @name %>.key - ScriptAlias /otrs/ /opt/otrs/bin/cgi-bin/ - Alias /otrs-web/ /opt/otrs/var/httpd/htdocs/ + ScriptAlias /otrs "/usr/share/otrs/bin/cgi-bin/" + Alias /otrs-web "/usr/share/otrs/var/httpd/htdocs/" RedirectMatch ^/$ /otrs/index.pl - PerlRequire /opt/otrs/scripts/apache2-perl-startup.pl + Perlrequire /usr/share/otrs/scripts/apache2-perl-startup.pl PerlModule Apache2::Reload PerlInitHandler Apache2::Reload - PerlModule Apache2::RequestRec ErrorDocument 403 /otrs/index.pl @@ -70,25 +69,45 @@ - - AllowOverride None - Options +ExecCGI -Includes - Require all granted + + AllowOverride None + Options +ExecCGI -Includes + Require all granted - + AllowOverride None Require all granted + + # Make sure CSS and JS files are read as UTF8 by the browsers. + AddCharset UTF-8 .css + AddCharset UTF-8 .js + + # Set explicit mime type for woff fonts since it is relatively new and apache may not know about it. + AddType application/font-woff .woff + + +# Cache css-cache for 30 days + + + Header set Cache-Control "max-age=2592000, must-revalidate" + + + + + + Header set Cache-Control "max-age=14400, must-revalidate" + - - - Header set Cache-Control "max-age=2592000 must-revalidate" - + + + Header set Cache-Control "max-age=2592000, must-revalidate" + - - - Header set Cache-Control "max-age=2592000 must-revalidate" - + + + Header set Cache-Control "max-age=14400, must-revalidate" + diff --git a/roles/mail.rb b/roles/mail.rb index de74af25a..362adbe9e 100644 --- a/roles/mail.rb +++ b/roles/mail.rb @@ -47,7 +47,7 @@ default_attributes( :otrs => { :comment => "otrs.openstreetmap.org", :domains => ["otrs.openstreetmap.org"], - :host => "ridley.ucl.openstreetmap.org" + :host => "naga.dub.openstreetmap.org" }, :join => { :comment => "join.osmfoundation.org", diff --git a/roles/naga.rb b/roles/naga.rb index 2586aaf4a..4026bcac7 100644 --- a/roles/naga.rb +++ b/roles/naga.rb @@ -28,19 +28,6 @@ default_attributes( } } } - }, - :otrs => { - :site => "test.otrs.openstreetmap.org", - :site_aliases => ["test.otrs.osm.org"], - :database_cluster => "16/main" - }, - :postgresql => { - :versions => ["16"], - :settings => { - "16" => { - :port => 5433 - } - } } ) @@ -59,5 +46,5 @@ run_list( "recipe[hot]", "recipe[ideditor]", "recipe[dmca]", - "recipe[otrs::debian]" + "role[otrs]" ) diff --git a/roles/otrs.rb b/roles/otrs.rb index 94d4c4cd2..53ca0319e 100644 --- a/roles/otrs.rb +++ b/roles/otrs.rb @@ -9,109 +9,109 @@ default_attributes( :comment => "otrs@otrs.openstreetmap.org", :domains => ["otrs.openstreetmap.org"], :local_parts => ["otrs"], - :command => "/opt/otrs/bin/otrs.Console.pl Maint::PostMaster::Read", + :command => "/usr/share/otrs/bin/otrs.Console.pl Maint::PostMaster::Read", :user => "otrs", :group => "www-data", - :home_directory => "/opt/otrs" + :home_directory => "/usr/share/otrs" }, :otrs_data => { :comment => "data@otrs.openstreetmap.org", :domains => ["otrs.openstreetmap.org"], :local_parts => ["data"], - :command => "/opt/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Data Working Group'", + :command => "/usr/share/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Data Working Group'", :user => "otrs", :group => "www-data", - :home_directory => "/opt/otrs" + :home_directory => "/usr/share/otrs" }, :otrs_membership => { :comment => "membership@otrs.openstreetmap.org", :domains => ["otrs.openstreetmap.org"], :local_parts => ["membership"], - :command => "/opt/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Membership Working Group'", + :command => "/usr/share/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Membership Working Group'", :user => "otrs", :group => "www-data", - :home_directory => "/opt/otrs" + :home_directory => "/usr/share/otrs" }, :otrs_membership_osmf_talk_owner => { :comment => "osmf-talk-owner@otrs.openstreetmap.org", :domains => ["otrs.openstreetmap.org"], :local_parts => ["osmf-talk-owner"], - :command => "/opt/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Membership Working Group::osmf-talk'", + :command => "/usr/share/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Membership Working Group::osmf-talk'", :user => "otrs", :group => "www-data", - :home_directory => "/opt/otrs" + :home_directory => "/usr/share/otrs" }, :otrs_legal => { :comment => "legal@otrs.openstreetmap.org", :domains => ["otrs.openstreetmap.org"], :local_parts => ["legal"], - :command => "/opt/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Licensing Working Group'", + :command => "/usr/share/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Licensing Working Group'", :user => "otrs", :group => "www-data", - :home_directory => "/opt/otrs" + :home_directory => "/usr/share/otrs" }, :otrs_legal_privacy => { :comment => "legal-privacy@otrs.openstreetmap.org", :domains => ["otrs.openstreetmap.org"], :local_parts => ["legal-privacy"], - :command => "/opt/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Licensing Working Group::Privacy'", + :command => "/usr/share/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Licensing Working Group::Privacy'", :user => "otrs", :group => "www-data", - :home_directory => "/opt/otrs" + :home_directory => "/usr/share/otrs" }, :otrs_legal_questions => { :comment => "legal-questions@otrs.openstreetmap.org", :domains => ["otrs.openstreetmap.org"], :local_parts => ["legal-questions"], - :command => "/opt/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Licensing Working Group::Legal Questions'", + :command => "/usr/share/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Licensing Working Group::Legal Questions'", :user => "otrs", :group => "www-data", - :home_directory => "/opt/otrs" + :home_directory => "/usr/share/otrs" }, :otrs_legal_trademarks => { :comment => "legal-trademarks@otrs.openstreetmap.org", :domains => ["otrs.openstreetmap.org"], :local_parts => ["legal-trademarks"], - :command => "/opt/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Licensing Working Group::Trademarks'", + :command => "/usr/share/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Licensing Working Group::Trademarks'", :user => "otrs", :group => "www-data", - :home_directory => "/opt/otrs" + :home_directory => "/usr/share/otrs" }, :otrs_sotm_program => { :comment => "sotm-program@otrs.openstreetmap.org", :domains => ["otrs.openstreetmap.org"], :local_parts => ["sotm-program"], - :command => "/opt/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'State of the Map:Program'", + :command => "/usr/share/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'State of the Map:Program'", :user => "otrs", :group => "www-data", - :home_directory => "/opt/otrs" + :home_directory => "/usr/share/otrs" }, :otrs_communications => { :comment => "communications@otrs.openstreetmap.org", :domains => ["otrs.openstreetmap.org"], :local_parts => ["communications"], - :command => "/opt/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Communications Working Group'", + :command => "/usr/share/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Communications Working Group'", :user => "otrs", :group => "www-data", - :home_directory => "/opt/otrs" + :home_directory => "/usr/share/otrs" }, :otrs_communications_freebies => { :comment => "freebies@otrs.openstreetmap.org", :domains => ["otrs.openstreetmap.org"], :local_parts => ["freebies"], - :command => "/opt/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Communications Working Group::Freebies'", + :command => "/usr/share/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Communications Working Group::Freebies'", :user => "otrs", :group => "www-data", - :home_directory => "/opt/otrs" + :home_directory => "/usr/share/otrs" }, :otrs_support => { :comment => "support@otrs.openstreetmap.org", :domains => ["otrs.openstreetmap.org"], :local_parts => ["support"], - :command => "/opt/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Technical Support'", + :command => "/usr/share/otrs/bin/otrs.Console.pl Maint::PostMaster::Read --target-queue 'Technical Support'", :user => "otrs", :group => "www-data", - :home_directory => "/opt/otrs" + :home_directory => "/usr/share/otrs" } } }, diff --git a/roles/ridley.rb b/roles/ridley.rb index 08a97417d..7500247f3 100644 --- a/roles/ridley.rb +++ b/roles/ridley.rb @@ -2,6 +2,11 @@ name "ridley" description "Master role applied to ridley" default_attributes( + :accounts => { + :users => { + :otrs => { :status => :role } + } + }, :apache => { :mpm => "event", :event => { @@ -43,6 +48,5 @@ run_list( "role[foundation]", "role[stateofthemap]", "role[blog]", - "role[otrs]", "recipe[dhcpd]" ) diff --git a/test/data_bags/otrs-debian/passwords.json b/test/data_bags/otrs-debian/passwords.json deleted file mode 100644 index ccb5fecaf..000000000 --- a/test/data_bags/otrs-debian/passwords.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "id": "passwords", - "otrs": "database-password" -} diff --git a/test/integration/otrs-debian/inspec/apache_spec.rb b/test/integration/otrs-debian/inspec/apache_spec.rb deleted file mode 100644 index 8006330b4..000000000 --- a/test/integration/otrs-debian/inspec/apache_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -describe package("apache2") do - it { should be_installed } -end - -describe service("apache2") do - it { should be_enabled } - it { should be_running } -end - -describe port(80) do - it { should be_listening } - its("protocols") { should cmp "tcp" } -end - -describe port(443) do - it { should be_listening } - its("protocols") { should cmp "tcp" } -end -- 2.39.5