Skip to content

Commit

Permalink
Role::Hathitrust - allow disabling afs
Browse files Browse the repository at this point in the history
  • Loading branch information
rrotter committed Feb 28, 2024
1 parent dc7c890 commit 57b2711
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/spec/fixtures/modules/
/spec/examples.txt
/tmp/
/vendor
/vendor/
/convert_report.txt
.DS_Store
Expand Down
10 changes: 8 additions & 2 deletions manifests/role/hathitrust.pp
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Copyright (c) 2018 The Regents of the University of Michigan.
# Copyright (c) 2018-2024 The Regents of the University of Michigan.
# All Rights Reserved. Licensed according to the terms of the Revised
# BSD License. See LICENSE.txt for details.

# The minimum configuration for a host that logically belongs to Hathitrust.
#
# @example
# include nebula::role::hathitrust
# # you may also want to include:
# include nebula::profile::hathitrust::networking
# include nebula::profile::hathitrust::hosts
class nebula::role::hathitrust (
String $internal_routing = '',
Boolean $afs = true,
) {

class { 'nebula::role::minimum':
Expand All @@ -16,7 +20,9 @@

if $facts['os']['family'] == 'Debian' {
include nebula::profile::krb5
include nebula::profile::afs
if $afs {
include nebula::profile::afs
}
include nebula::profile::duo
include nebula::profile::exim4
include nebula::profile::grub
Expand Down
20 changes: 20 additions & 0 deletions spec/classes/role/hathitrust_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true
require 'spec_helper'

describe 'nebula::role::hathitrust' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
let(:hiera_config) { 'spec/fixtures/hiera/hathitrust_config.yaml' }

it { is_expected.to compile }
it { is_expected.to contain_package('openafs-client') }

context 'when $afs is false' do
let(:params) { { afs: false } }

it { is_expected.not_to contain_package('openafs-client') }
end
end
end
end

0 comments on commit 57b2711

Please sign in to comment.