Commit b093c9d6 authored by Lance Albertson's avatar Lance Albertson
Browse files

Add directives parameter to apache2_mod_auth_cas resource



This allows users to set other optional settings for the mod_auth_cas module.
Signed-off-by: default avatarLance Albertson <lance@osuosl.org>
parent 15dc19b4
......@@ -9,7 +9,7 @@ This file is used to list changes made in each version of the apache2 cookbook.
- Fix `libexec_dir` variable in `auth_cas.load` template
- Add Integration tests for `apache2_mod_auth_cas` resource
- Add docs for `apache2_mod_auth_cas`
- Add `:source_checksum`, `:login_url`, `:validate_url` properties to `apache2_mod_auth_cas` resource
- Add `:source_checksum`, `:login_url`, `:validate_url`, `:directives` properties to `apache2_mod_auth_cas` resource
- Allow `apache2_mod_auth_cas` resource to be nameless
- Update `mod_auth_cas` source version to 1.2 and other various updates for source installations
- Install `mod_auth_cas` by source on CentOS 8 and SUSE platforms (distro package is not currently available)
......
......@@ -15,20 +15,29 @@ This resource will call `_module` with the correct identifiers for you.
## Properties
| Name | Type | Default | Description |
| ----------------- | ------ | ----------------------------------------------- | ------------------------------------------------------------- |
| `install_method` | String | `apache_mod_auth_cas_install_method` | Install method for Mod auth CAS |
| `source_revision` | String | `v1.2` | Revision for the mod auth cas source install |
| `source_checksum` | String | (see resource default) | Checksum for the mod auth cas source install |
| `login_url` | String | `https://login.example.org/cas/login` | The URL to redirect users when not already logged in. |
| `validate_url` | String | `https://login.example.org/cas/serviceValidate` | The URL to use when validating a ticket presented by a client |
| `root_group` | String | `node['root_group']` | Group that the root user on the box runs as. |
| `apache_user` | String | `default_apache_user` | Set to override the default apache2 user. |
| `apache_group` | String | `default_apache_group` | Set to override the default apache2 user. |
| `mpm` | String | `default_mpm` | Used to determine which devel package to install |
| Name | Type | Default | Description |
| ----------------- | ------ | ----------------------------------------------- | ------------------------------------------------------------------------------ |
| `install_method` | String | `apache_mod_auth_cas_install_method` | Install method for Mod auth CAS |
| `source_revision` | String | `v1.2` | Revision for the mod auth cas source install |
| `source_checksum` | String | (see resource default) | Checksum for the mod auth cas source install |
| `login_url` | String | `https://login.example.org/cas/login` | The URL to redirect users when not already logged in. |
| `validate_url` | String | `https://login.example.org/cas/serviceValidate` | The URL to use when validating a ticket presented by a client |
| `root_group` | String | `node['root_group']` | Group that the root user on the box runs as. |
| `apache_user` | String | `default_apache_user` | Set to override the default apache2 user. |
| `apache_group` | String | `default_apache_group` | Set to override the default apache2 user. |
| `mpm` | String | `default_mpm` | Used to determine which devel package to install |
| `directives` | Hash | `nil` | Hash of optional directives to pass to the `mod_auth_cas module` configuration |
## Examples
```ruby
# Default settings
apache2_mod_auth_cas
# Setting optional CAS directives
apache2_mod_auth_cas 'default' do
directives(
'CASCookiePath' => "#{cache_dir}/mod_auth_cas/"
)
end
```
......@@ -42,6 +42,9 @@ property :mpm, String,
default: lazy { default_mpm },
description: 'Apache2 MPM: used to determine which devel package to install on Debian'
property :directives, Hash,
description: 'Hash of optional directives to pass to the mod_auth_cas module configuration'
action :install do
if new_resource.install_method.eql? 'source'
package [apache_devel_package(new_resource.mpm), apache_mod_auth_cas_devel_packages].flatten
......@@ -112,7 +115,8 @@ action :install do
mod_conf(
cache_dir: cache_dir,
login_url: new_resource.login_url,
validate_url: new_resource.validate_url
validate_url: new_resource.validate_url,
directives: new_resource.directives
)
end
......
......@@ -23,6 +23,7 @@ describe 'apache2_mod_auth_cas' do
cache_dir: '/var/cache/apache2',
login_url: 'https://login.example.org/cas/login',
validate_url: 'https://login.example.org/cas/serviceValidate',
directives: nil,
}
)
end
......
CASCookiePath <%= @cache_dir %>/mod_auth_cas/
CASLoginURL <%= @login_url %>
CASValidateURL <%= @validate_url %>
<% unless @directives.nil? -%>
<% @directives.sort_by { |key, val| key }.each do |directive, value| -%>
<%= directive %> <%= value %>
<% end -%>
<% end -%>
......@@ -8,4 +8,8 @@ service 'apache2' do
action [:start, :enable]
end
apache2_mod_auth_cas
apache2_mod_auth_cas 'default' do
directives(
'CASCookiePath' => "#{cache_dir}/mod_auth_cas/"
)
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