Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,6 @@ This would create the following symlinks:
/etc/home -> /env/site/profiles/home
```

#### Solaris specific

For usage on Solaris, you will need to define these variables:

$package_adminfile, $package_source and $service_provider

If you want to create a cron job, please set $afs_cron_job_interval to
'specific' and choose your values for $afs_cron_job_hour and $afs_cron_job_minute.

```yaml
afs::afs_cron_job_interval: 'specific'
afs::afs_cron_job_content: '[ -x /afs_maintenance.sh ] && /afs_maintenance.sh'
afs::afs_cron_job_hour: '2'
afs::afs_cron_job_minute: '42'

afs::package_adminfile: '/path/to/adminfile/noask'
afs::package_source: '/path/to/package/openafs-x.x.x-x-Sol10'
```

On Solaris containers, this module will not start the OpenAFS service and the
cronjob will not be created. Packages are still installed for the included tools.

## Limitations

This module has been tested to work on the following systems with Puppet
Expand All @@ -106,7 +84,6 @@ This module aims to support the current and previous major Puppet versions.
* EL 7
* EL 8
* EL 9
* Solaris 10
* Suse 10
* Suse 11
* Suse 12
Expand Down
27 changes: 0 additions & 27 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ The following parameters are available in the `afs` class:
* [`config_client_update`](#-afs--config_client_update)
* [`create_symlinks`](#-afs--create_symlinks)
* [`links`](#-afs--links)
* [`package_adminfile`](#-afs--package_adminfile)
* [`package_name`](#-afs--package_name)
* [`package_provider`](#-afs--package_provider)
* [`package_source`](#-afs--package_source)
* [`service_provider`](#-afs--service_provider)

##### <a name="-afs--afs_cellserverdb"></a>`afs_cellserverdb`
Expand Down Expand Up @@ -240,14 +237,6 @@ Hash of path and target to create symlinks from if $create_links is true.

Default value: `{}`

##### <a name="-afs--package_adminfile"></a>`package_adminfile`

Data type: `Optional[String]`

Solaris specific: string with adminfile.

Default value: `undef`

##### <a name="-afs--package_name"></a>`package_name`

Data type: `Variant[Array[String], String]`
Expand All @@ -256,22 +245,6 @@ Array or string of needed OpenAFS packages.

Default value: `undef`

##### <a name="-afs--package_provider"></a>`package_provider`

Data type: `Optional[String]`

Solaris specific: string with package source.

Default value: `undef`

##### <a name="-afs--package_source"></a>`package_source`

Data type: `Optional[String]`

Solaris specific: string with package source.

Default value: `undef`

##### <a name="-afs--service_provider"></a>`service_provider`

Data type: `Optional[String]`
Expand Down
8 changes: 0 additions & 8 deletions data/os/Solaris.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions hiera.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ hierarchy:
- name: "osfamily/major release"
paths:
- "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
# Used for Solaris
- "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
# Used to distinguish between Debian and Ubuntu
- "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
- name: "osfamily"
Expand Down
110 changes: 34 additions & 76 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,9 @@
# @param links
# Hash of path and target to create symlinks from if $create_links is true.
#
# @param package_adminfile
# Solaris specific: string with adminfile.
#
# @param package_name
# Array or string of needed OpenAFS packages.
#
# @param package_provider
# Solaris specific: string with package source.
#
# @param package_source
# Solaris specific: string with package source.
#
# @param service_provider
# String of which service provider should be used
#
Expand All @@ -125,22 +116,12 @@
Boolean $config_client_update = false,
Boolean $create_symlinks = false,
Hash $links = {},
Optional[String] $package_adminfile = undef,
Variant[Array[String], String] $package_name = undef,
Optional[String] $package_provider = undef,
Optional[String] $package_source = undef,
Optional[String] $service_provider = undef,
) {
$afs_suidcells_array = any2array($afs_suidcells)
$config_client_dir = dirname($config_client_path)

if $facts['os']['family'] == 'Solaris' and $facts['is_virtual'] == true and $facts['virtual'] == 'zone' {
$solaris_container = true
}
else {
$solaris_container = false
}

# TODO: Replace with Stdlib::Fqdn
afs::validate_domain_names { $afs_suidcells_array: }

Expand All @@ -153,24 +134,6 @@
File[afs_config_client],
]

if $package_adminfile != undef {
Package {
adminfile => $package_adminfile,
}
}

if $package_provider != undef {
Package {
provider => $package_provider,
}
}

if $package_source != undef {
Package {
source => $package_source,
}
}

package { $package_name:
ensure => installed,
before => $package_before,
Expand All @@ -179,10 +142,8 @@
common::mkdir_p { $afs_config_path: }
common::mkdir_p { $config_client_dir: }

if $solaris_container == false {
File {
before => Service[afs_openafs_client_service],
}
File {
before => Service[afs_openafs_client_service],
}

if ($facts['os']['family'] == 'Suse' and $facts['os']['release']['major'] =~ /12|15/) {
Expand Down Expand Up @@ -270,43 +231,40 @@
}
}

# Solaris containers must not start the service nor add setserverprefs cronjob.
if $solaris_container == false {
# THIS SERVICE SHOULD NOT BE RESTARTED
# Restarting it may cause AFS module and kernel problems.
service { 'afs_openafs_client_service':
ensure => 'running',
enable => true,
name => 'openafs-client',
hasstatus => false,
hasrestart => false,
restart => '/bin/true',
status => '/bin/ps -ef | /bin/grep -i "afsd" | /bin/grep -v "grep"',
require => $service_require,
}
# THIS SERVICE SHOULD NOT BE RESTARTED
# Restarting it may cause AFS module and kernel problems.
service { 'afs_openafs_client_service':
ensure => 'running',
enable => true,
name => 'openafs-client',
hasstatus => false,
hasrestart => false,
restart => '/bin/true',
status => '/bin/ps -ef | /bin/grep -i "afsd" | /bin/grep -v "grep"',
require => $service_require,
}

if ($afs_cron_job_content != undef) and ($afs_cron_job_interval != undef) {
if $afs_cron_job_interval == 'specific' {
cron { 'afs_cron_job':
ensure => present,
command => $afs_cron_job_content,
user => 'root',
minute => $afs_cron_job_minute,
hour => $afs_cron_job_hour,
month => $afs_cron_job_month,
weekday => $afs_cron_job_weekday,
monthday => $afs_cron_job_monthday,
}
if ($afs_cron_job_content != undef) and ($afs_cron_job_interval != undef) {
if $afs_cron_job_interval == 'specific' {
cron { 'afs_cron_job':
ensure => present,
command => $afs_cron_job_content,
user => 'root',
minute => $afs_cron_job_minute,
hour => $afs_cron_job_hour,
month => $afs_cron_job_month,
weekday => $afs_cron_job_weekday,
monthday => $afs_cron_job_monthday,
}
else {
file { 'afs_cron_job' :
ensure => file,
path => "/etc/cron.${afs_cron_job_interval}/afs_cron_job",
owner => 'root',
group => 'root',
mode => '0755',
content => $afs_cron_job_content,
}
}
else {
file { 'afs_cron_job' :
ensure => file,
path => "/etc/cron.${afs_cron_job_interval}/afs_cron_job",
owner => 'root',
group => 'root',
mode => '0755',
content => $afs_cron_job_content,
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@
"8"
]
},
{
"operatingsystem": "Solaris",
"operatingsystemrelease": [
"10"
]
},
{
"operatingsystem": "SLES",
"operatingsystemrelease": [
Expand Down
69 changes: 0 additions & 69 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -305,73 +305,4 @@
end
end
end

test_on_solaris = {
supported_os: [
{
'operatingsystem' => 'Solaris',
},
]
}

on_supported_os(test_on_solaris).each do |os, os_facts|
context "on #{os}(specific)" do
describe 'running in a container' do
let(:facts) do
os_facts.merge(
{
virtual: 'zone',
is_virtual: true,
},
)
end
let(:params) do
{
afs_suidcells: 'sunset.github.com',
afs_cell: 'sunset.github.com',
afs_cellserverdb: '>sunset.github.com\t#Sunset'
}
end

it { is_expected.to contain_file('afs_config_cacheinfo').with_before(nil) }
it { is_expected.to contain_file('afs_config_client').with_before(nil) }
it { is_expected.to contain_file('afs_config_suidcells').with_before(nil) }
it { is_expected.to contain_file('afs_config_thiscell').with_before(nil) }
it { is_expected.to contain_file('afs_config_cellserverdb').with_before(nil) }
it { is_expected.not_to contain_service('afs_openafs_client_service') }
it { is_expected.not_to contain_cron('afs_cron_job') }
it { is_expected.not_to contain_file('afs_cron_job') }
end

describe 'with specific parameters set' do
let(:facts) { os_facts }
let(:params) do
{
package_adminfile: '/sw/Solaris/Sparc/noask',
package_provider: 'sun',
package_source: '/sw/Solaris/Sparc/EISopenafs',
package_name: ['EISopenafs']
}
end

context 'where adminfile is </sw/Solaris/Sparc/noask>' do
it {
is_expected.to contain_package('EISopenafs').with('adminfile' => '/sw/Solaris/Sparc/noask')
}
end

context 'where package_provider is <sun>' do
it {
is_expected.to contain_package('EISopenafs').with('provider' => 'sun')
}
end

context 'where source is </sw/Solaris/Sparc/EISopenafs>' do
it {
is_expected.to contain_package('EISopenafs').with('source' => '/sw/Solaris/Sparc/EISopenafs')
}
end
end
end
end
end
9 changes: 0 additions & 9 deletions spec/spec_helper_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,5 @@ def platforms
package_name: ['openafs-modules-dkms', 'openafs-modules-source', 'openafs-client', 'openafs-doc', 'openafs-krb5', 'dkms'],
allow_unsupported_modules: false,
},
'Solaris-10-i86pc' =>
{
afs_config_path: '/usr/vice/etc',
cache_path: '/usr/vice/cache',
config_client_dkms: false,
config_client_path: '/usr/vice/etc/sysconfig/openafs-client',
package_name: ['EISopenafs'],
allow_unsupported_modules: false,
},
}
end
8 changes: 2 additions & 6 deletions templates/openafs-client.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@

#
# Disk-cache options
# Size of disk-cache is configured in file (RHEL + Solaris) /usr/vice/etc/cacheinfo or (SLE + Ubuntu) /etc/openafs/cacheinfo
# Size of disk-cache is configured in file (RHEL /usr/vice/etc/cacheinfo or (SLE + Ubuntu) /etc/openafs/cacheinfo
# Size should not be bigger than 20% of machine's memory, so that it can fit in filesystem-caching by OS.
# It is recommended for the disk cache to be on its own dedicated partition, to guarantee that the disk does not fill up.
# On Solaris, ZFS in some scenarios does not perform well for cache behavior, so instead create a zvol with UFS for the cache partition.
# If the cache-directory (RHEL + Solaris) /usr/vice/cache or (SLE + Ubuntu) /var/cache/openafs is on a separate partition,
# If the cache-directory (RHEL) /usr/vice/cache or (SLE + Ubuntu) /var/cache/openafs is on a separate partition,
# the cache-size should not be bigger than 95% of the partition-size. The client will not start if cache-size is bigger!
# Default value is 1GB, size should be monitored and then be adjusted. On Terminal-servers 3-4GB is a good starting point.
# Due to a bug in OpenAFS<1.6.11 for Solaris11 and newer: Don't use ZFS for cache if openafs-version is older than 1.6.11.
# Systems using UFS are not affected (even if the UFS filesystem is on a ZFS zvol)
# AFSD_ARGS="-dynroot -afsdb -daemons 6 -volumes 1000"
AFSD_ARGS="<%= @config_client_args %>"

Expand All @@ -44,7 +41,6 @@ UPDATE="<%= @config_client_update %>"
#
# This section is to control the AFS kernel module handling via DKMS or the openafs start-script.
# At the moment only available on RHEL and Ubuntu platform. On SLE <= 11 no stable DKMS available.
# It will be ignored on other platforms like Solaris.
# The package openafs-kernel-source/(Ubuntu: openafs-modules-source) is needed for the compile start-script method.
# For dkms the following packages are needed: dkms dkms-openafs
# For both options packages to build kernel-modules are needed.
Expand Down