Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure procps-ng is installed on Red Hat. #154

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions data/RedHat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ tftp::service: tftp.socket
tftp::package: tftp-server
tftp::root: "/var/lib/tftpboot"
tftp::syslinux_package: syslinux
tftp::optional_packages:
- procps-ng
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# @param manage_root_dir manages the root dir, which tftpd will serve, defaults to true
# @param service Name of the TFTP service, when daemon is true
# @param service_provider Override TFTP service provider, when daemon is true
# @param optional_packages Any extra packages required.
class tftp (
Stdlib::Absolutepath $root,
String $package,
Expand All @@ -28,6 +29,7 @@
Boolean $manage_root_dir,
Optional[String] $service = undef,
Optional[String] $service_provider = undef,
Optional[Variant[String, Array[String]]] $optional_packages = undef,
) {
contain tftp::install
contain tftp::config
Expand Down
6 changes: 6 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@
ensure => installed,
}
}

if $tftp::optional_packages {
package { $tftp::optional_packages:
ensure => installed,
}
}
}
5 changes: 5 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
.with_alias('tftpd')
.that_subscribes_to('Class[Tftp::Config]')
end

it 'should contain the procps-ng package' do
should contain_package('procps-ng')
.with_ensure('installed')
end
when 'FreeBSD'
it 'should contain the service' do
should contain_service('tftpd')
Expand Down
Loading