GitLab upgraded to 13.12.4-ee.0 - changelog: https://gitlab.com/gitlab-org/gitlab/blob/master/CHANGELOG-EE.md

Commit 9a754985 authored by Joseph Anthony Pasquale Holsten's avatar Joseph Anthony Pasquale Holsten Committed by Dan Webb
Browse files

default_apache_root_group: replace with ohai root_group (#665)

parent 544b3149
......@@ -4,6 +4,8 @@ This file is used to list changes made in each version of the apache2 cookbook.
## Unreleased
- default_apache_root_group: replace with ohai root_group
## 8.0.1
- Fix not reloading service when changes in port.conf / apache2.conf
......
......@@ -7,7 +7,7 @@ Writes conf files to the `conf-available` folder, and passes enabled values to `
| Name | Type | Default | Description |
| ----------------- | ------ | -------------------------------- | ---------------------------------------------------------------------------------- |
| path | String | `"#{apache_dir}/conf-available"` | Path to the conf-available directory |
| root_group | String | default_apache_root_group | Platform based default for the templates root group. |
| root_group | String | `node['root_group']` | Platform based default for the templates root group. |
| template_cookbook | String | apache2 | Cookbook to source the template from. Override this to provide your own template. |
### Examples
......
......@@ -4,7 +4,7 @@
| name | Type | Default | Description |
| ----------------------- | --------------- | --------------------------- | -------------------------------------------------------------------------------------------------------------- |
| root_group | String | `default_apache_root_group` | Group that the root user on the box runs as. Defaults to platform specific locations, see libraries/helpers.rb |
| root_group | String | `node['root_group']` | Group that the root user on the box runs as. Defaults to platform specific value from ohai root_group |
| access_file_name | String | `.htaccess` | Access filename |
| log_dir | String | `default_log_dir` | Log directory location. Defaults to platform specific locations, see libraries/helpers.rb |
| error_log | String | `default_error_log` | Error log location. Defaults to platform specific locations, see libraries/helpers.rb |
......
......@@ -14,8 +14,8 @@ Controls the default site.
| log_level | String | `warn` | Log level for apache2 |
| log_dir | String | `default_log_dir` | Defaults to platform specific locations, see libraries/helpers.rb |
| docroot_dir | String | `default_docroot_dir` | Apache document root. Defaults to platform specific locations, see libraries/helpers.rb |
| apache_root_group | String | `default_apache_root_group` | 'Group that the root user on the box runs as. Defaults to platform specific locations, see libraries/helpers.rb' |
| template_source | String | `default_site_template_source` | 'Source for the template. Defaults to #{new_resource.default_site_name}.conf on Debian flavours and welcome.conf on all other platforms' |
| apache_root_group | String | `node['root_group']` | Group that the root user on the box runs as. Defaults to platform specific value from ohai root_group |
| template_source | String | `default_site_template_source` | Source for the template. Defaults to #{new_resource.default_site_name}.conf on Debian flavours and welcome.conf on all other platforms |
## Actions
......
......@@ -6,7 +6,7 @@ Installs apache2.
| Name | Type | Default | Description | Allowed Values |
| --------------------------- | --------------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------- |
| root_group | String | `default_apache_root_group` | Group that the root user on the box runs as. Defaults to platform specific locations, see libraries/helpers.rb |
| root_group | String | `node['root_group']` | Group that the root user on the box runs as. Defaults to platform specific value from ohai root_group |
| apache_user | String | `default_apache_user` | Set to override the default apache2 user. Defaults to platform specific locations, see libraries/helpers.rb |
| apache_group | String | `default_apache_group` | Set to override the default apache2 user. Defaults to platform specific locations, see libraries/helpers.rb |
| log_dir | String | `default_log_dir` | Log directory location. Defaults to platform specific locations, see libraries/helpers.rb |
......
......@@ -9,7 +9,7 @@ This will use a template resource to write the module's configuration file in th
| Name | Type | Default | Description |
| ------------ | ------ | --------------------------- | ---------------------------------------------------------------------- |
| `template` | String | | Name of the template |
| `root_group` | String | `default_apache_root_group` | Set to override the platforms default root group for the template file |
| `root_group` | String | `node['root_group']` | Set to override the platforms default root group for the template file |
| `template_cookbook` | String | `apache2` | Cookbook containing the template file
## Examples
......
......@@ -7,7 +7,7 @@ Enable or disable an Apache module in `#{node['apache']['dir']}/mods-available`
| Name | Type | Default | Description |
| ----------------- | ------- | ------------------------- | ----------------------------------------------------------------------------------------------------------- |
| name | String | | Name of the module enabled or disabled with the `a2enmod` or `a2dismod` scripts. |
| identifier | String | default_apache_root_group | `#{name}_module` |
| identifier | String | `#{name}_module` | String to identify the module for the `LoadModule` directive |
| template_cookbook | String | apache2 | Cookbook to source the template from. Override this to provide your own template. |
| conf | Boolean | has_config? | The default is set by the config_file? helper. Override to set whether the module should have a config file |
......
......@@ -254,10 +254,6 @@ module Apache2
end
end
def default_apache_root_group
node['platform_family'] == 'freebsd' ? 'wheel' : 'root'
end
def default_modules
default_modules = %w(status alias auth_basic authn_core authn_file authz_core authz_groupfile
authz_host authz_user autoindex deflate dir env mime negotiation setenvif)
......
......@@ -5,7 +5,7 @@ property :path, String,
description: 'Path to the conf-available directory'
property :root_group, String,
default: lazy { default_apache_root_group },
default: lazy { node['root_group'] },
description: ''
property :template_cookbook, String,
......
include Apache2::Cookbook::Helpers
property :root_group, String,
default: lazy { default_apache_root_group },
default: lazy { node['root_group'] },
description: 'Group that the root user on the box runs as. Defaults to platform specific locations, see libraries/helpers.rb'
property :access_file_name, String,
......
......@@ -36,7 +36,7 @@ property :docroot_dir, String,
'Defaults to platform specific locations, see libraries/helpers.rb'
property :apache_root_group, String,
default: lazy { default_apache_root_group },
default: lazy { node['root_group'] },
description: 'Group that the root user on the box runs as.'\
'Defaults to platform specific locations, see libraries/helpers.rb'
......
include Apache2::Cookbook::Helpers
property :root_group, String,
default: lazy { default_apache_root_group },
default: lazy { node['root_group'] },
description: 'Group that the root user on the box runs as.
Defaults to platform specific locations, see libraries/helpers.rb'
......
......@@ -5,7 +5,7 @@ property :template, String,
description: 'Name of the template '
property :root_group, String,
default: lazy { default_apache_root_group },
default: lazy { node['root_group'] },
description: 'Set to override the platforms default root group for the template file'
property :template_cookbook, String,
......
......@@ -10,7 +10,7 @@ property :source_revision, String,
description: 'Revision for the mod auth cas source install'
property :root_group, String,
default: lazy { default_apache_root_group },
default: lazy { node['root_group'] },
description: 'Group that the root user on the box runs as.
Defaults to platform specific locations, see libraries/helpers.rb'
......
require 'spec_helper'
RSpec.describe Apache2::Cookbook::Helpers do
class DummyClass < Chef::Node
include Apache2::Cookbook::Helpers
end
subject { DummyClass.new }
describe '#default_apache_root_group' do
before do
allow(subject).to receive(:[]).with('platform_family').and_return(platform_family)
end
context 'with rhel family' do
let(:platform_family) { 'rhel' }
it 'returns the correct path' do
expect(subject.default_apache_root_group).to eq 'root'
end
end
context 'with fedora family' do
let(:platform_family) { 'fedora' }
it 'returns the correct path' do
expect(subject.default_apache_root_group).to eq 'root'
end
end
context 'with amazon family' do
let(:platform_family) { 'amazon' }
it 'returns the correct path' do
expect(subject.default_apache_root_group).to eq 'root'
end
end
context 'with SUSE family' do
let(:platform_family) { 'suse' }
it 'returns the correct path' do
expect(subject.default_apache_root_group).to eq 'root'
end
end
context 'with Debian' do
let(:platform_family) { 'debian' }
it 'returns the correct path' do
expect(subject.default_apache_root_group).to eq 'root'
end
end
context 'with arch' do
let(:platform_family) { 'arch' }
it 'returns the correct path' do
expect(subject.default_apache_root_group).to eq 'root'
end
end
context 'with freebsd' do
let(:platform_family) { 'freebsd' }
it 'returns the correct path' do
expect(subject.default_apache_root_group).to eq 'wheel'
end
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment